]> 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:

tp_smapi: correct default apipath
[etc/awesome.git] / widget / imap.lua
index 75270f1d3d1780b42f194d2f221dd52f20139195..b3d9dc7d0d65965a1eea3bcb841cedefa763c2cd 100644 (file)
@@ -66,7 +66,7 @@ local function factory(args)
         helpers.async(curl, function(f)
             imap_now = { ["MESSAGES"] = 0, ["RECENT"] = 0, ["UNSEEN"] = 0 }
 
         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
 
             mailcount = imap_now["UNSEEN"] -- backwards compatibility
             widget = imap.widget
 
@@ -79,7 +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
                     text   = string.format("%s has <b>%d</b> 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
         end)
 
     end