Commit 0fd0019c authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Refactoring changes


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@616 b35dd754-fafc-0310-a699-88a17e54d16e
parent 7f7ac718
...@@ -11,16 +11,20 @@ ...@@ -11,16 +11,20 @@
package org.jivesoftware.messenger.muc.spi; package org.jivesoftware.messenger.muc.spi;
import org.jivesoftware.messenger.muc.*; import org.dom4j.Element;
import org.dom4j.DocumentHelper;
import org.jivesoftware.messenger.PacketRouter; import org.jivesoftware.messenger.PacketRouter;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.util.Log; import org.jivesoftware.messenger.muc.MUCRole;
import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.messenger.muc.MUCRoom;
import org.xmpp.packet.Presence; import org.jivesoftware.messenger.muc.MUCUser;
import org.jivesoftware.messenger.muc.MultiUserChatServer;
import org.jivesoftware.messenger.muc.NotAllowedException;
import org.jivesoftware.util.ElementUtil;
import org.xmpp.packet.IQ;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import org.xmpp.packet.Message; import org.xmpp.packet.Message;
import org.xmpp.packet.IQ; import org.xmpp.packet.Presence;
import org.dom4j.Element;
/** /**
* Simple in-memory implementation of a role in a chatroom * Simple in-memory implementation of a role in a chatroom
...@@ -104,7 +108,7 @@ public class MUCRoleImpl implements MUCRole { ...@@ -104,7 +108,7 @@ public class MUCRoleImpl implements MUCRole {
this.router = packetRouter; this.router = packetRouter;
this.role = role; this.role = role;
this.affiliation = affiliation; this.affiliation = affiliation;
extendedInformation = new MetaDataFragment("http://jabber.org/protocol/muc#user", "x"); extendedInformation = DocumentHelper.createElement("x").addNamespace("", "http://jabber.org/protocol/muc#user");
calculateExtendedInformation(); calculateExtendedInformation();
rJID = new JID(room.getName(), server.getServiceName(), nick); rJID = new JID(room.getName(), server.getServiceName(), nick);
setPresence(room.createPresence(null)); setPresence(room.createPresence(null));
...@@ -240,9 +244,8 @@ public class MUCRoleImpl implements MUCRole { ...@@ -240,9 +244,8 @@ public class MUCRoleImpl implements MUCRole {
* The information to add contains the user's jid, affiliation and role. * The information to add contains the user's jid, affiliation and role.
*/ */
private void calculateExtendedInformation() { private void calculateExtendedInformation() {
ElementUtil.setProperty(extendedInformation, "x.item:jid", user.getAddress().toString());
extendedInformation.setProperty("x.item:jid", user.getAddress().toString()); ElementUtil.setProperty(extendedInformation, "x.item:affiliation", getAffiliationAsString());
extendedInformation.setProperty("x.item:affiliation", getAffiliationAsString()); ElementUtil.setProperty(extendedInformation, "x.item:role", getRoleAsString());
extendedInformation.setProperty("x.item:role", getRoleAsString());
} }
} }
\ No newline at end of file
This diff is collapsed.
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