esl/ejabberd — pull request #106 by arcusfelis (2013-09-10 16:47:56+00:00)
Title: Introduced new mod_muc's hooks

These hooks are used by `mod_mam`.

1) `filter_room_packet` allows filter and edit messages. A handler can be registered with this code:

```erlang
ejabberd_hooks:add(filter_room_packet, Host, ?MODULE, filter_room_packet, 90)
```

It will be called as

```erlang
?MODULE:filter_room_packet(Packet, FromNick, FromJID, RoomJID)
```

2) `forget_room(Host, Name)` will be called, during permanent room destruction.

```erlang
ejabberd_hooks:add(forget_room, Host, ?MODULE, forget_room, 90)
```

3) An IQ handler can be registered with this code:

```erlang
gen_iq_handler:add_iq_handler(mod_muc_iq, Host, <<"urn:xmpp:mam:tmp">>,
?MODULE, room_process_mam_iq, IQDisc)
```

where `<<"urn:xmpp:mam:tmp">>` is a namespace.

It will be called as:

```erlang
room_process_mam_iq(From, To, IQ)
```