From c5700d225787cb40e71cd05bd74097463966b523 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Wed, 15 Dec 2004 01:40:01 +0000 Subject: [PATCH] Added support for discovering room information. SMACK-11 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2424 b35dd754-fafc-0310-a699-88a17e54d16e --- .../jivesoftware/smackx/muc/MultiUserChat.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/org/jivesoftware/smackx/muc/MultiUserChat.java b/source/org/jivesoftware/smackx/muc/MultiUserChat.java index df39889be..164319628 100644 --- a/source/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/source/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -179,6 +179,22 @@ public class MultiUserChat { } } + /** + * Returns the discovered information of a given room whithout actually having to join the room. + * The server will provide information only for rooms that are public. + * + * @param connection the XMPP connection to use for discovering information about the room. + * @param room the name of the room in the form "roomName@service" of which we want to discover + * its information. + * @return the discovered information of a given room whithout actually having to join the room. + * @throws XMPPException if an error occured while trying to discover information of a room. + */ + public static RoomInfo getRoomInfo(XMPPConnection connection, String room) + throws XMPPException { + DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(room); + return new RoomInfo(info); + } + /** * Returns the name of the room this MultiUserChat object represents. * @@ -2119,7 +2135,7 @@ public class MultiUserChat { /** * Returns a new or existing InvitationsMonitor for a given connection. * - * @param connection the connection to monitor for room invitations. + * @param conn the connection to monitor for room invitations. * @return a new or existing InvitationsMonitor for a given connection. */ public static InvitationsMonitor getInvitationsMonitor(XMPPConnection conn) {