aboutsummaryrefslogtreecommitdiff
path: root/src/mod_multicast.erl
diff options
context:
space:
mode:
authorEmmet McPoland <emcpoland01@qub.ac.uk>2021-07-07 16:44:58 +0100
committerEmmet McPoland <emcpoland01@qub.ac.uk>2021-07-07 16:44:58 +0100
commit509331a563e98c37c055b786ba95ce65c52b1d6d (patch)
tree276c6b5c3fb9b3e7ec0fb9469eb68533afe4b68b /src/mod_multicast.erl
parentTell relx to include src, so that the tar will contain include/ (#3633) (diff)
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
Diffstat (limited to 'src/mod_multicast.erl')
-rw-r--r--src/mod_multicast.erl19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mod_multicast.erl b/src/mod_multicast.erl
index 530bfecea..161d3a4c4 100644
--- a/src/mod_multicast.erl
+++ b/src/mod_multicast.erl
@@ -392,8 +392,9 @@ perform(From, Packet, _,
{route_single, Group}) ->
lists:foreach(
fun(ToUser) ->
+ Group_others = strip_other_bcc(ToUser, Group#group.others),
route_packet(From, ToUser, Packet,
- Group#group.others, Group#group.addresses)
+ Group_others, Group#group.addresses)
end, Group#group.dests);
perform(From, Packet, _,
{{route_multicast, JID, RLimits}, Group}) ->
@@ -425,6 +426,21 @@ strip_addresses_element(Packet) ->
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
%%%-------------------------
@@ -545,7 +561,6 @@ build_other_xml(Dests) ->
case Dest#dest.type of
to -> [add_delivered(XML) | R];
cc -> [add_delivered(XML) | R];
- bcc -> R;
_ -> [XML | R]
end
end,