diff options
-rw-r--r-- | rebar.config | 2 | ||||
-rw-r--r-- | src/ejabberd_c2s.erl | 7 | ||||
-rw-r--r-- | src/ejabberd_logger.erl | 2 | ||||
-rw-r--r-- | src/mod_admin_extra.erl | 6 | ||||
-rw-r--r-- | src/mod_http_api.erl | 17 |
5 files changed, 11 insertions, 23 deletions
diff --git a/rebar.config b/rebar.config index 2d8711e2e..fe8c8ab72 100644 --- a/rebar.config +++ b/rebar.config @@ -25,7 +25,7 @@ {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", "9b25543cf1200e3b216996598771962461ea51c8"}}, {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.14"}}}, {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.34"}}}, - {xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.2.5"}}}, + {xmpp, ".*", {git, "https://github.com/processone/xmpp", "032548195547c68e77c7d89f51e3fbe0522fc218"}}, {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.17"}}}, {jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}}, {p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.3"}}}, diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index db7fb9bdf..c65e71bdf 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -49,7 +49,7 @@ -export([get_presence/1, set_presence/2, resend_presence/1, resend_presence/2, open_session/1, call/3, cast/2, send/2, close/1, close/2, stop/1, reply/2, copy_state/2, set_timeout/2, route/2, - host_up/1, host_down/1]). + host_up/1, host_down/1, send_ws_ping/1]). -include("xmpp.hrl"). -include("logger.hrl"). @@ -137,6 +137,11 @@ send_error(#{lserver := LServer} = State, Pkt, Err) -> {Pkt1, State1} -> xmpp_stream_in:send_error(State1, Pkt1, Err) end. +-spec send_ws_ping(pid()) -> ok; + (state()) -> state(). +send_ws_ping(Ref) -> + xmpp_stream_in:send_ws_ping(Ref). + -spec route(pid(), term()) -> boolean(). route(Pid, Term) -> ejabberd_cluster:send(Pid, Term). diff --git a/src/ejabberd_logger.erl b/src/ejabberd_logger.erl index aac0baf59..c7845be2f 100644 --- a/src/ejabberd_logger.erl +++ b/src/ejabberd_logger.erl @@ -220,7 +220,7 @@ set(LogLevel) when is_integer(LogLevel) -> end, case LogLevel of 5 -> xmpp:set_config([{debug, true}]); - _ -> ok + _ -> xmpp:set_config([{debug, false}]) end, {module, lager}; set({_LogLevel, _}) -> diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl index 06dc8e5b6..5db82f82a 100644 --- a/src/mod_admin_extra.erl +++ b/src/mod_admin_extra.erl @@ -1152,8 +1152,7 @@ set_vcard_content(User, Server, Data, SomeContent) -> end, %% Build new vcard SubEl = {xmlel, <<"vCard">>, [{<<"xmlns">>,<<"vcard-temp">>}], A4}, - mod_vcard:set_vcard(User, jid:nameprep(Server), SubEl), - ok. + mod_vcard:set_vcard(User, jid:nameprep(Server), SubEl). take_vcard_tel(TelType, [{xmlel, <<"TEL">>, _, SubEls}=OldEl | OldEls], NewEls, Taken) -> {Taken2, NewEls2} = case lists:keymember(TelType, 2, SubEls) of @@ -1390,8 +1389,7 @@ private_set(Username, Host, ElementString) -> private_set2(Username, Host, Xml) -> NS = fxml:get_tag_attr_s(<<"xmlns">>, Xml), mod_private:set_data(jid:nodeprep(Username), jid:nameprep(Host), - [{NS, Xml}]), - ok. + [{NS, Xml}]). %%% %%% Shared Roster Groups diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 3bea1437d..4d4a40f79 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -274,20 +274,8 @@ handle(Call, Auth, Args, Version) when is_atom(Call), is_list(Args) -> case ejabberd_commands:get_command_format(Call, Auth, Version) of {ArgsSpec, _} when is_list(ArgsSpec) -> Args2 = [{misc:binary_to_atom(Key), Value} || {Key, Value} <- Args], - Spec = lists:foldr( - fun ({Key, binary}, Acc) -> - [{Key, <<>>}|Acc]; - ({Key, string}, Acc) -> - [{Key, ""}|Acc]; - ({Key, integer}, Acc) -> - [{Key, 0}|Acc]; - ({Key, {list, _}}, Acc) -> - [{Key, []}|Acc]; - ({Key, atom}, Acc) -> - [{Key, undefined}|Acc] - end, [], ArgsSpec), try - handle2(Call, Auth, match(Args2, Spec), Version) + handle2(Call, Auth, Args2, Version) catch throw:not_found -> {404, <<"not_found">>}; throw:{not_found, Why} when is_atom(Why) -> @@ -431,9 +419,6 @@ process_unicode_codepoints(Str) -> %% internal helpers %% ---------------- -match(Args, Spec) -> - [{Key, proplists:get_value(Key, Args, Default)} || {Key, Default} <- Spec]. - format_command_result(Cmd, Auth, Result, Version) -> {_, ResultFormat} = ejabberd_commands:get_command_format(Cmd, Auth, Version), case {ResultFormat, Result} of |