diff options
author | Paul Schoenfelder <paulschoenfelder@gmail.com> | 2017-12-11 13:56:09 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-11 13:56:09 -0600 |
commit | a2f3e3975a9bab61a2610f3109733afe8bd4563b (patch) | |
tree | 37392746cb52085dc72b72db14820f42c60a0e36 | |
parent | Merge pull request #70 from w1gz/master (diff) | |
parent | Fixed handling of KICK messages (diff) |
Merge pull request #72 from Ghouli/master
Fixed handling of KICK messages
-rw-r--r-- | lib/exirc/client.ex | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/exirc/client.ex b/lib/exirc/client.ex index 9d6905b..c86f58d 100644 --- a/lib/exirc/client.ex +++ b/lib/exirc/client.ex @@ -692,17 +692,17 @@ defmodule ExIrc.Client do {:noreply, state} end # Called when we are kicked from a channel - def handle_data(%IrcMessage{cmd: "KICK", args: [channel, nick], nick: by, host: host, user: user} = _msg, %ClientState{nick: nick} = state) do + def handle_data(%IrcMessage{cmd: "KICK", args: [channel, nick, reason], nick: by, host: host, user: user} = _msg, %ClientState{nick: nick} = state) do sender = %SenderInfo{nick: by, host: host, user: user} if state.debug?, do: debug "WE WERE KICKED FROM #{channel} BY #{by}" - send_event {:kicked, sender, channel}, state + send_event {:kicked, sender, channel, reason}, state {:noreply, state} end # Called when someone else was kicked from a channel - def handle_data(%IrcMessage{cmd: "KICK", args: [channel, nick], nick: by, host: host, user: user} = _msg, state) do + def handle_data(%IrcMessage{cmd: "KICK", args: [channel, nick, reason], nick: by, host: host, user: user} = _msg, state) do sender = %SenderInfo{nick: by, host: host, user: user} if state.debug?, do: debug "#{nick} WAS KICKED FROM #{channel} BY #{by}" - send_event {:kicked, nick, sender, channel}, state + send_event {:kicked, nick, sender, channel, reason}, state {:noreply, state} end # Called when someone sends us a message |