From: Darren Date: Wed, 16 Jul 2014 16:01:21 +0000 (+0100) Subject: Correctly using /quit command without reconnecting #567 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e32ff87b29adabd77f524c170fa1604bfee4a85f;p=KiwiIRC.git Correctly using /quit command without reconnecting #567 --- diff --git a/client/src/app.js b/client/src/app.js index c759d99..add00f1 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -106,7 +106,7 @@ _kiwi.global = { part: 'part', join: 'join', action: 'action', ctcp: 'ctcp', ctcpRequest: 'ctcpRequest', ctcpResponse: 'ctcpResponse', notice: 'notice', msg: 'privmsg', changeNick: 'changeNick', - channelInfo: 'channelInfo', mode: 'mode' + channelInfo: 'channelInfo', mode: 'mode', quit: 'quit' }; // Proxy each gateway method diff --git a/client/src/misc/clientuicommands.js b/client/src/misc/clientuicommands.js index eff0dcf..e20b387 100644 --- a/client/src/misc/clientuicommands.js +++ b/client/src/misc/clientuicommands.js @@ -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, @@ -517,6 +518,16 @@ } + 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, diff --git a/server/clientcommands.js b/server/clientcommands.js index a60a6e6..e8abdb5 100644 --- a/server/clientcommands.js +++ b/server/clientcommands.js @@ -183,10 +183,7 @@ var listeners = { quit: function (irc_connection, callback, args) { - websocket.ircConnection.end('QUIT :' + args.message + '\r\n'); - websocket.sentQUIT = true; - websocket.ircConnection.destroySoon(); - websocket.disconnect(); + irc_connection.end('QUIT :' + (args.message||'')); },