#52 fix + multiple imap widgets feature added

This commit is contained in:
luke bonham 2014-06-13 09:44:36 +02:00 committed by copycat-killer
parent 7ce6653828
commit ce9c97aa92
2 changed files with 5 additions and 5 deletions

View File

@ -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 })

View File

@ -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 })