Skip to content

Commit

Permalink
Fix for SMACK-371:
Browse files Browse the repository at this point in the history
- http://issues.igniterealtime.org/browse/SMACK-371
-  http://community.igniterealtime.org/thread/47534?tstart=0
Credits and thanks go to Colby White for reporting this.

Newer versions for XEP-0045 (MUC) use muc#admin for all onwer related operations.
  • Loading branch information
Flowdalic committed Mar 31, 2012
1 parent 8fbe7cd commit 147a4b0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions source/org/jivesoftware/smackx/muc/MultiUserChat.java
Expand Up @@ -1276,7 +1276,7 @@ public void revokeModerator(String nickname) throws XMPPException {
* @throws XMPPException if an error occurs granting ownership privileges to a user.
*/
public void grantOwnership(Collection<String> jids) throws XMPPException {
changeAffiliationByOwner(jids, "owner");
changeAffiliationByAdmin(jids, "owner");
}

/**
Expand All @@ -1289,7 +1289,7 @@ public void grantOwnership(Collection<String> jids) throws XMPPException {
* @throws XMPPException if an error occurs granting ownership privileges to a user.
*/
public void grantOwnership(String jid) throws XMPPException {
changeAffiliationByOwner(jid, "owner");
changeAffiliationByAdmin(jid, "owner", null);
}

/**
Expand All @@ -1301,7 +1301,7 @@ public void grantOwnership(String jid) throws XMPPException {
* @throws XMPPException if an error occurs revoking ownership privileges from a user.
*/
public void revokeOwnership(Collection<String> jids) throws XMPPException {
changeAffiliationByOwner(jids, "admin");
changeAffiliationByAdmin(jids, "admin");
}

/**
Expand All @@ -1313,7 +1313,7 @@ public void revokeOwnership(Collection<String> jids) throws XMPPException {
* @throws XMPPException if an error occurs revoking ownership privileges from a user.
*/
public void revokeOwnership(String jid) throws XMPPException {
changeAffiliationByOwner(jid, "admin");
changeAffiliationByAdmin(jid, "admin", null);
}

/**
Expand Down Expand Up @@ -1431,7 +1431,8 @@ private void changeAffiliationByAdmin(String jid, String affiliation, String rea
// Set the new affiliation.
MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null);
item.setJid(jid);
item.setReason(reason);
if(reason != null)
item.setReason(reason);
iq.addItem(item);

// Wait for a response packet back from the server.
Expand Down Expand Up @@ -1632,7 +1633,7 @@ public void removeParticipantListener(PacketListener listener) {
* don't have enough privileges to get this information.
*/
public Collection<Affiliate> getOwners() throws XMPPException {
return getAffiliatesByOwner("owner");
return getAffiliatesByAdmin("owner");
}

/**
Expand Down

0 comments on commit 147a4b0

Please sign in to comment.