preventing muc-room-title mangling in ejabberd

ESL Developer Blog - - August 05, 2008

ejabberd seems to think it is a good idea to put the number of room-members into the title, this will result in something like this:

My funky chatroom (5711)


This is quite nasty when you try to do something with that string, you either have to always cut away stuff using some nasty regular expression, or you have to query each rooms metadata respetively. First one is bad because of regular expressions and mangling with server output in general, second one is bad because of “performance” when you have A LOT of MUC-Rooms.

So i decided to grab the source and make this behaviour configurable, on a per room basis, but
also as a default option in the config file. Simply grab the source, replace your existing src/mod_muc/mod_muc_room.erl (this is ejabberd 2.0.1) and recompile. You now should have the option

modify_title


in every configuration form, and you can change it in ejabberd.cfg file using

{default_room_options, [{modify_title, false}]}


Default setting is “true”, which means everything is the same way as in ejabberd before, set to false the option will prevent ejabberd from putting any additional information into the MUC-Rooms title.

Download: mod_muc_room.erl
Patch: mod_muc_room_modify_title.patch



Categories: Blogs  ESL Developer Blog  

Comments

No comments so far, you could be the first.

Add comment

Name:

Email:

URL:

Smileys

Remember my personal information

Notify me of follow-up comments?