mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Merge pull request #149 from iulianlaz/carboncopy-fix-msg-back-to-original-sender
#148 Carbon copy sends message back to original sender solved
This commit is contained in:
commit
2b527f5e9a
@ -151,7 +151,19 @@ check_and_forward(JID, #xmlel{name = <<"message">>, attrs = Attrs} = Packet, Dir
|
|||||||
false ->
|
false ->
|
||||||
case xml:get_subtag(Packet,<<"received">>) of
|
case xml:get_subtag(Packet,<<"received">>) of
|
||||||
false ->
|
false ->
|
||||||
|
%% We must check if a packet contains "<sent><forwarded></sent></forwarded>" tags in order to avoid
|
||||||
|
%% receiving message back to original sender.
|
||||||
|
SubTag = xml:get_subtag(Packet,<<"sent">>),
|
||||||
|
if SubTag == false ->
|
||||||
send_copies(JID, Packet, Direction);
|
send_copies(JID, Packet, Direction);
|
||||||
|
true ->
|
||||||
|
case xml:get_subtag(SubTag,<<"forwarded">>) of
|
||||||
|
false->
|
||||||
|
send_copies(JID, Packet, Direction);
|
||||||
|
_ ->
|
||||||
|
stop
|
||||||
|
end
|
||||||
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
%% stop the hook chain, we don't want mod_logdb to register this message (duplicate)
|
%% stop the hook chain, we don't want mod_logdb to register this message (duplicate)
|
||||||
stop
|
stop
|
||||||
|
Loading…
Reference in New Issue
Block a user