From 1d9340619f693174728cb259c75f4cbf8a7251f5 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Thu, 6 Nov 2003 20:35:10 +0000 Subject: [PATCH] * src/mod_configure2.erl: Added reporting of outgoing S2S connections number * src/mod_disco.erl (get_outgoing_s2s): Minor fix SVN Revision: 169 --- ChangeLog | 7 +++++++ src/mod_configure2.erl | 5 ++++- src/mod_disco.erl | 5 +++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3c7fe687..f1184a9bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-11-06 Alexey Shchepin + + * src/mod_configure2.erl: Added reporting of outgoing S2S + connections number + + * src/mod_disco.erl (get_outgoing_s2s): Minor fix + 2003-11-02 Alexey Shchepin * src/mod_configure2.erl: Yet another configure interface (not 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) ->