# HG changeset patch # User Emmanuel Gil Peyrot # Date 1330037491 -3600 # Node ID 377a9b42226a3ffd14ed4427ba7e844e69d80e8e # Parent 4a063df30be900b24a733723c08bd5904a778866 Add logging fonctions and don’t listen to messages from the room itself. diff --git a/isshouni.js b/isshouni.js --- a/isshouni.js +++ b/isshouni.js @@ -73,7 +73,7 @@ var send_command = function(text) { }; cl.on('stanza', function(stanza) { - //console.log(stanza.toString()); + console.log(stanza.toString()); var type = stanza.attrs['type']; var from = new JID(stanza.attrs['from']); @@ -97,7 +97,7 @@ cl.on('stanza', function(stanza) { }); var on_message = function(from, stanza) { - if (from.resource === config.nick) + if (from.resource && from.resource === config.nick) return; var message = stanza.getChild('body'); @@ -110,7 +110,7 @@ var on_message = function(from, stanza) if (!payload) return; - //send_command('osd_show_text "' + from.resource + ' did ' + payload.name + '"'); + send_command('osd_show_text "' + from.resource + ' did ' + payload.name + '"'); if (payload.name === 'pause') { send_command('pause');