Commit 993c8f16 authored by JC Brand's avatar JC Brand

We need to send out a separate IQ stanza for each affiliation

At least for Prosody.
parent 54371f0e
...@@ -605,9 +605,15 @@ ...@@ -605,9 +605,15 @@
onSuccess(null); onSuccess(null);
return; return;
} }
var iq = $iq({to: this.model.get('jid'), type: "set"}) var room_jid = this.model.get('jid');
var affiliations = _.uniq(_.pluck(members, 'affiliation'));
_.each(affiliations, function (affiliation) {
var iq = $iq({to: room_jid, type: "set"})
.c("query", {xmlns: Strophe.NS.MUC_ADMIN}); .c("query", {xmlns: Strophe.NS.MUC_ADMIN});
_.each(members, function (member) { _.each(members, function (member) {
if (member.affiliation !== affiliation) {
return;
}
iq.c("item", { iq.c("item", {
'affiliation': member.affiliation, 'affiliation': member.affiliation,
'jid': member.jid 'jid': member.jid
...@@ -617,7 +623,8 @@ ...@@ -617,7 +623,8 @@
} }
iq.up(); iq.up();
}); });
return converse.connection.sendIQ(iq, onSuccess, onError); converse.connection.sendIQ(iq, onSuccess, onError);
});
}, },
marshallAffiliationIQs: function () { marshallAffiliationIQs: function () {
......
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