summaryrefslogtreecommitdiff
path: root/src/ejabberd_s2s.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2016-01-26 10:00:11 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2016-01-26 10:00:28 +0100
commitbdeb4a7e32dbf6b998018196781cdd142bff3c38 (patch)
tree23c1d74bfa8bf2667f0fdd2ad1ef0d9578a4257f /src/ejabberd_s2s.erl
parentMerge 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_s2s.erl')
-rw-r--r--src/ejabberd_s2s.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl
index 06cad6af..2f026b32 100644
--- a/src/ejabberd_s2s.erl
+++ b/src/ejabberd_s2s.erl
@@ -42,7 +42,8 @@
clean_temporarily_blocked_table/0,
list_temporarily_blocked_hosts/0,
external_host_overloaded/1, is_temporarly_blocked/1,
- check_peer_certificate/3]).
+ check_peer_certificate/3,
+ get_commands_spec/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2,
@@ -239,7 +240,7 @@ init([]) ->
{attributes, record_info(fields, s2s)}]),
mnesia:add_table_copy(s2s, node(), ram_copies),
mnesia:subscribe(system),
- ejabberd_commands:register_commands(commands()),
+ ejabberd_commands:register_commands(get_commands_spec()),
mnesia:create_table(temporarily_blocked,
[{ram_copies, [node()]},
{attributes, record_info(fields, temporarily_blocked)}]),
@@ -265,7 +266,7 @@ handle_info({route, From, To, Packet}, State) ->
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) ->
@@ -469,7 +470,7 @@ send_element(Pid, El) ->
%%%----------------------------------------------------------------------
%%% ejabberd commands
-commands() ->
+get_commands_spec() ->
[#ejabberd_commands{name = incoming_s2s_number,
tags = [stats, s2s],
desc =