From: Holger Weiss Date: Fri, 30 May 2014 21:32:18 +0000 (+0200) Subject: Don't send XEP-0280 v1 copies back to sender X-Git-Tag: 14.07~89^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad2d3964ef28011e36c1cdf0d5f8696c4504a91d;p=ejabberd Don't send XEP-0280 v1 copies back to sender An earlier version of XEP-0280 specified the and tags to be siblings of the element, whereas the current version mandates them to be parents of . The mod_carboncopy module supports both variants. However, the check that makes sure clients won't receive a copy of the messages they sent didn't work for the old-style schema. This is now fixed. --- diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl index 124a15f35..009d17ed2 100644 --- a/src/mod_carboncopy.erl +++ b/src/mod_carboncopy.erl @@ -153,9 +153,14 @@ check_and_forward(JID, To, #xmlel{name = <<"message">>, attrs = Attrs} = Packet, if SubTag == false -> send_copies(JID, To, Packet, Direction); true -> - case xml:get_subtag(SubTag,<<"forwarded">>) of + case xml:get_subtag(Packet,<<"forwarded">>) of false-> - send_copies(JID, To, Packet, Direction); + case xml:get_subtag(SubTag,<<"forwarded">>) of + false -> + send_copies(JID, To, Packet, Direction); + _ -> + stop + end; _ -> stop end