degesch: get rid of Lua timer hooks
Since they were the exception and have been replaced with the async API.
This commit is contained in:
@@ -32,6 +32,7 @@ degesch.setup_config {
|
||||
},
|
||||
}
|
||||
|
||||
async, await = degesch.async, coroutine.yield
|
||||
degesch.hook_irc (function (hook, server, line)
|
||||
local msg = degesch.parse (line)
|
||||
if msg.command ~= "KICK" then return line end
|
||||
@@ -39,9 +40,10 @@ degesch.hook_irc (function (hook, server, line)
|
||||
local who = msg.prefix:match ("^[^!]*")
|
||||
local channel, whom = table.unpack (msg.params)
|
||||
if who ~= whom and whom == server.user.nickname then
|
||||
degesch.hook_timer (function (hook)
|
||||
async.go (function ()
|
||||
await (async.timer_ms (timeout * 1000))
|
||||
server:send ("JOIN " .. channel)
|
||||
end, timeout * 1000)
|
||||
end)
|
||||
end
|
||||
return line
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user