Fix IQ result processing
This commit is contained in:
parent
13d5da4da6
commit
3765210698
|
@ -268,7 +268,7 @@ process_iq_result(#iq{from = From, to = To, id = ID, lang = Lang} = IQ,
|
||||||
case xmpp:decode(SubEl, ?NS_CLIENT, [ignore_els]) of
|
case xmpp:decode(SubEl, ?NS_CLIENT, [ignore_els]) of
|
||||||
#iq{from = To, to = From, type = Type, id = ID} = Reply
|
#iq{from = To, to = From, type = Type, id = ID} = Reply
|
||||||
when Type == error; Type == result ->
|
when Type == error; Type == result ->
|
||||||
ejabberd_router:route(From, To, Reply)
|
ejabberd_router:route(To, From, Reply)
|
||||||
end
|
end
|
||||||
catch _:_ ->
|
catch _:_ ->
|
||||||
?ERROR_MSG("got iq-result with invalid delegated "
|
?ERROR_MSG("got iq-result with invalid delegated "
|
||||||
|
@ -294,9 +294,17 @@ send_disco_queries(LServer, Host, NS) ->
|
||||||
ejabberd_local:route_iq(
|
ejabberd_local:route_iq(
|
||||||
From, To, #iq{type = get, from = From, to = To,
|
From, To, #iq{type = get, from = From, to = To,
|
||||||
sub_els = [#disco_info{node = Node}]},
|
sub_els = [#disco_info{node = Node}]},
|
||||||
fun(#iq{type = result, sub_els = [#disco_info{} = Info]}) ->
|
fun(#iq{type = result, sub_els = [SubEl]}) ->
|
||||||
Proc = gen_mod:get_module_proc(LServer, ?MODULE),
|
try xmpp:decode(SubEl) of
|
||||||
gen_server:cast(Proc, {disco_info, Type, Host, NS, Info});
|
#disco_info{} = Info->
|
||||||
|
Proc = gen_mod:get_module_proc(LServer, ?MODULE),
|
||||||
|
gen_server:cast(
|
||||||
|
Proc, {disco_info, Type, Host, NS, Info});
|
||||||
|
_ ->
|
||||||
|
ok
|
||||||
|
catch _:{xmpp_codec, _} ->
|
||||||
|
ok
|
||||||
|
end;
|
||||||
(_) ->
|
(_) ->
|
||||||
ok
|
ok
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue