Skip to content

Commit

Permalink
token_affiliation, fix: increase the overwrite interval
Browse files Browse the repository at this point in the history
  • Loading branch information
emrahcom committed Sep 28, 2023
1 parent 0e94b4e commit 12f251f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions token_affiliation/mod_token_affiliation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ module:hook("muc-occupant-joined", function (event)
end
end

local i = 0.0
while (i < 2.8) do
timer.add_task(i, function()
room:set_affiliation(true, occupant.bare_jid, affiliation)
end)
i = i + 0.4
local i = 0
local function setAffiliation()
room:set_affiliation(true, occupant.bare_jid, affiliation)
if i > 8 then return end

i = i + 1
timer.add_task(0.2 * i, setAffiliation)
end
setAffiliation()

module:log(LOGLEVEL, "affiliation: %s", affiliation)
end)

0 comments on commit 12f251f

Please sign in to comment.