mirror of
https://github.com/processone/ejabberd
synced 2025-10-06 12:00:15 +02:00
#148 Carbon copy sends message back to original sender solved
This commit is contained in:
parent
afba5bc5f5
commit
9ef1ad0b6e
1 changed files with 13 additions and 1 deletions
|
@ -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 ->
|
||||||
send_copies(JID, Packet, Direction);
|
%% 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);
|
||||||
|
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…
Add table
Add a link
Reference in a new issue