Correctly using /quit command without reconnecting #567
authorDarren <darren@darrenwhitlen.com>
Wed, 16 Jul 2014 16:01:21 +0000 (17:01 +0100)
committerDarren <darren@darrenwhitlen.com>
Wed, 16 Jul 2014 16:01:21 +0000 (17:01 +0100)
client/src/app.js
client/src/misc/clientuicommands.js
server/clientcommands.js

index c759d994cf2801a282c185d46d408cbf1c2036f0..add00f143c212178f4c1b2f7b6d60512dae0d163 100644 (file)
@@ -106,7 +106,7 @@ _kiwi.global = {
                 part: 'part', join: 'join', action: 'action', ctcp: 'ctcp',\r
                 ctcpRequest: 'ctcpRequest', ctcpResponse: 'ctcpResponse',\r
                 notice: 'notice', msg: 'privmsg', changeNick: 'changeNick',\r
-                channelInfo: 'channelInfo', mode: 'mode'\r
+                channelInfo: 'channelInfo', mode: 'mode', quit: 'quit'\r
             };\r
 \r
             // Proxy each gateway method\r
index eff0dcf2f8b68b027ea9026ccdc3ac40265bc92d..e20b387bb7ede259f6cfb8c17a6c981dd3b69efc 100644 (file)
@@ -75,6 +75,7 @@
         'command:kick':        kickCommand,
         'command:clear':       clearCommand,
         'command:ctcp':        ctcpCommand,
+        'command:quit':        quitCommand,
         'command:server':      serverCommand,
         'command:whois':       whoisCommand,
         'command:whowas':      whowasCommand,
     }
 
 
+    function quitCommand (ev) {
+        var network = this.app.connections.active_connection;
+
+        if (!network)
+            return;
+
+        network.gateway.quit(ev.params.join(' '));
+    }
+
+
     function serverCommand (ev) {
         var that = this,
             server, port, ssl, password, nick,
index a60a6e64cebda42eb3c262b0a7c7f4ee35a9aa05..e8abdb587a531e5e3624595b577dc19003348715 100644 (file)
@@ -183,10 +183,7 @@ var listeners = {
 \r
 \r
     quit: function (irc_connection, callback, args) {\r
-        websocket.ircConnection.end('QUIT :' + args.message + '\r\n');\r
-        websocket.sentQUIT = true;\r
-        websocket.ircConnection.destroySoon();\r
-        websocket.disconnect();\r
+        irc_connection.end('QUIT :' + (args.message||''));\r
     },\r
 \r
 \r