Commit ab9b2d64 authored by laszlovl's avatar laszlovl Committed by JC Brand

Fix incorrectly detecting every message with a duplicate ID as correction

parent 1a2de997
# Changelog # Changelog
## 5.0.4
- Bugfix: Don't treat every duplicate message ID as a message correction; since some
clients don't use globally unique ID's this causes false positives.
## 5.0.3 (2019-09-13) ## 5.0.3 (2019-09-13)
- Emit `chatBoxFocused` and `chatBoxBlurred` events for emoji picker input - Emit `chatBoxFocused` and `chatBoxBlurred` events for emoji picker input
......
...@@ -549,10 +549,10 @@ converse.plugins.add('converse-chatboxes', { ...@@ -549,10 +549,10 @@ converse.plugins.add('converse-chatboxes', {
* {@link _converse.ChatBox.getMessageAttributesFromStanza} * {@link _converse.ChatBox.getMessageAttributesFromStanza}
*/ */
correctMessage (attrs) { correctMessage (attrs) {
if (!attrs.msgid || !attrs.from) { if (!attrs.replaced_id || !attrs.from) {
return; return;
} }
const message = this.messages.findWhere({'msgid': attrs.msgid, 'from': attrs.from}); const message = this.messages.findWhere({'msgid': attrs.replaced_id, 'from': attrs.from});
if (!message) { if (!message) {
return; return;
} }
...@@ -969,6 +969,7 @@ converse.plugins.add('converse-chatboxes', { ...@@ -969,6 +969,7 @@ converse.plugins.add('converse-chatboxes', {
'is_spoiler': !!spoiler, 'is_spoiler': !!spoiler,
'message': text, 'message': text,
'msgid': msgid, 'msgid': msgid,
'replaced_id': replaced_id,
'references': this.getReferencesFromStanza(stanza), 'references': this.getReferencesFromStanza(stanza),
'subject': _.propertyOf(stanza.querySelector('subject'))('textContent'), 'subject': _.propertyOf(stanza.querySelector('subject'))('textContent'),
'thread': _.propertyOf(stanza.querySelector('thread'))('textContent'), 'thread': _.propertyOf(stanza.querySelector('thread'))('textContent'),
......
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