diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_admin_extra.erl | 11 | ||||
-rw-r--r-- | src/mod_muc.erl | 2 | ||||
-rw-r--r-- | src/mod_pubsub.erl | 12 |
3 files changed, 20 insertions, 5 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(_) -> []. diff --git a/src/mod_muc.erl b/src/mod_muc.erl index 8a7fd1664..bdf925168 100644 --- a/src/mod_muc.erl +++ b/src/mod_muc.erl @@ -1002,7 +1002,7 @@ mod_options(Host) -> {max_room_id, infinity}, {max_room_name, infinity}, {max_rooms_discoitems, 100}, - {max_user_conferences, 10}, + {max_user_conferences, 100}, {max_users, 200}, {max_users_admin_threshold, 5}, {max_users_presence, 1000}, diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index d96933e11..2609beb86 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -1138,8 +1138,14 @@ iq_pubsub(Host, Access, #iq{from = From, type = IQType, lang = Lang, {set, #pubsub{subscribe = #ps_subscribe{node = Node, jid = JID}, options = Options, _ = undefined}} -> Config = case Options of - #ps_options{xdata = XData} -> + #ps_options{xdata = XData, jid = undefined, node = <<>>} -> decode_subscribe_options(XData, Lang); + #ps_options{xdata = _XData, jid = #jid{}} -> + Txt = <<"Attribute 'jid' is not allowed here">>, + {error, xmpp:err_bad_request(Txt, Lang)}; + #ps_options{xdata = _XData} -> + Txt = <<"Attribute 'node' is not allowed here">>, + {error, xmpp:err_bad_request(Txt, Lang)}; _ -> [] end, @@ -1165,6 +1171,10 @@ iq_pubsub(Host, Access, #iq{from = From, type = IQType, lang = Lang, {get, #pubsub{affiliations = {Node, _}, _ = undefined}} -> Plugins = config(serverhost(Host), plugins), get_affiliations(Host, Node, From, Plugins); + {_, #pubsub{options = #ps_options{jid = undefined}, _ = undefined}} -> + {error, extended_error(xmpp:err_bad_request(), err_jid_required())}; + {_, #pubsub{options = #ps_options{node = <<>>}, _ = undefined}} -> + {error, extended_error(xmpp:err_bad_request(), err_nodeid_required())}; {get, #pubsub{options = #ps_options{node = Node, subid = SubId, jid = JID}, _ = undefined}} -> get_options(Host, Node, JID, SubId, Lang); |