25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Fix Addresses element which lacked others local destinations

When sending single packet, in addresses include all other group
destinations, not only oneself
This commit is contained in:
Badlop 2016-03-14 12:53:14 +01:00
parent b871fbba1b
commit 5351e8236d

View File

@ -395,7 +395,7 @@ act_groups(FromJID, Packet_stripped, AAttrs, LServiceS,
perform(From, Packet, AAttrs, _, perform(From, Packet, AAttrs, _,
{route_single, Group}) -> {route_single, Group}) ->
[route_packet(From, ToUser, Packet, AAttrs, [route_packet(From, ToUser, Packet, AAttrs,
Group#group.addresses) Group#group.others, Group#group.addresses)
|| ToUser <- Group#group.dests]; || ToUser <- Group#group.dests];
perform(From, Packet, AAttrs, _, perform(From, Packet, AAttrs, _,
{{route_multicast, JID, RLimits}, Group}) -> {{route_multicast, JID, RLimits}, Group}) ->
@ -634,13 +634,13 @@ decide_action_group(Group) ->
%%% Route packet %%% Route packet
%%%------------------------- %%%-------------------------
route_packet(From, ToDest, Packet, AAttrs, Addresses) -> route_packet(From, ToDest, Packet, AAttrs, Others, Addresses) ->
Dests = case ToDest#dest.type of Dests = case ToDest#dest.type of
<<"bcc">> -> []; <<"bcc">> -> [];
_ -> [ToDest] _ -> [ToDest]
end, end,
route_packet2(From, ToDest#dest.jid_string, Dests, route_packet2(From, ToDest#dest.jid_string, Dests,
Packet, AAttrs, Addresses). Packet, AAttrs, {Others, Addresses}).
route_packet_multicast(From, ToS, Packet, AAttrs, Dests, route_packet_multicast(From, ToS, Packet, AAttrs, Dests,
Addresses, Limits) -> Addresses, Limits) ->
@ -666,6 +666,8 @@ route_packet2(From, ToS, Dests, Packet, AAttrs,
ToJID = stj(ToS), ToJID = stj(ToS),
ejabberd_router:route(From, ToJID, Packet2). ejabberd_router:route(From, ToJID, Packet2).
append_dests(_Dests, {Others, Addresses}) ->
Addresses++Others;
append_dests([], Addresses) -> Addresses; append_dests([], Addresses) -> Addresses;
append_dests([Dest | Dests], Addresses) -> append_dests([Dest | Dests], Addresses) ->
append_dests(Dests, [Dest#dest.full_xml | Addresses]). append_dests(Dests, [Dest#dest.full_xml | Addresses]).
@ -912,8 +914,9 @@ received_awaiter(JID, Waiter, LServiceS) ->
From = Waiter#waiter.sender, From = Waiter#waiter.sender,
Packet = Waiter#waiter.packet, Packet = Waiter#waiter.packet,
AAttrs = Waiter#waiter.aattrs, AAttrs = Waiter#waiter.aattrs,
Others = Group#group.others,
Addresses = Waiter#waiter.addresses, Addresses = Waiter#waiter.addresses,
[route_packet(From, ToUser, Packet, AAttrs, Addresses) [route_packet(From, ToUser, Packet, AAttrs, Others, Addresses)
|| ToUser <- Group#group.dests]; || ToUser <- Group#group.dests];
true -> true ->
send_query_info(RServer, LServiceS), send_query_info(RServer, LServiceS),