mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-04 21:50:28 -04:00
Add insertion of messages into global storage mail.messages.json
This commit is contained in:
parent
17b5f94fed
commit
0d69f0242b
4 changed files with 36 additions and 15 deletions
10
api.lua
10
api.lua
|
@ -93,13 +93,9 @@ function mail.send(...)
|
|||
body = m.body,
|
||||
time = os.time(),
|
||||
}
|
||||
|
||||
-- send the mail to all recipients
|
||||
for recipient in pairs(recipients) do
|
||||
local messages = mail.getMessages(recipient)
|
||||
table.insert(messages, 1, msg)
|
||||
mail.setMessages(recipient, messages)
|
||||
end
|
||||
|
||||
-- insert in global storage
|
||||
mail.addMessage(msg)
|
||||
|
||||
-- notify recipients that happen to be online
|
||||
local mail_alert = f(mail.receive_mail_message, m.from, m.subject)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue