From 055622942966a557eafe4d9ab4c2a403136f89f0 Mon Sep 17 00:00:00 2001 From: Athozus Date: Sun, 2 Apr 2023 09:59:15 +0200 Subject: [PATCH] Fix luacheck --- migrate.lua | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/migrate.lua b/migrate.lua index 1ebb26b..0266e63 100644 --- a/migrate.lua +++ b/migrate.lua @@ -62,21 +62,15 @@ local function migrate_v2_to_v3() local player_inbox = read_json_file(maildir .. "/" .. saneplayername .. ".json") print("[mail,v2] + migrating player '" .. playername .. "'") for _, msg in ipairs(player_inbox) do - local reading_status = false - if msg.unread then - reading_status = false - else - reading_status = true - end table.insert(entry.inbox, { - id = mail.new_uuid(), - from = msg.sender or msg.from, - to = msg.to or playername, - cc = msg.cc, - subject = msg.subject, - body = msg.body, - time = msg.time or os.time(), - read = reading_status, + id = mail.new_uuid(), + from = msg.sender or msg.from, + to = msg.to or playername, + cc = msg.cc, + subject = msg.subject, + body = msg.body, + time = msg.time or os.time(), + read = not msg.unread, }) end