imap: password can now be a string, a table or a function to execute

This commit is contained in:
copycat-killer 2017-01-25 21:06:20 +01:00
parent 58b2a122dd
commit bf3a9ba5ef
3 changed files with 10 additions and 5 deletions

View File

@ -177,10 +177,10 @@ function helpers.spairs(t)
end end
end end
-- create a textbox with no spacing issues -- create a lain textbox
function helpers.make_widget_textbox() function helpers.make_widget_textbox()
local w = wibox.widget.textbox() local w = { widget = wibox.widget.textbox() }
return setmetatable({ widget = w }, { __index = w }) return setmetatable(w, { __index = w.widget })
end end
-- }}} -- }}}

View File

@ -11,6 +11,7 @@ local naughty = require("naughty")
local wibox = require("wibox") local wibox = require("wibox")
local string = { format = string.format, local string = { format = string.format,
gsub = string.gsub } gsub = string.gsub }
local type = type
local tonumber = tonumber local tonumber = tonumber
local setmetatable = setmetatable local setmetatable = setmetatable
@ -37,7 +38,11 @@ local function worker(args)
helpers.set_map(mail, 0) helpers.set_map(mail, 0)
if not is_plain then if not is_plain then
if type(password) == "string" or type(password) == "table" then
helpers.async(password, function(f) password = f:gsub("\n", "") end) helpers.async(password, function(f) password = f:gsub("\n", "") end)
elseif type(password) == "function" then
local p = password()
end
end end
function update() function update()

2
wiki

@ -1 +1 @@
Subproject commit f086b95e51c31b6fc1fda4591aa8eaf587cc064f Subproject commit 0af22b80f8dda896a0c8fefd5c7e52413294967d