Skip to content
Snippets Groups Projects

Custom Emoji Drawer & Inline Message Actions

Merged Emmanuel Vodor requested to merge beta into master
@@ -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'));
}
},
},
@@ -146,6 +153,16 @@ converse.plugins.add('converse-rai', {
},
});
/**
* Send a displayed marker once the chatroom is scrolled down.
* FIXME: This is sending two requests (for the same message)
*/
api.listen.on('chatBoxScrolledDown', data => {
if (data.chatbox.get('type') === _converse.CHATROOMS_TYPE && api.settings.get('muc_subscribe_to_rai')) {
data.chatbox.sendMarkerForLastMessage('displayed', true);
}
});
/**
* Triggers an event if a jid has activity.
*
Loading