mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
Correctly strip only other bcc addresses i.e. bcc receiver should still be able to see their bcc address element and no other bcc address element
This commit is contained in:
parent
08c2d0a83e
commit
509331a563
1 changed files with 17 additions and 2 deletions
|
@ -392,8 +392,9 @@ perform(From, Packet, _,
|
||||||
{route_single, Group}) ->
|
{route_single, Group}) ->
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(ToUser) ->
|
fun(ToUser) ->
|
||||||
|
Group_others = strip_other_bcc(ToUser, Group#group.others),
|
||||||
route_packet(From, ToUser, Packet,
|
route_packet(From, ToUser, Packet,
|
||||||
Group#group.others, Group#group.addresses)
|
Group_others, Group#group.addresses)
|
||||||
end, Group#group.dests);
|
end, Group#group.dests);
|
||||||
perform(From, Packet, _,
|
perform(From, Packet, _,
|
||||||
{{route_multicast, JID, RLimits}, Group}) ->
|
{{route_multicast, JID, RLimits}, Group}) ->
|
||||||
|
@ -424,6 +425,21 @@ strip_addresses_element(Packet) ->
|
||||||
throw(eadsele)
|
throw(eadsele)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
%%%-------------------------
|
||||||
|
%%% Strip third-party bcc 'addresses'
|
||||||
|
%%%-------------------------
|
||||||
|
|
||||||
|
strip_other_bcc(#dest{jid_jid = ToUserJid}, Group_others) ->
|
||||||
|
lists:filter(
|
||||||
|
fun(#address{jid = JID, type = Type}) ->
|
||||||
|
case {JID, Type} of
|
||||||
|
{ToUserJid, bcc} -> true;
|
||||||
|
{_, bcc} -> false;
|
||||||
|
_ -> true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
Group_others).
|
||||||
|
|
||||||
%%%-------------------------
|
%%%-------------------------
|
||||||
%%% Split Addresses
|
%%% Split Addresses
|
||||||
%%%-------------------------
|
%%%-------------------------
|
||||||
|
@ -545,7 +561,6 @@ build_other_xml(Dests) ->
|
||||||
case Dest#dest.type of
|
case Dest#dest.type of
|
||||||
to -> [add_delivered(XML) | R];
|
to -> [add_delivered(XML) | R];
|
||||||
cc -> [add_delivered(XML) | R];
|
cc -> [add_delivered(XML) | R];
|
||||||
bcc -> R;
|
|
||||||
_ -> [XML | R]
|
_ -> [XML | R]
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue