diff options
Diffstat (limited to 'handlers.js')
-rw-r--r-- | handlers.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/handlers.js b/handlers.js index c6d86de..24b783c 100644 --- a/handlers.js +++ b/handlers.js @@ -173,6 +173,23 @@ module.exports.handleCommands = function(myClient) { chatTab.scrollTop(chatTab.prop("scrollHeight")); }) + client.on('kick', function(event) { + var kicked = event.kicked + var by = event.nick + var channel = event.channel + var reason = event.message + if (globals.myNick == kicked) { + commands.removeChannel(channel, false); + } else { + if($(".ui.users[data-tab='"+channel+"'] [data-nick="+kicked+"]").length > 0) { + $(".ui.users[data-tab='"+channel+"'] [data-nick="+kicked+"]").remove(); + } + var chatTab = $("[data-tab='"+ channel +"'].chat"); + chatTab.append("<p class='chat-line'>"+kicked+" was kicked from "+channel+" by "+by+" ("+reason+")</p>") + chatTab.scrollTop(chatTab.prop("scrollHeight")); + } + }) + } function receiveMsg(target, from, message) { |