First Kiwi CTCP command structure implemented for initial testing. Socket writing...
[KiwiIRC.git] / js / front.js
index fd5c2796a1703330c569f80bdf8d7336125a4f66..68f32f0f662b3910a013b59e3fbaca55d82ae46a 100644 (file)
@@ -35,6 +35,7 @@ var front = {
         $(gateway).bind("onpart", front.onPart);
         $(gateway).bind("onkick", front.onKick);
         $(gateway).bind("onquit", front.onQuit);
+        $(gateway).bind("onmode", front.onMode);
         $(gateway).bind("onwhois", front.onWhois);
         $(gateway).bind("onsync", front.onSync);
         $(gateway).bind("onchannel_redirect", front.onChannelRedirect);
@@ -42,6 +43,7 @@ var front = {
         $(gateway).bind("onctcp_request", front.onCTCPRequest);
         $(gateway).bind("onctcp_response", front.onCTCPResponse);
         $(gateway).bind("onirc_error", front.onIRCError);
+        $(gateway).bind("onkiwi", front.onKiwi);
         
         this.buffer = [];
         
@@ -167,6 +169,10 @@ var front = {
             front.joinChannel($(this).text());
             return false;
         });
+
+
+
+        for(var i in plugins) plugs.loadPlugin(plugins[i]);
         
     },
     
@@ -351,6 +357,11 @@ var front = {
                     //gateway.raw('TOPIC ' + front.cur_channel.name + ' :' + msg.split(' ', 2)[1]);
                 }
                 break;
+
+            case '/kiwi':
+                gateway.kiwi(front.cur_channel.name, msg.substring(6));
+                break;
+
             default:
                 //front.cur_channel.addMsg(null, ' ', '--> Invalid command: '+parts[0].substring(1));
                 gateway.raw(msg.substring(1));
@@ -450,6 +461,10 @@ var front = {
     
     onCTCPResponse: function (e, data) {
     },
+
+    onKiwi: function (e, data) {
+        //console.log(data);
+    },
     
     onConnect: function (e, data) {
         if (data.connected) {
@@ -501,6 +516,9 @@ var front = {
             front.cur_channel.addMsg(null, data.nick, 'idle for ' + data.idle + ' seconds', 'whois');
         }
     },
+    onMode: function (e, data) {
+        console.log(data);
+    },
     onUserList: function (e, data) {
         var ul, nick, mode;
         if (front.tabviews[data.channel.toLowerCase()] === undefined) {