|
@@ -61982,7 +61982,6 @@ _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-cha
|
|
const archive = sizzle(`result[xmlns="${Strophe.NS.MAM}"]`, original_stanza).pop(),
|
|
const archive = sizzle(`result[xmlns="${Strophe.NS.MAM}"]`, original_stanza).pop(),
|
|
spoiler = sizzle(`spoiler[xmlns="${Strophe.NS.SPOILER}"]`, original_stanza).pop(),
|
|
spoiler = sizzle(`spoiler[xmlns="${Strophe.NS.SPOILER}"]`, original_stanza).pop(),
|
|
delay = sizzle(`delay[xmlns="${Strophe.NS.DELAY}"]`, original_stanza).pop(),
|
|
delay = sizzle(`delay[xmlns="${Strophe.NS.DELAY}"]`, original_stanza).pop(),
|
|
- stanza_id = sizzle(`stanza-id[xmlns="${Strophe.NS.SID}"]`, stanza).pop(),
|
|
|
|
chat_state = stanza.getElementsByTagName(_converse.COMPOSING).length && _converse.COMPOSING || stanza.getElementsByTagName(_converse.PAUSED).length && _converse.PAUSED || stanza.getElementsByTagName(_converse.INACTIVE).length && _converse.INACTIVE || stanza.getElementsByTagName(_converse.ACTIVE).length && _converse.ACTIVE || stanza.getElementsByTagName(_converse.GONE).length && _converse.GONE;
|
|
chat_state = stanza.getElementsByTagName(_converse.COMPOSING).length && _converse.COMPOSING || stanza.getElementsByTagName(_converse.PAUSED).length && _converse.PAUSED || stanza.getElementsByTagName(_converse.INACTIVE).length && _converse.INACTIVE || stanza.getElementsByTagName(_converse.ACTIVE).length && _converse.ACTIVE || stanza.getElementsByTagName(_converse.GONE).length && _converse.GONE;
|
|
|
|
|
|
const attrs = {
|
|
const attrs = {
|
|
@@ -61993,13 +61992,13 @@ _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-cha
|
|
'message': _converse.chatboxes.getMessageBody(stanza) || undefined,
|
|
'message': _converse.chatboxes.getMessageBody(stanza) || undefined,
|
|
'msgid': stanza.getAttribute('id'),
|
|
'msgid': stanza.getAttribute('id'),
|
|
'references': this.getReferencesFromStanza(stanza),
|
|
'references': this.getReferencesFromStanza(stanza),
|
|
- 'stanza_id': stanza_id ? stanza_id.getAttribute('id') : undefined,
|
|
|
|
- 'stanza_id_by_jid': stanza_id ? stanza_id.getAttribute('by') : undefined,
|
|
|
|
'subject': _.propertyOf(stanza.querySelector('subject'))('textContent'),
|
|
'subject': _.propertyOf(stanza.querySelector('subject'))('textContent'),
|
|
'thread': _.propertyOf(stanza.querySelector('thread'))('textContent'),
|
|
'thread': _.propertyOf(stanza.querySelector('thread'))('textContent'),
|
|
'time': delay ? delay.getAttribute('stamp') : moment().format(),
|
|
'time': delay ? delay.getAttribute('stamp') : moment().format(),
|
|
'type': stanza.getAttribute('type')
|
|
'type': stanza.getAttribute('type')
|
|
};
|
|
};
|
|
|
|
+ const stanza_ids = sizzle(`stanza-id[xmlns="${Strophe.NS.SID}"]`, stanza);
|
|
|
|
+ stanza_ids.forEach(s => attrs[`stanza_id ${s.getAttribute('by')}`] = s.getAttribute('id'));
|
|
|
|
|
|
if (attrs.type === 'groupchat') {
|
|
if (attrs.type === 'groupchat') {
|
|
attrs.from = stanza.getAttribute('from');
|
|
attrs.from = stanza.getAttribute('from');
|
|
@@ -66952,10 +66951,9 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- const msg = this.messages.findWhere({
|
|
|
|
- 'stanza_id': stanza_id.getAttribute('id'),
|
|
|
|
- 'stanza_id_by_jid': by_jid
|
|
|
|
- });
|
|
|
|
|
|
+ const query = {};
|
|
|
|
+ query[`stanza_id ${by_jid}`] = stanza_id.getAttribute('id');
|
|
|
|
+ const msg = this.messages.findWhere(query);
|
|
return !_.isNil(msg);
|
|
return !_.isNil(msg);
|
|
},
|
|
},
|
|
|
|
|
|
@@ -67004,11 +67002,14 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc
|
|
});
|
|
});
|
|
|
|
|
|
if (msg) {
|
|
if (msg) {
|
|
|
|
+ const attrs = {};
|
|
const stanza_id = sizzle(`stanza-id[xmlns="${Strophe.NS.SID}"]`, stanza).pop();
|
|
const stanza_id = sizzle(`stanza-id[xmlns="${Strophe.NS.SID}"]`, stanza).pop();
|
|
- const attrs = {
|
|
|
|
- 'stanza_id': stanza_id ? stanza_id.getAttribute('id') : undefined,
|
|
|
|
- 'stanza_id_by_jid': stanza_id ? stanza_id.getAttribute('by') : undefined
|
|
|
|
- };
|
|
|
|
|
|
+ const by_jid = stanza_id ? stanza_id.getAttribute('by') : undefined;
|
|
|
|
+
|
|
|
|
+ if (by_jid) {
|
|
|
|
+ const key = `stanza_id ${by_jid}`;
|
|
|
|
+ attrs[key] = stanza_id.getAttribute('id');
|
|
|
|
+ }
|
|
|
|
|
|
if (!msg.get('received')) {
|
|
if (!msg.get('received')) {
|
|
attrs.received = moment().format();
|
|
attrs.received = moment().format();
|