mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Add muc related hooks
This commit is contained in:
parent
58110e4bc1
commit
b66dab1313
@ -166,7 +166,7 @@ restore_room(ServerHost, Host, Name) ->
|
||||
|
||||
forget_room(ServerHost, Host, Name) ->
|
||||
LServer = jid:nameprep(ServerHost),
|
||||
ejabberd_hooks:run(remove_room, LServer, [LServer, Name, Host]),
|
||||
ejabberd_hooks:run(destroy_room, LServer, [LServer, Name, Host]),
|
||||
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
||||
Mod:forget_room(LServer, Host, Name).
|
||||
|
||||
@ -256,6 +256,7 @@ handle_call({create, Room, From, Nick, Opts}, _From,
|
||||
Nick, NewOpts, QueueType),
|
||||
RMod = gen_mod:ram_db_mod(ServerHost, ?MODULE),
|
||||
RMod:register_online_room(ServerHost, Room, Host, Pid),
|
||||
ejabberd_hooks:run(create_room, ServerHost, [ServerHost, Room, Host]),
|
||||
{reply, ok, State}.
|
||||
|
||||
handle_cast({reload, ServerHost, NewOpts, OldOpts}, #state{host = OldHost}) ->
|
||||
|
@ -4004,6 +4004,7 @@ tab_add_online_user(JID, StateData) ->
|
||||
Room = StateData#state.room,
|
||||
Host = StateData#state.host,
|
||||
ServerHost = StateData#state.server_host,
|
||||
ejabberd_hooks:run(join_room, ServerHost, [ServerHost, Room, Host, JID]),
|
||||
mod_muc:register_online_user(ServerHost, jid:tolower(JID), Room, Host).
|
||||
|
||||
-spec tab_remove_online_user(jid(), state()) -> any().
|
||||
@ -4011,6 +4012,7 @@ tab_remove_online_user(JID, StateData) ->
|
||||
Room = StateData#state.room,
|
||||
Host = StateData#state.host,
|
||||
ServerHost = StateData#state.server_host,
|
||||
ejabberd_hooks:run(leave_room, ServerHost, [ServerHost, Room, Host, JID]),
|
||||
mod_muc:unregister_online_user(ServerHost, jid:tolower(JID), Room, Host).
|
||||
|
||||
-spec tab_count_user(jid(), state()) -> non_neg_integer().
|
||||
|
Loading…
Reference in New Issue
Block a user