X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/d9d5a464cb032c99085e7f8fa60c11612db7bef1..233768f0963167af1d2621d10157cd64a87c904c:/widget/imap.lua diff --git a/widget/imap.lua b/widget/imap.lua index 75270f1..b3d9dc7 100644 --- a/widget/imap.lua +++ b/widget/imap.lua @@ -66,7 +66,7 @@ local function factory(args) helpers.async(curl, function(f) imap_now = { ["MESSAGES"] = 0, ["RECENT"] = 0, ["UNSEEN"] = 0 } - for s, d in f:gmatch("(%w+)%s+(%d+)") do imap_now[s] = tonumber(d) end + for s,d in f:gmatch("(%w+)%s+(%d+)") do imap_now[s] = tonumber(d) end mailcount = imap_now["UNSEEN"] -- backwards compatibility widget = imap.widget @@ -79,7 +79,8 @@ local function factory(args) text = string.format("%s has %d new message%s", mail, mailcount, mailcount == 1 and "" or "s") } end - helpers.set_map(mail, mailcount) + + helpers.set_map(mail, imap_now["UNSEEN"]) end) end