From 8b03003fd7a66de5862142903784ca02d08fbd25 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Wed, 15 Dec 2004 18:04:13 +0000 Subject: [PATCH] Added "role" attribute to MUCOwner.Item. SMACK-33 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2428 b35dd754-fafc-0310-a699-88a17e54d16e --- .../jivesoftware/smackx/packet/MUCOwner.java | 30 ++++++++++++++++++- .../smackx/provider/MUCOwnerProvider.java | 2 +- 2 files changed, 30 insertions(+), 2 deletions(-) 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();