Skip to content

Commit

Permalink
refactor(matrix_affiliation): add a config parameter to allow disabli…
Browse files Browse the repository at this point in the history
…ng the cascading updates
  • Loading branch information
emrahcom committed Oct 16, 2024
1 parent 6b9c756 commit af6cedf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions auth_hybrid_matrix_token/mod_matrix_affiliation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ local jid_split = require "util.jid".split
local timer = require "util.timer"
local LOGLEVEL = "debug"

-- Set this parameter in Prosody config if you dont want cascading updates for
-- affiliation. Cascading updates are needed when the authentication is enabled
-- in Jicofo.
local DISABLE_CASCADING_SET = module:get_option_boolean(
"disable_cascading_set", false
)

local function _is_admin(jid)
return is_admin(jid, module.host)
end
Expand Down Expand Up @@ -65,6 +72,8 @@ module:hook("muc-occupant-joined", function (event)
local i = 0
local function setAffiliation()
room:set_affiliation(true, occupant.bare_jid, "member")

if DISABLE_CASCADING_SET then return end
if i > 8 then return end

i = i + 1
Expand Down

0 comments on commit af6cedf

Please sign in to comment.