From f573c69d088394dcef97d03d8ea265231c18d4d6 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 10 May 2018 23:48:09 +0200 Subject: [PATCH] updates #1094 Refetch the members lists when adding a new member via invite --- src/converse-muc.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/converse-muc.js b/src/converse-muc.js index 6c808df89..4e9305f59 100644 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -661,7 +661,7 @@ * (Function) onError: callback for an error response */ const affiliations = _.uniq(_.map(members, 'affiliation')); - _.each(affiliations, _.partial(this.setAffiliation.bind(this), _, members)); + return Promise.all(_.map(affiliations, _.partial(this.setAffiliation.bind(this), _, members))); }, getJidsWithAffiliations (affiliations) { @@ -701,9 +701,10 @@ * updated or once it's been established there's no need * to update the list. */ - this.getJidsWithAffiliations(affiliations).then((old_members) => { - this.setAffiliations(deltaFunc(members, old_members)); - }); + this.getJidsWithAffiliations(affiliations) + .then((old_members) => this.setAffiliations(deltaFunc(members, old_members))) + .then(() => this.occupants.fetchMembers()) + .catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR)); }, checkForReservedNick (callback, errback) {