Deleting chat rooms

After quite a bit of searching both here and the net generally, I'm at a loss as to how I delete an existing chat room.

It doesn't seem that I can do this with mod_muc, and I've looked at the contributions that are available and cannot find anything that seems to achieve what I assume is a pretty common task. The only solutions I've come up with so far is to manipulate the database directly, or to dump the data to a flat file using ejabberdctl (I have also tried the mod_ctrlextra extension), deleting the room and restoring from the flat file. Neither seems particularly elegant.

The issue comes about because I set up an ejabberd server, and of course managed to create a few persistent rooms that are still hanging around, and I'm like to clean them up, and know how to do it in the future.

Version is 2.0.3 on CentOS 5.3

Use a MUC-capable client

billymayday wrote:

managed to create a few persistent rooms that are still hanging around, and I'm like to clean them up

There are at least two ways to destroy a persistent room. You need to use a MUC-capable Jabber client (Psi, Gajim, Tkabber, ...):

  • Configure again the room and set it to not-persistent. When all the participants leave, the room is self-destroyed.
  • Or you can explicitly destroy the room. If your client doesn't support this, you can send the XMPP stanzas yourself, if the client provides an 'XML Raw Console'. See: XEP-0045 - Destroying a Room.

Thanks for that

Thanks badlop, I had tried with pidgin and exodus, and it seems that although both have the ability to create rooms, neither seems to have an option to delete them.

I installed psi (thanks for the suggestion), and that has a delete option, so I guess those other clients are only half MUC-capable, or I simply couldn't find the relevant option.

A question for you though.

I managed to find a copy of mod_muc_admin, which I gather you wrote (from the README.txt). Although it was a little hard to find, since it's not listed under contributions, and I had installation issues (I was installing the version under the ejabberd-modules svn trunk until I found the 2.0.x version under branches), and it doesn't work quite correctly (listing rooms in the web admin package gives a "not found" error, but the command line additions to ejabberdctl work fine), I was interested to know why you didn't recommend mod_muc_admin?

Rgds and thanks again.

Fixed now in SVN

billymayday wrote:

it doesn't work quite correctly (listing rooms in the web admin package gives a "not found" error, but the command line additions to ejabberdctl work fine)

Ah, right. mod_muc_admin 2.0.x branch was only compatible with the old ejabberd 2.0.0 and 2.0.1. I've fixed it, now it requires ejabberd 2.0.2 or higher. Update mod_muc_admin SVN, now the WebAdmin page should work correctly.

billymayday wrote:

why you didn't recommend mod_muc_admin?

Because you were not ready for that answer.

You asked:

billymayday wrote:

how I delete an existing chat room.

This revealed that you were not knowledge or experienced enough in MUC (XEP-0045). So the answer necessarily had to mention how to destroy a room using XEP-0045, either by means of a Jabber client or by sending the raw XML.

After you learn to destroy a room in the standard-user way, you probably ask "how to destroy rooms programatically?". Enter mod_muc_admin.

Thanks again

That worked a treat thanks.

A quick follow-up question for you.

Although I followed the link you gave for XEP-0045, I have no idea how to pass raw xml to the server (I'm an ex C programmer and know nothing much about erlang). How would one do it?

Client feature: XML Console, Raw XML...

billymayday wrote:

I have no idea how to pass raw xml to the server

It is a client feature. In Psi 0.12.1, open the context menu of your account in the roster, then click "Console XML" or similar. It can display the XML traffic between client and server, and allows the user to send any arbitrary XMPP stanza to the server.

Syndicate content