From d523854e9d21644bc60463220f96666e95d356d8 Mon Sep 17 00:00:00 2001 From: Ghouli Date: Fri, 10 Nov 2017 16:59:08 +0200 Subject: Fixed handling of KICK messages --- lib/exirc/client.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3