diff options
author | Alexey Shchepin <alexey@process-one.net> | 2003-11-06 20:35:10 +0000 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2003-11-06 20:35:10 +0000 |
commit | 1d9340619f693174728cb259c75f4cbf8a7251f5 (patch) | |
tree | e43f143bc9cf2945af91ea9e98759b82fefc4de3 /src | |
parent | * src/mod_configure2.erl: Yet another configure interface (not (diff) |
* src/mod_configure2.erl: Added reporting of outgoing S2S
connections number
* src/mod_disco.erl (get_outgoing_s2s): Minor fix
SVN Revision: 169
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_configure2.erl | 5 | ||||
-rw-r--r-- | src/mod_disco.erl | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/mod_configure2.erl b/src/mod_configure2.erl index b8fadbc93..d805728d4 100644 --- a/src/mod_configure2.erl +++ b/src/mod_configure2.erl @@ -85,6 +85,8 @@ process_local_iq(From, _To, {iq, ID, Type, XMLNS, SubEl}) -> process_get({xmlelement, "info", _Attrs, _SubEls}) -> + S2SConns = ejabberd_s2s:dirty_get_connections(), + TConns = lists:usort([element(2, C) || C <- S2SConns]), Attrs = [{"registered-users", integer_to_list(mnesia:table_info(passwd, size))}, {"online-users", @@ -95,7 +97,8 @@ process_get({xmlelement, "info", _Attrs, _SubEls}) -> integer_to_list( length(lists:usort(mnesia:system_info(db_nodes) ++ mnesia:system_info(extra_db_nodes)) -- - mnesia:system_info(running_db_nodes)))}], + mnesia:system_info(running_db_nodes)))}, + {"outgoing-s2s-servers", integer_to_list(length(TConns))}], {result, {xmlelement, "info", [{"xmlns", ?NS_ECONFIGURE} | Attrs], []}}; process_get({xmlelement, "welcome-message", Attrs, _SubEls}) -> diff --git a/src/mod_disco.erl b/src/mod_disco.erl index f658b58f8..612568be0 100644 --- a/src/mod_disco.erl +++ b/src/mod_disco.erl @@ -379,8 +379,9 @@ get_outgoing_s2s(Lang) -> {'EXIT', Reason} -> []; Connections -> + TConns = [element(2, C) || C <- Connections], lists:map( - fun({F, T}) -> + fun(T) -> {xmlelement, "item", [{"jid", ?MYNAME}, {"node", "outgoing s2s/" ++ T}, @@ -389,7 +390,7 @@ get_outgoing_s2s(Lang) -> io_lib:format( translate:translate(Lang, "To ~s"), [T]))}], []} - end, lists:keysort(2, Connections)) + end, lists:usort(TConns)) end. get_outgoing_s2s(Lang, To) -> |