Commit bb8c7423 authored by JC Brand's avatar JC Brand

Ignore XEP-0437 indicators and forwarded mentions in a joined MUC

Otherwise the mentions will be counted twice.
parent 2f5cc3b2
...@@ -438,6 +438,14 @@ const ChatRoomMixin = { ...@@ -438,6 +438,14 @@ const ChatRoomMixin = {
* @param { XMLElement } stanza * @param { XMLElement } stanza
*/ */
handleMessageFromMUCHost (stanza) { handleMessageFromMUCHost (stanza) {
const conn_status = this.session.get('connection_status');
if (conn_status === converse.ROOMSTATUS.ENTERED) {
// We're not interested in activity indicators or forwarded
// mentions when already joined to the room.
// Also prevents forwarded mentions from being counted twice.
return;
}
const rai = sizzle(`rai[xmlns="${Strophe.NS.RAI}"]`, stanza).pop(); const rai = sizzle(`rai[xmlns="${Strophe.NS.RAI}"]`, stanza).pop();
const active_mucs = Array.from(rai?.querySelectorAll('activity') || []).map(m => m.textContent); const active_mucs = Array.from(rai?.querySelectorAll('activity') || []).map(m => m.textContent);
if (active_mucs.includes(this.get('jid'))) { if (active_mucs.includes(this.get('jid'))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment