diff options
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r-- | plugins/muc/mod_muc.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index b3f30eed..1dc99f07 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -86,6 +86,12 @@ room_mt.get_registered_nick = register.get_registered_nick; room_mt.get_registered_jid = register.get_registered_jid; room_mt.handle_register_iq = register.handle_register_iq; +local restrict_pm = module:require "muc/restrict_pm"; +room_mt.get_allow_pm = restrict_pm.get_allow_pm; +room_mt.set_allow_pm = restrict_pm.set_allow_pm; +room_mt.get_allow_modpm = restrict_pm.get_allow_modpm; +room_mt.set_allow_modpm = restrict_pm.set_allow_modpm; + local presence_broadcast = module:require "muc/presence_broadcast"; room_mt.get_presence_broadcast = presence_broadcast.get; room_mt.set_presence_broadcast = presence_broadcast.set; @@ -119,7 +125,7 @@ module:default_permissions("prosody:guest", { ":list-rooms"; }); -if module:get_option_boolean("component_admins_as_room_owners", true) then +if module:get_option_boolean("component_admins_as_room_owners", false) then -- Monkey patch to make server admins room owners local _get_affiliation = room_mt.get_affiliation; function room_mt:get_affiliation(jid) @@ -293,6 +299,8 @@ local function set_room_defaults(room, lang) room:set_language(lang or module:get_option_string("muc_room_default_language")); room:set_presence_broadcast(module:get_option_enum("muc_room_default_presence_broadcast", room:get_presence_broadcast(), "visitor", "participant", "moderator")); + room:set_allow_pm(module:get_option_enum("muc_room_default_allow_pm", room:get_allow_pm(), "visitor", "participant", "moderator")); + room:set_allow_modpm(module:get_option_boolean("muc_room_default_always_allow_moderator_pms", room:get_allow_modpm())); end function create_room(room_jid, config) |