]> git.madduck.net Git - etc/awesome.git/blobdiff - widget/imap.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge pull request #439 from gregflynn/201908_gf_customize_pulsebar_notification_char...
[etc/awesome.git] / widget / imap.lua
index 3f4d9ccfde8aa14f330f2bfbb61670b25ebab6f1..b3d9dc7d0d65965a1eea3bcb841cedefa763c2cd 100644 (file)
@@ -66,9 +66,8 @@ 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
-            helpers.set_map(mail, mailcount)
             widget = imap.widget
 
             settings()
@@ -80,6 +79,8 @@ local function factory(args)
                     text   = string.format("%s has <b>%d</b> new message%s", mail, mailcount, mailcount == 1 and "" or "s")
                 }
             end
+
+            helpers.set_map(mail, imap_now["UNSEEN"])
         end)
 
     end