Skip to content
Snippets Groups Projects
Commit 179f7ef7 authored by Dele Olajide's avatar Dele Olajide
Browse files

Send marker when subject and empty body received

parent cd80d5f2
No related branches found
No related tags found
1 merge request!24Send marker when subject and empty body received
......@@ -50,7 +50,7 @@
_converse.connection.addHandler(function (message) {
message.querySelectorAll('activity').forEach(function (activity) {
if (activity) {
if (activity && activity.getAttribute("xmlns") == "xmpp:prosody.im/protocol/rai") {
const jid = activity.innerHTML;
_converse.api.trigger('chatRoomActivityIndicators', jid);
......@@ -62,9 +62,30 @@
}
});
const subject = message.querySelector('subject');
const body = message.querySelector('body');
if (subject && !body) sendMarker(message.getAttribute('from'), message.getAttribute('id'), 'received');
return true;
}, "xmpp:prosody.im/protocol/rai", 'message');
}, null, 'message', 'groupchat');
}
function sendMarker(to_jid, id, type)
{
console.debug("sendMarker", to_jid, id, type);
const stanza = $msg({
'from': _converse.connection.jid,
'id': Math.random().toString(36).substr(2,9),
'to': to_jid,
'type': 'chat'
}).c(type, {
'xmlns': Strophe.NS.MARKERS,
'id': id
});
_converse.api.send(stanza);
}
function notifyText(message, title, notifyId, callback) {
......
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