diff --git a/extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java index c41b31637..5ca3a21de 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -1473,7 +1473,7 @@ public class MultiUserChat { * don't have enough privileges to get this information. */ public Collection getAdmins() throws XMPPException { - return getAffiliatesByOwner("admin"); + return getAffiliatesByAdmin("admin"); } /** @@ -1498,33 +1498,6 @@ public class MultiUserChat { return getAffiliatesByAdmin("outcast"); } - /** - * Returns a collection of Affiliate that have the specified room affiliation - * sending a request in the owner namespace. - * - * @param affiliation the affiliation of the users in the room. - * @return a collection of Affiliate that have the specified room affiliation. - * @throws XMPPException if an error occured while performing the request to the server or you - * don't have enough privileges to get this information. - */ - private Collection getAffiliatesByOwner(String affiliation) throws XMPPException { - MUCOwner iq = new MUCOwner(); - iq.setTo(room); - iq.setType(IQ.Type.GET); - // Set the specified affiliation. This may request the list of owners/admins/members/outcasts. - MUCOwner.Item item = new MUCOwner.Item(affiliation); - iq.addItem(item); - - MUCOwner answer = (MUCOwner) connection.createPacketCollectorAndSend(iq).nextResultOrThrow(); - - // Get the list of affiliates from the server's answer - List affiliates = new ArrayList(); - for (Iterator it = answer.getItems(); it.hasNext();) { - affiliates.add(new Affiliate(it.next())); - } - return affiliates; - } - /** * Returns a collection of Affiliate that have the specified room affiliation * sending a request in the admin namespace.