Added support for RPL_BANLIST[END] to server, stub methods in the client.
authorJack Allnutt <m2ys4u@Gmail.com>
Sun, 25 Sep 2011 01:19:34 +0000 (02:19 +0100)
committerJack Allnutt <m2ys4u@Gmail.com>
Sun, 25 Sep 2011 01:19:34 +0000 (02:19 +0100)
js/front.events.js
js/front.js
node/app.js

index 4966721346b53492f53c9809d1a07fcfa3e0bb5e..7df5313ddb029ac06f5ada495e1dba6f6b986f1c 100644 (file)
@@ -16,6 +16,8 @@ kiwi.front.events = {
         $(kiwi.gateway).bind("onlist_start", this.onChannelListStart);\r
         $(kiwi.gateway).bind("onlist_channel", this.onChannelList);\r
         $(kiwi.gateway).bind("onlist_end", this.onChannelListEnd);\r
+        $(kiwi.gateway).bind("banlist", this.onBanList);\r
+        $(kiwi.gateway).bind("banlist_end", this.onBanListEnd);\r
         $(kiwi.gateway).bind("onjoin", this.onJoin);\r
         $(kiwi.gateway).bind("ontopic", this.onTopic);\r
         $(kiwi.gateway).bind("onpart", this.onPart);\r
@@ -195,7 +197,6 @@ kiwi.front.events = {
             }\r
         };\r
 \r
-        // TODO: convert seconds to mins:secs\r
         secs = Math.floor(data.delay / 1000);\r
         mins = Math.floor(secs / 60);\r
         secs = secs % 60;\r
@@ -338,6 +339,11 @@ kiwi.front.events = {
         kiwi.front.cache.list.tab.show();\r
     },\r
 \r
+    onBanList: function (e, data) {\r
+    },\r
+\r
+    onBanListEnd: function (e, data) {\r
+    },\r
 \r
     onJoin: function (e, data) {\r
         var tab = Tabview.getTab(data.channel);\r
index 41d7173cd8ebe36439bd9f109640a1ef7061719b..c72d02d4b2b27d76ff04f7d14655d6c6fc0e7917 100644 (file)
@@ -1183,6 +1183,9 @@ Tabview.prototype.changeTopic = function (new_topic) {
 };
 // Static functions
 Tabview.tabExists = function (name) {
+    if ((!name) || (typeof name !== 'string')) {
+        return false;
+    }
     var ret = (typeof kiwi.front.tabviews[name.toLowerCase()] !== 'undefined');
     return ret;
 };
index 21656faacc0ce6bdc795eccf0014373e5203936f..63ab3b495314308878070af553c50ad73007463d 100644 (file)
@@ -90,6 +90,8 @@ var ircNumerics = {
     RPL_TOPIC:              '332',
     RPL_NAMEREPLY:          '353',
     RPL_ENDOFNAMES:         '366',
+    RPL_BANLIST:            '367',
+    RPL_ENDOFBANLIST:       '368',
     RPL_MOTD:               '372',
     RPL_WHOISMODES:         '379',
     ERR_NOSUCHNICK:         '401',
@@ -284,6 +286,14 @@ this.parseIRCMessage = function (websocket, ircSocket, data) {
         case ircNumerics.ERR_NOSUCHNICK:
             websocket.sendClientEvent('irc_error', {error: 'no_such_nick', nick: msg.params.split(" ")[1], reason: msg.trailing});
             break;
+        case ircNumerics.RPL_BANLIST:
+            params = msg.params.split(" ");
+            console.log(params);
+            websocket.sendClientEvent('banlist', {server: '', channel: params[1], banned: params[2], banned_by: params[3], banned_at: params[4]});
+            break;
+        case ircNumerics.RPL_ENDOFBANLIST:
+            websocket.sendClientEvent('banlist_end', {server: '', channel: msg.params.split(" ")[1]});
+            break;
         case 'JOIN':
             // Some BNC's send malformed JOIN causing the channel to be as a
             // parameter instead of trailing.