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

bugfix: send the last message marker

parent afbaae04
No related branches found
No related tags found
2 merge requests!128Send the last message marker,!127Force the last message marker
......@@ -87,6 +87,21 @@ converse.plugins.add('converse-rai', {
const msg = msgs.find(m => m.get('sender') === 'them' && (force || m.get('is_markable')));
msg && this.sendMarkerForMessage(msg, type, force);
},
/**
* Given the passed in message object, send a XEP-0333 chat marker.
* @param { _converse.Message } msg
* @param { ('received'|'displayed'|'acknowledged') } [type='displayed']
* @param { Boolean } force - Whether a marker should be sent for the
* message, even if it didn't include a `markable` element.
*/
sendMarkerForMessage(msg, type = 'displayed', force = false) {
const { Strophe } = converse.env;
if (msg && (msg?.get('is_markable') || force)) {
const from_jid = Strophe.getBareJidFromJid(msg.get('from'));
this.sendMarker(from_jid, msg.get('msgid'), type, msg.get('type'));
}
},
},
},
initialize() {
......
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