comparison mod_muc_restrict_attention/mod_muc_restrict_attention.lua @ 6518:b66c93276534

mod_muc_restrict_attention: Fix missing global
author Menel <menel@snikket.de>
date Thu, 16 Apr 2026 12:19:48 +0200
parents 3d14a407307d
children
comparison
equal deleted inserted replaced
6517:3d14a407307d 6518:b66c93276534
1 module:depends"muc" 1 module:depends"muc"
2 2
3 local from_affiliation 3 local from_affiliation
4 local from_jid 4 local from_jid
5 local room_jid 5 local room_jid
6 local restrict_members_by_default = true
7 local restrict_participants_by_default = true
6 local loglevel = module:get_option_enum("muc_restrict_attention_loglevel", "debug", "info", "warn", "error") 8 local loglevel = module:get_option_enum("muc_restrict_attention_loglevel", "debug", "info", "warn", "error")
7 local restrict_by_default = module:get_option_enum("muc_restrict_attention_by_default", "members", "participants", false, "false") 9 local restrict_by_default = module:get_option_enum("muc_restrict_attention_by_default", "members", "participants", false, "false")
8 10
9 -- ugly hack, improve it when you do for the room config option too 11 -- ugly hack, improve it when you do for the room config option too
10 if restrict_by_default == "members" then 12 if restrict_by_default == "members" then
11 local restrict_members_by_default = true 13 restrict_members_by_default = true
12 local restrict_participants_by_default = true 14 restrict_participants_by_default = true
13 elseif restrict_by_default == false 15 elseif restrict_by_default == false
14 or restrict_by_default == "false" then 16 or restrict_by_default == "false" then
15 local restrict_members_by_default = false 17 restrict_members_by_default = false
16 local restrict_participants_by_default = false 18 restrict_participants_by_default = false
17 elseif restrict_by_default == "participants" then 19 elseif restrict_by_default == "participants" then
18 local restrict_members_by_default = false 20 restrict_members_by_default = false
19 local restrict_participants_by_default = true 21 restrict_participants_by_default = true
20 end 22 end
21 23
22 local function should_restrict_members(room) 24 local function should_restrict_members(room)
23 local restrict_members = room._data.restrict_members 25 local restrict_members = room._data.restrict_members
24 if restrict_members == nil then 26 if restrict_members == nil then