25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

log and drop messages only from autofilter

This commit is contained in:
Christophe Romain 2011-01-03 15:26:44 +01:00
parent 15c27c9ddd
commit cffe224d4a
2 changed files with 6 additions and 3 deletions

View File

@ -415,6 +415,7 @@ do_route(OrigFrom, OrigTo, OrigPacket) ->
end
end;
drop ->
?DEBUG("packet dropped~n", []),
ok
end.

View File

@ -110,12 +110,14 @@ offline_message(From, To, Packet) ->
mnesia:dirty_write(Record),
ok.
filter_packet({From, To, Packet}) ->
filter_packet({From, To, {xmlelement, "message", _, _}}) ->
{User, Server, _} = jlib:jid_tolower(From),
case mnesia:dirty_read({autofilter, {User, Server}}) of
[#autofilter{drop=true}] -> drop;
[#autofilter{drop=true}] -> drop
_ -> {From, To, Packet}
end.
end;
filter_packet(OK) ->
OK.
close_session(SID, JID) ->
close_session(SID, JID, []).