mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +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
|
||||||
end;
|
end;
|
||||||
drop ->
|
drop ->
|
||||||
|
?DEBUG("packet dropped~n", []),
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -110,12 +110,14 @@ offline_message(From, To, Packet) ->
|
|||||||
mnesia:dirty_write(Record),
|
mnesia:dirty_write(Record),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
filter_packet({From, To, Packet}) ->
|
filter_packet({From, To, {xmlelement, "message", _, _}}) ->
|
||||||
{User, Server, _} = jlib:jid_tolower(From),
|
{User, Server, _} = jlib:jid_tolower(From),
|
||||||
case mnesia:dirty_read({autofilter, {User, Server}}) of
|
case mnesia:dirty_read({autofilter, {User, Server}}) of
|
||||||
[#autofilter{drop=true}] -> drop;
|
[#autofilter{drop=true}] -> drop
|
||||||
_ -> {From, To, Packet}
|
_ -> {From, To, Packet}
|
||||||
end.
|
end;
|
||||||
|
filter_packet(OK) ->
|
||||||
|
OK.
|
||||||
|
|
||||||
close_session(SID, JID) ->
|
close_session(SID, JID) ->
|
||||||
close_session(SID, JID, []).
|
close_session(SID, JID, []).
|
||||||
|
Loading…
Reference in New Issue
Block a user