From ee6d7ebd7a978d42a593e5eda00f6e1145ee227d Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 16 Jun 2016 17:24:58 +0200 Subject: [PATCH] Bugfix. Need to strip the resource to get the room jid --- src/converse-notification.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/converse-notification.js b/src/converse-notification.js index 4a3eef625..0fa554007 100644 --- a/src/converse-notification.js +++ b/src/converse-notification.js @@ -57,14 +57,15 @@ var notify_all = converse.notify_all_room_messages, jid = $message.attr('from'), resource = Strophe.getResourceFromJid(jid), + room_jid = Strophe.getBareJidFromJid(jid), sender = resource && Strophe.unescapeNode(resource) || ''; if (sender === '' || $message.find('delay').length > 0) { return false; } - var room = converse.chatboxes.get(Strophe.getBareJidFromJid(jid)); + var room = converse.chatboxes.get(room_jid); var body = $message.children('body').text(); var mentioned = (new RegExp("\\b"+room.get('nick')+"\\b")).test(body); - notify_all = notify_all === true || (_.isArray(notify_all) && _.contains(notify_all, jid)); + notify_all = notify_all === true || (_.isArray(notify_all) && _.contains(notify_all, room_jid)); if (sender === room.get('nick') || (!notify_all && !mentioned)) { return false; }