Commit 5a9f8218 authored by Dele Olajide's avatar Dele Olajide Committed by GitHub

Fix issue 1896 (#1897)

* fix issue https://github.com/conversejs/converse.js/issues/1896

* Added issue to CHANGES.md
parent f02caff8
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
example: export BOOTSTRAP_IGNORE_MODULES="Modal,Dropdown" && make dist example: export BOOTSTRAP_IGNORE_MODULES="Modal,Dropdown" && make dist
- New config option [modtools_disable_query](https://conversejs.org/docs/html/configuration.html#modtools-disable-query) - New config option [modtools_disable_query](https://conversejs.org/docs/html/configuration.html#modtools-disable-query)
- New config option [modtools_disable_assign](https://conversejs.org/docs/html/configuration.html#modtools-disable-assign) - New config option [modtools_disable_assign](https://conversejs.org/docs/html/configuration.html#modtools-disable-assign)
- #1896: Sending receipts for messages fetched from the archive
## 6.0.0 (2020-01-09) ## 6.0.0 (2020-01-09)
......
...@@ -389,7 +389,7 @@ converse.plugins.add('converse-chat', { ...@@ -389,7 +389,7 @@ converse.plugins.add('converse-chat', {
if (message) { if (message) {
this.updateMessage(message, original_stanza); this.updateMessage(message, original_stanza);
} else if ( } else if (
!this.handleReceipt (stanza, from_jid) && !this.handleReceipt (stanza, original_stanza, from_jid) &&
!this.handleChatMarker(stanza, from_jid) !this.handleChatMarker(stanza, from_jid)
) { ) {
if (this.handleRetraction(attrs)) { if (this.handleRetraction(attrs)) {
...@@ -808,10 +808,10 @@ converse.plugins.add('converse-chat', { ...@@ -808,10 +808,10 @@ converse.plugins.add('converse-chat', {
_converse.api.send(receipt_stanza); _converse.api.send(receipt_stanza);
}, },
handleReceipt (stanza, from_jid) { handleReceipt (stanza, original_stanza, from_jid) {
const is_me = Strophe.getBareJidFromJid(from_jid) === _converse.bare_jid; const is_me = Strophe.getBareJidFromJid(from_jid) === _converse.bare_jid;
const requests_receipt = sizzle(`request[xmlns="${Strophe.NS.RECEIPTS}"]`, stanza).pop() !== undefined; const requests_receipt = sizzle(`request[xmlns="${Strophe.NS.RECEIPTS}"]`, stanza).pop() !== undefined;
if (requests_receipt && !is_me && !u.isCarbonMessage(stanza)) { if (requests_receipt && !is_me && !u.isCarbonMessage(stanza) && !u.isMAMMessage(original_stanza)) {
this.sendReceiptStanza(from_jid, stanza.getAttribute('id')); this.sendReceiptStanza(from_jid, stanza.getAttribute('id'));
} }
const to_bare_jid = Strophe.getBareJidFromJid(stanza.getAttribute('to')); const to_bare_jid = Strophe.getBareJidFromJid(stanza.getAttribute('to'));
......
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