From 6d2df7527011691e038dbdaab59cb69be81a634c Mon Sep 17 00:00:00 2001 From: Mal Curtis Date: Mon, 22 Apr 2013 11:03:49 +1200 Subject: [PATCH] Don't kick the kicker out of the rooms --- server/irc/connection.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/server/irc/connection.js b/server/irc/connection.js index c392cac..94b857e 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -109,7 +109,7 @@ IrcConnection.prototype.applyIrcEvents = function () { 'user:*:nick': onUserNick, 'channel:*:part': onUserParts, 'channel:*:quit': onUserParts, - 'channel:*:kick': onUserParts + 'channel:*:kick': onUserKick }; EventBinder.bindIrcEvents('', this.irc_events, this, this); @@ -314,6 +314,18 @@ function onUserParts(event) { } } +function onUserKick(event){ + // Only deal with ourselves being kicked from a channel + if (event.kicked !== this.nick) + return; + + if (this.irc_channels[event.channel]) { + this.irc_channels[event.channel].dispose(); + delete this.irc_channels[event.channel]; + } + +} + -- 2.25.1