Get rid of all calls to jlib.erl module
This commit is contained in:
parent
7bd5c7fe59
commit
17b05ff4b7
|
@ -107,21 +107,11 @@ get_features(_, _, _, XMLNSs) ->
|
||||||
|
|
||||||
-spec process_iq(binary(), atom(), atom(), iq()) -> any().
|
-spec process_iq(binary(), atom(), atom(), iq()) -> any().
|
||||||
process_iq(_Host, Module, Function, IQ) ->
|
process_iq(_Host, Module, Function, IQ) ->
|
||||||
try
|
try process_iq(Module, Function, IQ) of
|
||||||
ResIQ = case erlang:function_exported(Module, Function, 1) of
|
#iq{} = ResIQ ->
|
||||||
true ->
|
ejabberd_router:route(ResIQ);
|
||||||
process_iq(Module, Function, IQ);
|
ignore ->
|
||||||
false ->
|
ok
|
||||||
From = xmpp:get_from(IQ),
|
|
||||||
To = xmpp:get_to(IQ),
|
|
||||||
process_iq(Module, Function, From, To,
|
|
||||||
jlib:iq_query_info(xmpp:encode(IQ)))
|
|
||||||
end,
|
|
||||||
if ResIQ /= ignore ->
|
|
||||||
ejabberd_router:route(ResIQ);
|
|
||||||
true ->
|
|
||||||
ok
|
|
||||||
end
|
|
||||||
catch E:R ->
|
catch E:R ->
|
||||||
?ERROR_MSG("failed to process iq:~n~s~nReason = ~p",
|
?ERROR_MSG("failed to process iq:~n~s~nReason = ~p",
|
||||||
[xmpp:pp(IQ), {E, {R, erlang:get_stacktrace()}}]),
|
[xmpp:pp(IQ), {E, {R, erlang:get_stacktrace()}}]),
|
||||||
|
@ -143,16 +133,6 @@ process_iq(Module, Function, #iq{lang = Lang, sub_els = [El]} = IQ) ->
|
||||||
xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang))
|
xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang))
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec process_iq(module(), atom(), jid(), jid(), term()) -> iq().
|
|
||||||
process_iq(Module, Function, From, To, IQ) ->
|
|
||||||
case Module:Function(From, To, IQ) of
|
|
||||||
ignore -> ignore;
|
|
||||||
ResIQ ->
|
|
||||||
xmpp:set_from_to(
|
|
||||||
xmpp:decode(jlib:iq_to_xml(ResIQ), ?NS_CLIENT, [ignore_els]),
|
|
||||||
To, From)
|
|
||||||
end.
|
|
||||||
|
|
||||||
-spec check_type(any()) -> no_queue.
|
-spec check_type(any()) -> no_queue.
|
||||||
check_type(_Type) ->
|
check_type(_Type) ->
|
||||||
?WARNING_MSG("Option 'iqdisc' is deprecated and has no effect anymore", []),
|
?WARNING_MSG("Option 'iqdisc' is deprecated and has no effect anymore", []),
|
||||||
|
|
Loading…
Reference in New Issue