[ejabberd] Any complete docs about ejabberd module development?

Badlop badlop at gmail.com
Mon Jan 11 22:56:22 MSK 2010


2010/1/11 Liu Xi <jason.liuxi at gmail.com>:
> Dear all,
> I got a task on extending a ejabberd server to fit out specific needs.
> Here is the situation, imaging a chatroom based on ejabberd, is it possible
> for developing a module to perform the action like this: people "A" speaks
> in the chatroom, in the usual way, that is supposed to send to all the other
> fellows in the same chatroom via the server. But I want the server to send
> only to some specific clients, that is to say: is it possible for developing
> a module to modify the original chatroom receivers list?

> 2.Is it possible to implement the functionality I described above just
> devloping modules? I mean compared to modifying the source code.

There isn't any hook currently for what you want.
You need to modify mod_muc_room.erl to run a new hook allowing to
modify the receiver list.
With some luck that could be 4 or 5 lines of code.

And then write your module that registers to the hook, modifies the
receiver list and returns it back to mod_muc_room. That can be as many
lines and as complex as you want :)


> I checked the module development guide on the process-one site
> http://www.process-one.net/en/wiki/ejabberd_module_development/.
> but lots of API are not complete, for example, in the page of events and
> hooks, only the event names are listed, nothing about when the events will
> happen and what the event exactly is.
> My questions:
> 1.Is there any complete documents about module developing?

Not at all. Another partial document is:
http://anders.conbere.org/blog/2008/07/17/building_ejabberd_modules_-_part_2_-_generic_modules/

By the way, you can also check this modified mod_muc, maybe it
provides the flexibility you want: http://www.ejabberd.im/modular_muc


---
Badlop
ProcessOne


More information about the ejabberd mailing list