# HG changeset patch # User Emmanuel Gil Peyrot # Date 1330030041 -3600 # Node ID 4a063df30be900b24a733723c08bd5904a778866 # Parent e6f5077c2ea9578420099ebfc71929c0b1d1fe5e Correctly exit. diff --git a/isshouni.js b/isshouni.js --- a/isshouni.js +++ b/isshouni.js @@ -48,6 +48,9 @@ var disconnect = function() { cl.send(new xmpp.Element('presence', {to: config.muc + '/' + config.nick, type: 'unavailable'})); process.stdin.end(); cl.end(); + + tty.setRawMode(false); + setTimeout(process.exit, 1000); }; var send_message = function(name, arg, type) { @@ -126,10 +129,10 @@ var on_presence = function(from, stanza) if (!connected) return; - console.log('New participant: ' + from.resource); + /*console.log('New participant: ' + from.resource); if (paused) - send_message('paused', undefined, 'chat'); + send_message('paused', undefined, 'chat');*/ }; cl.on('error', function(e) { @@ -149,9 +152,7 @@ var commands = { return 'pause'; }, 'q': function() { - tty.setRawMode(false); disconnect(); - process.exit(); return 'quit'; }, };