Commit e5188d8b authored by JC Brand's avatar JC Brand

Bugfix. Remove affiliation based on updated members lists

parent 1a3526f5
This diff is collapsed.
......@@ -1874,6 +1874,8 @@ converse.plugins.add('converse-muc', {
if (occupant.get('jid') === _converse.bare_jid) { return; }
if (occupant.get('show') === 'offline') {
occupant.destroy();
} else {
occupant.save('affiliation', null);
}
});
new_members.forEach(attrs => {
......
......@@ -92,7 +92,12 @@
};
mock.chatroom_names = [
'Dyon van de Wege', 'Thomas Kalb', 'Dirk Theissen', 'Felix Hofmann', 'Ka Lek', 'Anne Ebersbacher'
'Dyon van de Wege',
'Thomas Kalb',
'Dirk Theissen',
'Felix Hofmann',
'Ka Lek',
'Anne Ebersbacher'
];
// TODO: need to also test other roles and affiliations
mock.chatroom_roles = {
......
......@@ -164,7 +164,7 @@
_converse.connection._dataRecv(utils.createRequest(features_stanza));
};
utils.openAndEnterChatRoom = async function (_converse, muc_jid, nick, features=[]) {
utils.openAndEnterChatRoom = async function (_converse, muc_jid, nick, features=[], members=[]) {
const room = Strophe.getNodeFromJid(muc_jid);
const server = Strophe.getDomainFromJid(muc_jid);
const room_jid = `${room}@${server}`.toLowerCase();
......@@ -221,6 +221,14 @@
'to': 'romeo@montague.lit/orchard',
'type': 'result'
}).c('query', {'xmlns': Strophe.NS.MUC_ADMIN});
members.forEach(member => {
member_list_stanza.c('item', {
'affiliation': 'member',
'jid': 'hag66@shakespeare.lit',
'nick': member,
'role': 'participant'
});
});
_converse.connection._dataRecv(utils.createRequest(member_list_stanza));
const admin_IQ = await utils.waitUntil(() => _.filter(
......
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