mirror of
https://github.com/mt-mods/mail.git
synced 2025-04-30 08:21:44 -04:00
Use get_keys() to iterate through entries
Else it can't be ran with mtt
This commit is contained in:
parent
1c57939c79
commit
018e414b49
1 changed files with 6 additions and 1 deletions
|
@ -2,7 +2,11 @@
|
|||
local random = math.random
|
||||
|
||||
local function is_uuid_unexisting(uuid)
|
||||
for p, _ in minetest.get_auth_handler().iterate() do
|
||||
for _, k in ipairs(mail.storage:get_keys()) do
|
||||
if string.sub(k,1,5) ~= "mail/" then
|
||||
goto continue
|
||||
end
|
||||
local p = string.sub(k, 6)
|
||||
local e = mail.get_storage_entry(p)
|
||||
for _, m in ipairs(e.inbox) do
|
||||
if m.id == uuid then return false end
|
||||
|
@ -16,6 +20,7 @@ local function is_uuid_unexisting(uuid)
|
|||
for _, m in ipairs(e.trash) do
|
||||
if m.id == uuid then return false end
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue