Commit 49f24a80 authored by Tom Evans's avatar Tom Evans

OF-544: Fix handling for MUC affiliation update

Handle each affiliation change item in the IQ stanza
parent bb8c973f
...@@ -249,8 +249,7 @@ public class IQAdminHandler { ...@@ -249,8 +249,7 @@ public class IQAdminHandler {
// The client is modifying the list of moderators/members/participants/outcasts // The client is modifying the list of moderators/members/participants/outcasts
String nick; String nick;
String target; String target;
boolean hasAffiliation = itemsList.get(0).attributeValue("affiliation") != boolean hasAffiliation;
null;
// Keep a registry of the updated presences // Keep a registry of the updated presences
List<Presence> presences = new ArrayList<Presence>(itemsList.size()); List<Presence> presences = new ArrayList<Presence>(itemsList.size());
...@@ -259,8 +258,9 @@ public class IQAdminHandler { ...@@ -259,8 +258,9 @@ public class IQAdminHandler {
for (Object anItem : itemsList) { for (Object anItem : itemsList) {
try { try {
item = (Element) anItem; item = (Element) anItem;
target = (hasAffiliation ? item.attributeValue("affiliation") : item affiliation = item.attributeValue("affiliation");
.attributeValue("role")); hasAffiliation = affiliation != null;
target = (hasAffiliation ? affiliation : item.attributeValue("role"));
List<JID> jids = new ArrayList<JID>(); List<JID> jids = new ArrayList<JID>();
// jid could be of the form "full JID" or "bare JID" depending if we are // jid could be of the form "full JID" or "bare JID" depending if we are
// going to change a role or an affiliation // going to change a role or an affiliation
......
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