Notify player of old but unread messages.
This commit is contained in:
parent
0956803e46
commit
b800889b7b
@ -324,9 +324,16 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
telex.deliver(msgid)
|
telex.deliver(msgid)
|
||||||
end
|
end
|
||||||
|
|
||||||
if #nos > 0 then
|
-- notify if there wasn't anything new but the player still had some unread
|
||||||
--FIXME minetest.after()
|
if #old == 0 then
|
||||||
minetest.chat_send_player(name, "You have " .. #nos .. " new message(s), use a terminal to read your messages");
|
-- reuse `mbox`
|
||||||
|
for _, msgid in pairs(mbox) do
|
||||||
|
local msg = telex.get_msg(msgid)
|
||||||
|
if not msg.read then
|
||||||
|
minetest.chat_send_player(name, "You have unread messages")
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user