Skip to content
Snippets Groups Projects
Commit 2866ac6f authored by ubermanu's avatar ubermanu
Browse files

bugfix: the markers should contain the stanza_id of the msg

parent e8b6d03f
No related branches found
No related tags found
2 merge requests!131Fix markers,!130Fix markers
......@@ -96,10 +96,17 @@ converse.plugins.add('converse-rai', {
* message, even if it didn't include a `markable` element.
*/
sendMarkerForMessage(msg, type = 'displayed', force = false) {
const _converse = this.__super__._converse;
const { Strophe } = converse.env;
if (msg && (msg?.get('is_markable') || force)) {
// Markers should be sent for message with a stanza_id
const is_groupchat = this.get('type') === _converse.CHATROOMS_TYPE;
const by_jid = is_groupchat ? this.get('jid') : _converse.bare_jid;
const stanza_id = msg.get('stanza_id '.concat(by_jid));
if (msg && (msg?.get('is_markable') || force) && stanza_id) {
const from_jid = Strophe.getBareJidFromJid(msg.get('from'));
this.sendMarker(from_jid, msg.get('msgid'), type, msg.get('type'));
this.sendMarker(from_jid, stanza_id, type, msg.get('type'));
}
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment