Skip to content

Commit

Permalink
Update channel members on QUIT
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed Apr 2, 2015
1 parent 559200b commit 4d39f7d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion irc/src/irc/channel.cr
Expand Up @@ -55,7 +55,7 @@ module IRC
return unless channel == @name

if prefix = message.prefix
nick, rest = prefix.split('!')
nick, _rest = prefix.split('!')
else
nick = @connection.config.nick
end
Expand All @@ -67,6 +67,13 @@ module IRC
end
end

@connection.on(IRC::Message::QUIT) do |message|
if prefix = message.prefix
nick, _rest = prefix.split('!')
delete_membership(nick)
end
end

@connection.on(IRC::Message::KICK) do |message|
channel, nick = message.parameters
delete_membership(nick) if channel == @name
Expand Down

0 comments on commit 4d39f7d

Please sign in to comment.