Permalink
Browse files

Remove channel from state when kicked

If kicked out of a channel remove it from the internal state so that the bot
will not try to join it again on reconnect.
  • Loading branch information...
1 parent d8533ff commit bbfe3b520a373baabd56501a42690a324cb6d8be @gdamjan committed Oct 5, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/channels_plugin.erl
@@ -25,6 +25,9 @@ handle_event(Msg, Channels) ->
{in, _Ref, [_Server, _, <<"PART">>, Channel]} ->
%% keep track of channels
{ok, sets:del_element(Channel, Channels)};
+ {in, _Ref, [_Server, _, <<"KICK">>, Channel|_]} ->
+ %% keep track of channels
+ {ok, sets:del_element(Channel, Channels)};
_ ->
{ok, Channels}
end.

0 comments on commit bbfe3b5

Please sign in to comment.