Skip to content
Snippets Groups Projects

Custom Emoji Drawer & Inline Message Actions

Merged Emmanuel Vodor requested to merge beta into master
Files
2
@@ -108,7 +108,7 @@ converse.plugins.add('converse-rai', {
@@ -108,7 +108,7 @@ converse.plugins.add('converse-rai', {
* @param {string|Array} jids
* @param {string|Array} jids
* @returns {void}
* @returns {void}
*/
*/
subscribe(jids) {
async subscribe(jids) {
if (!api.settings.get('muc_subscribe_to_rai')) {
if (!api.settings.get('muc_subscribe_to_rai')) {
log.error(`You must enable the 'muc_subscribe_to_rai' option before subscribing to a MUC.`);
log.error(`You must enable the 'muc_subscribe_to_rai' option before subscribing to a MUC.`);
return;
return;
@@ -118,15 +118,16 @@ converse.plugins.add('converse-rai', {
@@ -118,15 +118,16 @@ converse.plugins.add('converse-rai', {
jids = [jids];
jids = [jids];
}
}
const muc_domains = jids.map(jid => Strophe.getDomainFromJid(jid));
const muc_domains = _.uniq(jids.map(jid => Strophe.getDomainFromJid(jid)));
_.uniq(muc_domains).forEach(muc_domain => {
for (let domain of muc_domains) {
const rai = $pres({ to: muc_domain, id: u.getUniqueId() }).c('rai', {
const rai = $pres({ to: domain, id: u.getUniqueId() }).c('rai', {
'xmlns': Strophe.NS.RAI,
'xmlns': Strophe.NS.RAI,
});
});
api.send(rai);
log.debug(`Sent RAI stanza for domain "${muc_domain}"`);
await _converse.connection.send(rai);
});
log.debug(`Sent RAI stanza for domain "${domain}"`);
 
}
},
},
});
});
Loading