Ignore messages without a body
This commit is contained in:
parent
705c043852
commit
d2933b896e
@ -63,8 +63,11 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var room = converse.chatboxes.get(room_jid);
|
var room = converse.chatboxes.get(room_jid);
|
||||||
var body = $message.children('body').text();
|
var $body = $message.children('body');
|
||||||
var mentioned = (new RegExp("\\b"+room.get('nick')+"\\b")).test(body);
|
if (!$body.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var mentioned = (new RegExp("\\b"+room.get('nick')+"\\b")).test($body.text());
|
||||||
notify_all = notify_all === true || (_.isArray(notify_all) && _.contains(notify_all, room_jid));
|
notify_all = notify_all === true || (_.isArray(notify_all) && _.contains(notify_all, room_jid));
|
||||||
if (sender === room.get('nick') || (!notify_all && !mentioned)) {
|
if (sender === room.get('nick') || (!notify_all && !mentioned)) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user