Categories
General

Smack API: Destorying persistent Multi-User Chat Rooms

Another one that is not documented.
Suppose you have a persistent Multi-User Chat Room (MUC) and room is empty. Apparently to destroy the room, the owner needs to join it, and then call the destroy() method on that room.
See, short and sweet.

Share
Categories
General

Smack API: No clean way to discover if a multi-user chat room exists

Here’s another one to follow the previous two posts about Smack API and Multi-User Chat issues.
Suppose you want to create a persistent room. Suppose you are not sure if that room already exists. In Smack, and I am not familiar of any other APIs, there is no non-exception-throwing way of doing this.

Fundamentally, a room already exists is the situation where a room is already set up on the server with the same name as the one you wish to create.

The MultiUserChat object has a static getRoomInfo() method which may have been the way to go. If the room does not exist, return null. Instead, if the room does not exist throws an XMPPException. Not sure what the error situation is here – I am just trying to find out if a room exists or not, but that causes an exception.

The flipside is on the creation end. If you try to create a room that already exists, an XMPPException will be thrown. This makes sense and is recoverable. Still, I am a fan of checking first instead of trying to do something only to encounter a bad situation. Not a biggie – just hope this spares someone the exploration and time. Not really documented, etc.

Share
Categories
General

Openfire/XMPP Multi-User Chat name is registered as all lower-case

Another observation regarding XMPP multi-user chat (aka chat-rooms) to follow on my previous entry. This one is also an odd one.
It appears that Openfire uses all-lowercase names for multi-user chat rooms. So if your room’s name is “myRoom”, it will be saved as “myroom”.

Could not find anything to require this in the XMPP specifications for multi-user chat.

Oddness.

UPDATE:
This is apparently the way it is supposed to be according to the XMPP protocol or as explained to me on the Openfire dev boards.

Share
Share