mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Relay pubsub iq queries to muc members without using bare jid
We do something similar for vcard queries, this allows target server to respond to those queries by target server, which is what we want to do in both of those cases.
This commit is contained in:
parent
a3f4a05b0c
commit
62d3d7a32d
@ -671,6 +671,10 @@ normal_state({route, ToNick,
|
|||||||
ejabberd_router:route_iq(
|
ejabberd_router:route_iq(
|
||||||
xmpp:set_from_to(Packet, FromJID, jid:remove_resource(To)),
|
xmpp:set_from_to(Packet, FromJID, jid:remove_resource(To)),
|
||||||
Packet, self());
|
Packet, self());
|
||||||
|
pubsub ->
|
||||||
|
ejabberd_router:route_iq(
|
||||||
|
xmpp:set_from_to(Packet, FromJID, jid:remove_resource(To)),
|
||||||
|
Packet, self());
|
||||||
ping when ToNick == FromNick ->
|
ping when ToNick == FromNick ->
|
||||||
%% Self-ping optimization from XEP-0410
|
%% Self-ping optimization from XEP-0410
|
||||||
ejabberd_router:route(xmpp:make_iq_result(Packet));
|
ejabberd_router:route(xmpp:make_iq_result(Packet));
|
||||||
@ -1304,12 +1308,13 @@ process_voice_approval(From, Pkt, VoiceApproval, StateData) ->
|
|||||||
StateData
|
StateData
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec direct_iq_type(iq()) -> vcard | ping | request | response | stanza_error().
|
-spec direct_iq_type(iq()) -> vcard | ping | request | response | pubsub | stanza_error().
|
||||||
direct_iq_type(#iq{type = T, sub_els = SubEls, lang = Lang}) when T == get; T == set ->
|
direct_iq_type(#iq{type = T, sub_els = SubEls, lang = Lang}) when T == get; T == set ->
|
||||||
case SubEls of
|
case SubEls of
|
||||||
[El] ->
|
[El] ->
|
||||||
case xmpp:get_ns(El) of
|
case xmpp:get_ns(El) of
|
||||||
?NS_VCARD when T == get -> vcard;
|
?NS_VCARD when T == get -> vcard;
|
||||||
|
?NS_PUBSUB when T == get -> pubsub;
|
||||||
?NS_PING when T == get -> ping;
|
?NS_PING when T == get -> ping;
|
||||||
_ -> request
|
_ -> request
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user