aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2024-05-23 17:39:20 +0100
committerMatthew Wild <mwild1@gmail.com>2024-05-23 17:39:20 +0100
commitaa6b79c20c82451cd6a804d82c98d0830e792033 (patch)
tree7eb9e34a9056c912cd738b1990977015e9380a5a /plugins/muc/mod_muc.lua
parent5915d6fbcdc338efa23a79a47ca72eb42182f752 (diff)
downloadprosody-aa6b79c20c82451cd6a804d82c98d0830e792033.tar.gz
prosody-aa6b79c20c82451cd6a804d82c98d0830e792033.zip
MUC: Add per-room PM restriction functionality (thanks Wirlaburla)
Based on mod_muc_restrict_pm in prosody-modules d82c0383106a
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r--plugins/muc/mod_muc.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index b3f30eed..7244ecbe 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;
@@ -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)