We need to send out a separate IQ stanza for each affiliation
At least for Prosody.
This commit is contained in:
parent
54371f0e7d
commit
993c8f1695
@ -605,19 +605,26 @@
|
|||||||
onSuccess(null);
|
onSuccess(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var iq = $iq({to: this.model.get('jid'), type: "set"})
|
var room_jid = this.model.get('jid');
|
||||||
.c("query", {xmlns: Strophe.NS.MUC_ADMIN});
|
var affiliations = _.uniq(_.pluck(members, 'affiliation'));
|
||||||
_.each(members, function (member) {
|
_.each(affiliations, function (affiliation) {
|
||||||
iq.c("item", {
|
var iq = $iq({to: room_jid, type: "set"})
|
||||||
'affiliation': member.affiliation,
|
.c("query", {xmlns: Strophe.NS.MUC_ADMIN});
|
||||||
'jid': member.jid
|
_.each(members, function (member) {
|
||||||
|
if (member.affiliation !== affiliation) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
iq.c("item", {
|
||||||
|
'affiliation': member.affiliation,
|
||||||
|
'jid': member.jid
|
||||||
|
});
|
||||||
|
if (!_.isUndefined(member.reason)) {
|
||||||
|
iq.c("reason", member.reason).up();
|
||||||
|
}
|
||||||
|
iq.up();
|
||||||
});
|
});
|
||||||
if (!_.isUndefined(member.reason)) {
|
converse.connection.sendIQ(iq, onSuccess, onError);
|
||||||
iq.c("reason", member.reason).up();
|
|
||||||
}
|
|
||||||
iq.up();
|
|
||||||
});
|
});
|
||||||
return converse.connection.sendIQ(iq, onSuccess, onError);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
marshallAffiliationIQs: function () {
|
marshallAffiliationIQs: function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user