[ejabberd] hierarchical MUC refactoring

Badlop badlop at gmail.com
Thu Sep 30 14:46:30 MSD 2010


2010/9/29 alexej <textonpc at gmail.com>:
> We are trying to refactoring the ejabberd mod_muc in order to handle a sort of
> hierarchical MUC:
>
> "rooms will be hierarchically related, so the user logging in one room will be
> visible in the ancestors rooms and will see users presence from the descendants
> rooms"
>
> This is the main concept.

First of all, let's assume that your design of using hierarchical MUC rooms
is really the best approach to a requirement that you haven't explained,
and that may be better solved using other means, just to name one, PubSub.

In my sentence, "best" means: easier and faster to implement in client
and server,
easier to test debug and verify when problems appear,
more maintenable and customizable code for future features,
better performance in CPU and RAM in client and server,
easier to port to a server or client change.

You considered a server implementation.
If you are using a closed environment, you can consider also a client
implementation:

1. When the user wants to join the room "editor::text::vim",
his client should send presence stanzas to the rooms "editor",
"editor::text" and
to the really desired room.

2. The client opens a window that manages the traffic of all the 3 rooms.

3. When the user leaves the room, the client must send unavailable
presence stanzas
to the three rooms.


> Practically, when a user is logging into one room, must send presence stanzas to
> the ancestors rooms, and must receive presence stanzas from the users in the
> descendants rooms.
>
> Which are the mod_muc functions sending presence (available and unavailable)
> stanzas to the logged users?

mod_muc_room:send_update_presence/3


> How can I retrieve the list of logged JIDS given a room JID?

Check the contributed mod_muc_admin.erl in ejabberd-modules SVN,
it has the function get_room_occupants.


---
Badlop
ProcessOne


More information about the ejabberd mailing list