Commit 4632d3b3 authored by Guus der Kinderen's avatar Guus der Kinderen

Merge pull request #550 from sco0ter/muc321

Include correct affiliation and role after revoking MUC membership.
parents 1552aca1 f2386cce
......@@ -163,6 +163,12 @@ public class LocalMUCRole implements MUCRole {
this.presence = newPresence;
this.presence.setFrom(getRoleAddress());
if (extendedInformation != null) {
// Remove any previous extendedInformation, then re-add it.
Element mucUser = presence.getElement().element(QName.get("x", "http://jabber.org/protocol/muc#user"));
if (mucUser != null) {
// Remove any previous extendedInformation, then re-add it.
presence.getElement().remove(mucUser);
}
Element exi = extendedInformation.createCopy();
presence.getElement().add(exi);
}
......
......@@ -1377,6 +1377,8 @@ public class LocalMUCRoom implements MUCRoom, GroupEventListener {
if (role.isLocal()) {
role.setAffiliation(newAffiliation);
role.setRole(newRole);
// Set the new presence, so that the updated affiliation and role is reflected in the presence stanza.
role.setPresence(role.getPresence());
// Notify the other cluster nodes to update the occupant
CacheFactory.doClusterTask(new UpdateOccupant(this, role));
// Prepare a new presence to be sent to all the room occupants
......
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