summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js60
1 files changed, 11 insertions, 49 deletions
diff --git a/index.js b/index.js
index 48f55a0..1975bc0 100644
--- a/index.js
+++ b/index.js
@@ -148,53 +148,15 @@ $("#send-message").keypress(function(e) {
}
});
-function createListeners(client) {
-
-client.addListener('error', function(message) {
- console.log('error: ', message);
-});
-
-
-client.addListener('motd', function(motd) {
- var statusTab = $("[data-tab=status].chat");
- statusTab.append("<p class='chat-line'>"+motd+"</p>")
- statusTab.scrollTop(statusTab.prop("scrollHeight"));
-});
-
-client.addListener('raw', function(message) {
- var statusTab = $("[data-tab=status].chat");
- statusCmds = ["NOTICEAUTH", "rpl_welcome, rpl_yourhost", "rpl_created", "rpl_myinfo", "rpl_isupport", "rpl_luserclient", "rpl_luserop", "rpl_luserme", "rpl_luserchannels", "rpl_localusers", "rpl_globalusers"];
- if (statusCmds.indexOf(message.command) > -1 || message.command.startsWith("rpl_")) {
- statusTab.append("<p class='chat-line'>"+message.command + ": " +message.args+"</p>")
- statusTab.scrollTop(statusTab.prop("scrollHeight"));
- }
-});
-
-client.addListener('kick', function(channel, nick, by, reason, message) {
- if (myNick == nick) {
- removeChannel(channel, false);
- } else {
- channel = channel.replace("#","");
- if($(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").length > 0) {
- $(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").remove();
- }
- var chatTab = $("[data-tab=chan-"+ channel +"].chat");
- chatTab.append("<p class='chat-line'>"+nick+"was kicked from #"+channel+" by "+by+" ("+reason+")</p>")
- chatTab.scrollTop(chatTab.prop("scrollHeight"));
- }
-});
-
-client.addListener('kill', function(nick, reason, channels, message) {
- channels.forEach(function(channel) {
- channel = channel.replace("#","")
- if($(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").length > 0) {
- $(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").remove();
- }
- var chatTab = $("[data-tab=chan-"+ channel +"].chat");
- chatTab.append("<p class='chat-line'>"+nick+" was killed by the server ("+reason+")</p>")
- chatTab.scrollTop(chatTab.prop("scrollHeight"));
- });
-});
-
-}
+// client.addListener('kill', function(nick, reason, channels, message) {
+// channels.forEach(function(channel) {
+// channel = channel.replace("#","")
+// if($(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").length > 0) {
+// $(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").remove();
+// }
+// var chatTab = $("[data-tab=chan-"+ channel +"].chat");
+// chatTab.append("<p class='chat-line'>"+nick+" was killed by the server ("+reason+")</p>")
+// chatTab.scrollTop(chatTab.prop("scrollHeight"));
+// });
+// });