diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2016-01-26 10:00:11 +0100 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2016-01-26 10:00:28 +0100 |
commit | bdeb4a7e32dbf6b998018196781cdd142bff3c38 (patch) | |
tree | 23c1d74bfa8bf2667f0fdd2ad1ef0d9578a4257f /src/ejabberd_sm.erl | |
parent | Merge branch 'master' of github.com:processone/ejabberd (diff) |
Add a way to get all ejabberd_commands, not only those that was registered
This is part of (TECH-1828).
Diffstat (limited to 'src/ejabberd_sm.erl')
-rw-r--r-- | src/ejabberd_sm.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index ddc5697f..3045a417 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -63,7 +63,8 @@ get_user_ip/3, get_max_user_sessions/2, get_all_pids/0, - is_existing_resource/3 + is_existing_resource/3, + get_commands_spec/0 ]). -export([init/1, handle_call/3, handle_cast/2, @@ -323,7 +324,7 @@ init([]) -> ejabberd_hooks:add(remove_user, Host, ejabberd_sm, disconnect_removed_user, 100) end, ?MYHOSTS), - ejabberd_commands:register_commands(commands()), + ejabberd_commands:register_commands(get_commands_spec()), {ok, #state{}}. handle_call(_Request, _From, State) -> @@ -361,7 +362,7 @@ handle_info({unregister_iq_handler, Host, XMLNS}, handle_info(_Info, State) -> {noreply, State}. terminate(_Reason, _State) -> - ejabberd_commands:unregister_commands(commands()), + ejabberd_commands:unregister_commands(get_commands_spec()), ok. code_change(_OldVsn, State, _Extra) -> {ok, State}. @@ -723,7 +724,7 @@ get_sm_backend() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% ejabberd commands -commands() -> +get_commands_spec() -> [#ejabberd_commands{name = connected_users, tags = [session], desc = "List all established sessions", |