[ejabberd] delete messages from room history

Badlop badlop at gmail.com
Thu Apr 29 22:04:14 MSD 2010

2010/4/26 sofia cardita <sofiacardita at gmail.com>:
> Is there anyway to delete the last n messages from a room or to delete that
> day's messages from a room?
> This would be nice in case there were any messages with inappropriate
> content. How do you deal with those?

As you noticed, ejabberd's MUC service keeps in memory a queue of the last
20 messages published in a room, and sends them to a new occupant that
joins the room.

The oldest message is deleted when a new message is sent to the room.

If you don't like that feature, set {history_size, 0}
Alternatively, the clients can specify how many historical messages
they want to receive
when they join a room:

Now let's answer your question:
ejabberd doesn't provide any method for the room admins to clean the
message queue.

But there's a low-technology solution for your problem:
send 20 useless messages to the room, like:

And new occupants will receive that instead of the older messages.


More information about the ejabberd mailing list