mirror of https://github.com/lcpz/lain.git
#52 fix + multiple imap widgets feature added
This commit is contained in:
parent
7ce6653828
commit
ce9c97aa92
|
@ -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 })
|
||||
|
|
|
@ -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 })
|
||||
|
|
Loading…
Reference in New Issue