I have a smack related problem. I though it is possible to discover information about a public room without having to actually joining the room. However, I am getting a "remote-server-not-found(404)" error message. What could I be doing wrong.
Here is a code snippet on how I used the api...
...
try {
for (String service : MultiUserChat.getServiceNames(xConn)) {
// Service name is usually conference@server etc...
log.info("Service name: " + service);
// Get the list of rooms under this service
for (HostedRoom room : MultiUserChat.getHostedRooms(xConn,
service)) {
log.info("\tName: " + room.getName());
log.info("\tRoom JID: " + room.getJid());
// Get the detail information on the room
try {
RoomInfo info = MultiUserChat.getRoomInfo(xConn, room.getName()); //PROBLEM LINE
log.info("\tDescription: " + info.getDescription()
+ "\nOccupantCount: " + info.getOccupantsCount()
+ "\nisPasswordProtected(): " + info.isPasswordProtected());
} catch (XMPPException ex) {
//PROBLEM RESULTED HERE with "emote-server-not-found(404)"
log.severe(ex.getMessage());
}
}
}
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
If I could not get information such as how many occupants a room has and stuff like that, is there a way to join a room on "INVISIBLE" mode?
Thanks,
D
Example XMPP stanza
I though it is possible to discover information about a public room without having to actually joining the room.
Yes, it is possible:
<iq to='testroom@conference.localhost' type='get'>
<query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
<iq from='testroom@conference.localhost' type='result' to='badlop@localhost/Tka'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity name='My room name' type='text' category='conference'/>
<feature var='http://jabber.org/protocol/muc'/>
<feature var='muc_public'/>
<feature var='muc_persistent'/>
<feature var='muc_open'/>
<feature var='muc_semianonymous'/>
<feature var='muc_moderated'/>
<feature var='muc_unsecured'/>
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/muc#roominfo</value>
</field>
<field label='Room description' var='muc#roominfo_description'>
<value>My room description</value>
</field>
<field label='Number of occupants' var='muc#roominfo_occupants'>
<value>1</value>
</field>
</x>
</query>
</iq>
If I could not get information such as how many occupants a room has and stuff like that, is there a way to join a room on "INVISIBLE" mode?
No, that is not possible.