Commit fc04a98c authored by dwd's avatar dwd

Merge pull request #42 from sco0ter/of178

Remove dispensable logic in the IQOwnerHandler, which deals with MUC aff...
parents 4a39f113 36d45788
...@@ -107,7 +107,7 @@ public class MonitorProvider implements WorkgroupProvider { ...@@ -107,7 +107,7 @@ public class MonitorProvider implements WorkgroupProvider {
iqPacket.setTo(roomName); iqPacket.setTo(roomName);
iqPacket.setFrom(workgroup.getFullJID()); iqPacket.setFrom(workgroup.getFullJID());
Element query = iqPacket.setChildElement("query", "http://jabber.org/protocol/muc#owner"); Element query = iqPacket.setChildElement("query", "http://jabber.org/protocol/muc#admin");
Element item = query.addElement("item"); Element item = query.addElement("item");
item.addAttribute("affiliation", "owner"); item.addAttribute("affiliation", "owner");
item.addAttribute("jid", packet.getFrom().toBareJID()); item.addAttribute("jid", packet.getFrom().toBareJID());
......
...@@ -82,22 +82,14 @@ ...@@ -82,22 +82,14 @@
userJID = username + rest.trim(); userJID = username + rest.trim();
} }
IQ iq = new IQ(IQ.Type.set); IQ iq = new IQ(IQ.Type.set);
if ("owner".equals(affiliation) || "admin".equals(affiliation)) {
Element frag = iq.setChildElement("query", "http://jabber.org/protocol/muc#owner"); Element frag = iq.setChildElement("query", "http://jabber.org/protocol/muc#admin");
Element item = frag.addElement("item"); Element item = frag.addElement("item");
item.addAttribute("affiliation", affiliation); item.addAttribute("affiliation", affiliation);
item.addAttribute("jid", userJID); item.addAttribute("jid", userJID);
// Send the IQ packet that will modify the room's configuration // Send the IQ packet that will modify the room's configuration
room.getIQOwnerHandler().handleIQ(iq, room.getRole()); room.getIQAdminHandler().handleIQ(iq, room.getRole());
}
else if ("member".equals(affiliation) || "outcast".equals(affiliation)) {
Element frag = iq.setChildElement("query", "http://jabber.org/protocol/muc#admin");
Element item = frag.addElement("item");
item.addAttribute("affiliation", affiliation);
item.addAttribute("jid", userJID);
// Send the IQ packet that will modify the room's configuration
room.getIQAdminHandler().handleIQ(iq, room.getRole());
}
// Log the event // Log the event
webManager.logEvent("set MUC affilation to "+affiliation+" for "+userJID+" in "+roomName, null); webManager.logEvent("set MUC affilation to "+affiliation+" for "+userJID+" in "+roomName, null);
// done, return // done, return
......
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