From 886c0907e57baf9750833ba5be2a963b06f6b620 Mon Sep 17 00:00:00 2001 From: Luke Bonaccorsi Date: Sun, 17 Jan 2016 02:48:27 +0000 Subject: [PATCH] Removed session data from user --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 683c519..8c83bbc 100644 --- a/index.js +++ b/index.js @@ -68,7 +68,10 @@ hangouts.prototype.init = function(){ self.connection.on('stanza', function(stanza) { if (stanza.is('message') && (stanza.attrs.type !== 'error') && (stanza.getChildText('body'))) { - self.messageRecieved(stanza.attrs.from, stanza.getChildText('body')); + var userParts = stanza.attrs.from.split('/'); + + userParts = userParts.slice(0, userParts.length - 1); + self.messageRecieved(stanza.attrs.from, stanza.getChildText('body'), userParts.join('/')); } if(stanza.is('presence') && stanza.attrs.type === 'subscribe') {