Fix issue 1896 (#1897)

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

* Added issue to CHANGES.md
This commit is contained in:
Dele Olajide 2020-02-28 10:24:25 +00:00 committed by GitHub
parent f02caff854
commit 5a9f8218c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@
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_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)

View File

@ -389,7 +389,7 @@ converse.plugins.add('converse-chat', {
if (message) {
this.updateMessage(message, original_stanza);
} else if (
!this.handleReceipt (stanza, from_jid) &&
!this.handleReceipt (stanza, original_stanza, from_jid) &&
!this.handleChatMarker(stanza, from_jid)
) {
if (this.handleRetraction(attrs)) {
@ -808,10 +808,10 @@ converse.plugins.add('converse-chat', {
_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 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'));
}
const to_bare_jid = Strophe.getBareJidFromJid(stanza.getAttribute('to'));