Commit a52e24ad authored by JC Brand's avatar JC Brand

Fixes #1087

parent cb0d8c7d
...@@ -821,16 +821,9 @@ ...@@ -821,16 +821,9 @@
isDuplicate (message, original_stanza) { isDuplicate (message, original_stanza) {
const msgid = message.getAttribute('id'), const msgid = message.getAttribute('id'),
jid = message.getAttribute('from'), jid = message.getAttribute('from');
resource = Strophe.getResourceFromJid(jid),
sender = resource && Strophe.unescapeNode(resource) || '';
if (msgid) { if (msgid) {
return this.messages.filter( return this.messages.where({'msgid': msgid, 'from': jid}).length;
// Some bots (like HAL in the prosody chatroom)
// respond to commands with the same ID as the
// original message. So we also check the sender.
(msg) => msg.get('msgid') === msgid && msg.get('fullname') === sender
).length > 0;
} }
return false; return false;
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment