diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2018-07-13 09:50:38 +0200 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2018-07-13 09:51:19 +0200 |
commit | e76a57e144eee1e5c079a9be3f56d75a4ff7e77e (patch) | |
tree | f42689d8985a31472a2fbc7763ccabd1b22c24f5 /src | |
parent | Adopt code that uses parse_listener_portip after result change (diff) |
Ensure that returned priority in a number in mod_admin_extra
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_admin_extra.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl index 2deb5525b..bb7fe0bdd 100644 --- a/src/mod_admin_extra.erl +++ b/src/mod_admin_extra.erl @@ -1018,7 +1018,7 @@ status_num(Status) -> status_num(<<"all">>, Status). status_list(Host, Status) -> Res = get_status_list(Host, Status), - [{U, S, R, P, St} || {U, S, R, P, St} <- Res]. + [{U, S, R, num_prio(P), St} || {U, S, R, P, St} <- Res]. status_list(Status) -> status_list(<<"all">>, Status). @@ -1046,7 +1046,7 @@ get_status_list(Host, Status_required) -> _ -> fun(A, B) -> A == B end end, - [{User, Server, Resource, Priority, stringize(Status_text)} + [{User, Server, Resource, num_prio(Priority), stringize(Status_text)} || {{User, Resource, Status, Status_text}, Server, Priority} <- Sessions4, apply(Fstatus, [Status, Status_required])]. @@ -1127,7 +1127,7 @@ user_session_info(User, Host, Resource) -> NodeS = atom_to_list(node(Pid)), Uptime = CurrentSec - calendar:datetime_to_gregorian_seconds( calendar:now_to_local_time(Now)), - {atom_to_list(Conn), IPS, Port, Priority, NodeS, Uptime, Status, Resource, StatusText}. + {atom_to_list(Conn), IPS, Port, num_prio(Priority), NodeS, Uptime, Status, Resource, StatusText}. %%% @@ -1736,4 +1736,9 @@ is_glob_match(String, <<"!", Glob/binary>>) -> is_glob_match(String, Glob) -> is_regexp_match(String, ejabberd_regexp:sh_to_awk(Glob)). +num_prio(Priority) when is_integer(Priority) -> + Priority; +num_prio(_) -> + -1. + mod_options(_) -> []. |