comparison mod_muc_defaults/mod_muc_defaults.lua @ 3623:da2d58208574

mod_muc_defaults: Allow setting of `name` and `description Also fix setting of language
author JC Brand <jc@opkode.com>
date Thu, 20 Jun 2019 10:37:48 +0200
parents 796b29911747
children d1bc50890343
comparison
equal deleted inserted replaced
3622:21f870e1ba55 3623:da2d58208574
13 end 13 end
14 14
15 15
16 local function configure_room(room, config) 16 local function configure_room(room, config)
17 local should_save = false; 17 local should_save = false;
18 if config.name ~= nil then
19 should_save = room:set_name(config.name) or should_save;
20 end
21 if config.description ~= nil then
22 should_save = room:set_description(config.description) or should_save;
23 end
18 if config.allow_member_invites ~= nil then 24 if config.allow_member_invites ~= nil then
19 should_save = 25 should_save =
20 room:set_allow_member_invites(config.allow_member_invites) 26 room:set_allow_member_invites(config.allow_member_invites)
21 or should_save; 27 or should_save;
22 end 28 end
29 should_save = 35 should_save =
30 room:set_historylength(config.history_length) 36 room:set_historylength(config.history_length)
31 or should_save; 37 or should_save;
32 end 38 end
33 if config.lang ~= nil then 39 if config.lang ~= nil then
34 should_save = room:set_language(config.language) or should_save; 40 should_save = room:set_language(config.lang) or should_save;
35 end 41 end
36 if config.members_only ~= nil then 42 if config.members_only ~= nil then
37 should_save = 43 should_save =
38 room:set_members_only(config.members_only) 44 room:set_members_only(config.members_only)
39 or should_save; 45 or should_save;