Commit 92200667 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Added support to get roles for a given session. JM-1181

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9451 b35dd754-fafc-0310-a699-88a17e54d16e
parent ccb93d32
...@@ -234,6 +234,17 @@ public interface MultiUserChatServer extends Component { ...@@ -234,6 +234,17 @@ public interface MultiUserChatServer extends Component {
*/ */
void removeChatRoom(String roomName); void removeChatRoom(String roomName);
/**
* Returns the list of {@link org.jivesoftware.openfire.muc.MUCRole} in all rooms for the specified
* user's session. When running in a cluster the list will include
* {@link org.jivesoftware.openfire.muc.spi.LocalMUCRole} and {@link org.jivesoftware.openfire.muc.spi.RemoteMUCRole}.
*
*
* @param user the full JID that identifies the session of the user.
* @return the list of MUCRoles in all rooms for the specified user's session.
*/
Collection<MUCRole> getMUCRoles(JID user);
/** /**
* Returns the total chat time of all rooms combined. * Returns the total chat time of all rooms combined.
* *
......
...@@ -619,6 +619,17 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha ...@@ -619,6 +619,17 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
return user; return user;
} }
public Collection<MUCRole> getMUCRoles(JID user) {
List<MUCRole> userRoles = new ArrayList<MUCRole>();
for (LocalMUCRoom room : rooms.values()) {
MUCRole role = room.getOccupantByFullJID(user);
if (role != null) {
userRoles.add(role);
}
}
return userRoles;
}
public void setServiceName(String name) { public void setServiceName(String name) {
JiveGlobals.setProperty("xmpp.muc.service", name); JiveGlobals.setProperty("xmpp.muc.service", name);
} }
......
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