diff --git a/source/org/jivesoftware/smackx/packet/MUCOwner.java b/source/org/jivesoftware/smackx/packet/MUCOwner.java index 213f7cbd8..626746884 100644 --- a/source/org/jivesoftware/smackx/packet/MUCOwner.java +++ b/source/org/jivesoftware/smackx/packet/MUCOwner.java @@ -111,7 +111,8 @@ public class MUCOwner extends IQ { private String affiliation; private String jid; private String nick; - + private String role; + /** * Creates a new item child. * @@ -172,6 +173,18 @@ public class MUCOwner extends IQ { return nick; } + /** + * Returns the temporary position or privilege level of an occupant within a room. The + * possible roles are "moderator", "participant", and "visitor" (it is also possible to + * have no defined role). A role lasts only for the duration of an occupant's visit to + * a room. + * + * @return the privilege level of an occupant within a room. + */ + public String getRole() { + return role; + } + /** * Sets the actor (JID of an occupant in the room) that was kicked or banned. * @@ -211,6 +224,18 @@ public class MUCOwner extends IQ { this.nick = nick; } + /** + * Sets the temporary position or privilege level of an occupant within a room. The + * possible roles are "moderator", "participant", and "visitor" (it is also possible to + * have no defined role). A role lasts only for the duration of an occupant's visit to + * a room. + * + * @param role the new privilege level of an occupant within a room. + */ + public void setRole(String role) { + this.role = role; + } + public String toXML() { StringBuffer buf = new StringBuffer(); buf.append(""); } diff --git a/source/org/jivesoftware/smackx/provider/MUCOwnerProvider.java b/source/org/jivesoftware/smackx/provider/MUCOwnerProvider.java index 95d4d748e..aaa6afa88 100644 --- a/source/org/jivesoftware/smackx/provider/MUCOwnerProvider.java +++ b/source/org/jivesoftware/smackx/provider/MUCOwnerProvider.java @@ -36,7 +36,6 @@ public class MUCOwnerProvider implements IQProvider { public IQ parseIQ(XmlPullParser parser) throws Exception { MUCOwner mucOwner = new MUCOwner(); boolean done = false; - MUCOwner.Item item = null; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { @@ -66,6 +65,7 @@ public class MUCOwnerProvider implements IQProvider { boolean done = false; MUCOwner.Item item = new MUCOwner.Item(parser.getAttributeValue("", "affiliation")); item.setNick(parser.getAttributeValue("", "nick")); + item.setRole(parser.getAttributeValue("", "role")); item.setJid(parser.getAttributeValue("", "jid")); while (!done) { int eventType = parser.next();