diff options
-rw-r--r-- | handlers.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/handlers.js b/handlers.js index e68a14d..c6d86de 100644 --- a/handlers.js +++ b/handlers.js @@ -136,6 +136,43 @@ module.exports.handleCommands = function(myClient) { }); }) + client.on('mode', function(event) { + var chatTab = $("[data-tab='"+ channel +"'].chat"); + var by = event.nick + var channel = event.target + event.modes.forEach(function (modeObj) { + + var mode = modeObj.mode + var argument = modeObj.param + if (mode == "+o") { + modeLine = " gives channel operator status to " + argument; + } else if (mode == "+v") { + modeLine = " gives voice to " + argument; + } else if (mode == "+h") { + modeLine = " gives channel half-operator status to " + argument; + } else if (mode == "+q") { + modeLine = " gives channel owner status to " + argument; + } else if (mode == "-o") { + modeLine = " removes channel operator status from " + argument; + } else if (mode == "-v") { + modeLine = " removes voice from "; + } else if (mode == "-h") { + modeLine = " removes channel half-operator status from " + argument; + } else if (mode == "-q") { + modeLine = " removes channel owner status from " + argument; + } else if (argument == myNick) { + modeLine = " sets mode " + mode + " on " + argument; + } else if (argument != null) { + modeLine = " sets mode " + mode + " " + argument + " on " +channel; + } else { + modeLine = " sets mode "+mode+" on " +channel + } + var chatTab = $("[data-tab='"+ channel +"'].chat"); + chatTab.append("<p class='chat-line'>"+by+modeLine+"</p>"); + }) + chatTab.scrollTop(chatTab.prop("scrollHeight")); + }) + } function receiveMsg(target, from, message) { |