Notify player of old but unread messages.

This commit is contained in:
Auke Kok 2019-08-25 22:32:37 -07:00
parent 0956803e46
commit b800889b7b

View File

@ -324,9 +324,16 @@ minetest.register_on_joinplayer(function(player)
telex.deliver(msgid)
end
if #nos > 0 then
--FIXME minetest.after()
minetest.chat_send_player(name, "You have " .. #nos .. " new message(s), use a terminal to read your messages");
-- notify if there wasn't anything new but the player still had some unread
if #old == 0 then
-- 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)