Comparison

mod_muc_http_defaults/mod_muc_http_defaults.lua @ 4450:5f27bda5de80

mod_muc_http_defaults: Fix resetting affiliations (it's plural)
author Kim Alvefur <zash@zash.se>
date Fri, 19 Feb 2021 20:42:48 +0100
parent 4449:c25eef56e9c9
child 4455:89e54247ade6
comparison
equal deleted inserted replaced
4449:c25eef56e9c9 4450:5f27bda5de80
34 local affiliations = settings.affiliations; 34 local affiliations = settings.affiliations;
35 if type(affiliations) == "table" then 35 if type(affiliations) == "table" then
36 36
37 -- COMPAT the room creator is unconditionally made 'owner' 37 -- COMPAT the room creator is unconditionally made 'owner'
38 -- clear existing affiliation 38 -- clear existing affiliation
39 for existing_affiliation in pairs(room._affiliation) do 39 for existing_affiliation in pairs(room._affiliations) do
40 room:set_affiliation(true, existing_affiliation, "none"); 40 room:set_affiliation(true, existing_affiliation, "none");
41 end 41 end
42 42
43 if affiliations[1] ~= nil then -- array of ( jid, affiliation, nick ) 43 if affiliations[1] ~= nil then -- array of ( jid, affiliation, nick )
44 for _, aff in ipairs(affiliations) do 44 for _, aff in ipairs(affiliations) do