[ejabberd] modular_muc released (was : The case for refactoring MUC)
eric at ohmforce.com
Thu May 7 15:26:59 MSD 2009
I have (finally) released code on github for modular_muc.
The objective is to make mod_muc easily extendable, in the spirit of
Two points of extension are available :
* room handlers, handling events, roles, affiliations, stanza
Two of them are included in the distribution :
- muc_room_default : XEP-0045 straight implementation (most of the
code coming from mod_muc_room)
- minimal_muc : a "blank" module, designed as a starting point, with
* Two storage managers are available, for storing persistent rooms.
- muc_storage_default : mnesia backend (like mod_muc)
- s3_muc_storage : stores persistent mucs in S3
(this one needs the erls3 lib, available here : http://github.com/cstar/erls3/tree/master)
There can be several room handlers declared, and there's a version of
mod_muc:create_room accepting a Type parameter. Specifying the
room_handler there will start the room with this handler.
Also room handler is stored along with persistent room data.
Only one storage manager can actually be used by an ejabberd instance.
(that may change though)
It can be used as a dropin replacement for current ejabberd mod_muc;
it behaves exactly the same with default parameters.
what's next :
- The API needs polishing
- bugs are probably still lurking, waiting for a good whack.
- Currently mod_muc loads all persistent rooms at startup. That also
means that in a cluster setup, all persistent muc are started on one
node (the one started first). I'd rather have persistent rooms start
when they get non-empty, and be destroyed when the last user leaves.
That would also allow for a better distribution over the cluster.
- I hope for integration into ejabberd trunk at some point, but it is
not the right time yet :)
Patches and feedback welcome.
More information about the ejabberd