mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-05 14:10:31 -04:00
Initial implementation of spam check
It checks during the sends if there are spam warnings then give to the message an attribute spam=true (only for receivers)
This commit is contained in:
parent
75510d2551
commit
bfe0ef2711
4 changed files with 44 additions and 0 deletions
1
api.lua
1
api.lua
|
@ -83,6 +83,7 @@ function mail.send(m)
|
|||
local entry = mail.get_storage_entry(m.from)
|
||||
table.insert(entry.outbox, 1, msg)
|
||||
mail.set_storage_entry(m.from, entry)
|
||||
msg.spam = #mail.check_spam(msg) >= 1
|
||||
|
||||
-- add in every receivers inbox
|
||||
for recipient in pairs(recipients) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue