Add some logging to the telex mod.
This commit is contained in:
parent
72818051e4
commit
89e86ba692
@ -137,12 +137,14 @@ function telex.deliver(message)
|
|||||||
pmeta:set_string("telex_mbox", telex.encode(mbox))
|
pmeta:set_string("telex_mbox", telex.encode(mbox))
|
||||||
minetest.chat_send_player(message.to, "You have a new message from <" ..
|
minetest.chat_send_player(message.to, "You have a new message from <" ..
|
||||||
message.from .. ">, use a terminal to read your messages");
|
message.from .. ">, use a terminal to read your messages");
|
||||||
|
minetest.log("action", "delivered a message from <" .. message.from .. "> back to <" .. message.to .. ">")
|
||||||
else
|
else
|
||||||
-- append to spool
|
-- append to spool
|
||||||
message.age = 3 * 86400 -- 3 days max in spool
|
message.age = 3 * 86400 -- 3 days max in spool
|
||||||
local spool = telex.decode(S:get_string("telex_spool"))
|
local spool = telex.decode(S:get_string("telex_spool"))
|
||||||
table.insert(spool, message)
|
table.insert(spool, message)
|
||||||
S:set_string("telex_spool", telex.encode(spool))
|
S:set_string("telex_spool", telex.encode(spool))
|
||||||
|
minetest.log("action", "spooled a message from <" .. message.from .. "> back to <" .. message.to .. ">")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -150,6 +152,7 @@ end
|
|||||||
function telex.retour(message)
|
function telex.retour(message)
|
||||||
if message.from == "MAILER-DEAMON" then
|
if message.from == "MAILER-DEAMON" then
|
||||||
-- discard, we tried hard enough!
|
-- discard, we tried hard enough!
|
||||||
|
minetest.log("action", "discarded an expired spool message from <" .. message.from .. "> back to <" .. message.to .. ">")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -162,6 +165,7 @@ function telex.retour(message)
|
|||||||
table.insert(message.content, 1, "Your message to <" .. to .. "> was unable to be delivered.")
|
table.insert(message.content, 1, "Your message to <" .. to .. "> was unable to be delivered.")
|
||||||
table.insert(message.content, 2, "================== ORIGINAL MESSAGE BELOW ================")
|
table.insert(message.content, 2, "================== ORIGINAL MESSAGE BELOW ================")
|
||||||
telex.deliver(message)
|
telex.deliver(message)
|
||||||
|
minetest.log("action", "returned a message from <" .. from .. "> back to <" .. to .. ">")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- returns message/mbox
|
-- returns message/mbox
|
||||||
|
@ -55,17 +55,17 @@ term.help = {
|
|||||||
unlock = "unlocks the terminal",
|
unlock = "unlocks the terminal",
|
||||||
write = "write text to a file",
|
write = "write text to a file",
|
||||||
edit = "edits a file in an editor",
|
edit = "edits a file in an editor",
|
||||||
telex = "run the telex command"
|
telex = "run the telex command - send and receive messages"
|
||||||
}
|
}
|
||||||
|
|
||||||
term.telex_help = {
|
term.telex_help = {
|
||||||
help = "display help information for subcommands",
|
help = "display help information for subcommands",
|
||||||
list = "list received telex messages",
|
list = "list received telex messages",
|
||||||
draft = "create a new telex message",
|
draft = "create a new, or edit an outgoing telex message",
|
||||||
discard = "discard the current telex draft message",
|
discard = "discard the current telex draft message",
|
||||||
send = "send the current draft telex message",
|
send = "send the current draft telex message to a recipient",
|
||||||
remove = "remove a telex message by number",
|
remove = "remove a received telex message by number",
|
||||||
read = "read a telex message by number"
|
read = "read a received telex message by number"
|
||||||
}
|
}
|
||||||
|
|
||||||
local function make_formspec(output, prompt)
|
local function make_formspec(output, prompt)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user