From: luke bonham Date: Fri, 13 Jun 2014 07:44:36 +0000 (+0200) Subject: #52 fix + multiple imap widgets feature added X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/ce9c97aa927a448ca4158104538118c350114b22?ds=sidebyside #52 fix + multiple imap widgets feature added --- diff --git a/widgets/base.lua b/widgets/base.lua index 3d4ce9e..4f28e07 100644 --- a/widgets/base.lua +++ b/widgets/base.lua @@ -14,9 +14,9 @@ local setmetatable = setmetatable -- Basic template for custom widgets -- lain.widgets.base -local base = {} local function worker(args) + local base = {} local args = args or {} local timeout = args.timeout or 5 local cmd = args.cmd or "" @@ -37,4 +37,4 @@ local function worker(args) return setmetatable(base, { __index = base.widget }) end -return setmetatable(base, { __call = function(_, ...) return worker(...) end }) +return setmetatable({}, { __call = function(_, ...) return worker(...) end }) diff --git a/widgets/imap.lua b/widgets/imap.lua index febff23..6104388 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -20,9 +20,9 @@ local setmetatable = setmetatable -- Mail IMAP check -- lain.widgets.imap -local imap = {} local function worker(args) + local imap = {} local args = args or {} local server = args.server @@ -81,7 +81,7 @@ local function worker(args) end helpers.newtimer(mail, timeout, update, true) - return imap.widget + return setmetatable(imap, { __index = imap.widget }) end -return setmetatable(imap, { __call = function(_, ...) return worker(...) end }) +return setmetatable({}, { __call = function(_, ...) return worker(...) end })