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:
parent
15c27c9ddd
commit
cffe224d4a
@ -415,6 +415,7 @@ do_route(OrigFrom, OrigTo, OrigPacket) ->
|
||||
end
|
||||
end;
|
||||
drop ->
|
||||
?DEBUG("packet dropped~n", []),
|
||||
ok
|
||||
end.
|
||||
|
||||
|
@ -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, []).
|
||||
|
Loading…
Reference in New Issue
Block a user