Commit dbccdb1e authored by Tom Evans's avatar Tom Evans

OF-179: Publish presence updates for group changes

Distribute updated presence packets after changing MUC room affiliations
due to group membership changes
parent 822abb01
......@@ -2706,22 +2706,29 @@ public class LocalMUCRoom implements MUCRoom, GroupEventListener {
@Override
public void memberAdded(Group group, Map params) {
applyAffiliationChange(getRole(), new JID((String)params.get("member")), null);
applyAffiliationChangeAndSendPresence(new JID((String)params.get("member")));
}
@Override
public void memberRemoved(Group group, Map params) {
applyAffiliationChange(getRole(), new JID((String)params.get("member")), null);
applyAffiliationChangeAndSendPresence(new JID((String)params.get("member")));
}
@Override
public void adminAdded(Group group, Map params) {
applyAffiliationChange(getRole(), new JID((String)params.get("admin")), null);
applyAffiliationChangeAndSendPresence(new JID((String)params.get("admin")));
}
@Override
public void adminRemoved(Group group, Map params) {
applyAffiliationChange(getRole(), new JID((String)params.get("admin")), null);
applyAffiliationChangeAndSendPresence(new JID((String)params.get("admin")));
}
private void applyAffiliationChangeAndSendPresence(JID groupMember) {
List<Presence> presences = applyAffiliationChange(getRole(), groupMember, null);
for (Presence presence : presences) {
send(presence);
}
}
@Override
......
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