]> granicus.if.org Git - ejabberd/commitdiff
Introduce muc_invite hook
authorMarc Philipp <marc.philipp@citrix.com>
Fri, 14 Oct 2016 10:52:59 +0000 (12:52 +0200)
committerMarc Philipp <marc.philipp@citrix.com>
Fri, 14 Oct 2016 10:52:59 +0000 (12:52 +0200)
This adds a new hook that is triggered for each invite to an MUC room:

- muc_invite(RoomJID, RoomConfig, From, To, Reason) -> ok

where

- RoomJID = From = To = #jid (see jlib.h)
- RoomConfig = #config (see mod_muc_room.hrl)
- Reason = binary()

src/mod_muc_room.erl

index fc2aeebb688e4f128adfcf2c059459d1e7775427..5bee4f0b780781abe8fcbecf384e0231d0ab0976 100644 (file)
@@ -5056,6 +5056,8 @@ process_invitations(From, InviteEls, Lang, StateData) ->
                          throw({error, ?ERRT_JID_MALFORMED(Lang, Txt)});
                    JID1 -> JID1
                  end,
+         ejabberd_hooks:run(muc_invite, StateData#state.server_host,
+                            [StateData#state.jid, StateData#state.config, From, JID, Reason]),
          ejabberd_router:route(StateData#state.jid, JID, Msg),
          JID
        end,