From ce9c97aa927a448ca4158104538118c350114b22 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Fri, 13 Jun 2014 09:44:36 +0200 Subject: [PATCH] #52 fix + multiple imap widgets feature added --- widgets/base.lua | 4 ++-- widgets/imap.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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 }) -- 2.39.5