aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2019-10-20 21:58:16 +0200
committerLance Stout <lancestout@gmail.com>2019-10-20 21:58:16 +0200
commit190c1e7772fe11c353ce0c0e001490e29734a63a (patch)
tree5969220742b0ca10b2b71b5a3c95d177f7b9f895 /plugins/muc/mod_muc.lua
parent9889cb8bb4c614939a4a82624b0e7e3539b80b63 (diff)
downloadprosody-190c1e7772fe11c353ce0c0e001490e29734a63a.tar.gz
prosody-190c1e7772fe11c353ce0c0e001490e29734a63a.zip
MUC: Add controls for whose presence is broadcast (closes #1335)
Committed by Zash
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r--plugins/muc/mod_muc.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 89e67744..e55bd6a2 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 presence_broadcast = module:require "muc/presence_broadcast";
+room_mt.get_presence_broadcast = presence_broadcast.get;
+room_mt.set_presence_broadcast = presence_broadcast.set;
+room_mt.get_valid_broadcast_roles = presence_broadcast.get_valid_broadcast_roles;
+
+
local jid_split = require "util.jid".split;
local jid_bare = require "util.jid".bare;
local st = require "util.stanza";
@@ -263,6 +269,7 @@ local function set_room_defaults(room, lang)
room:set_changesubject(module:get_option_boolean("muc_room_default_change_subject", room:get_changesubject()));
room:set_historylength(module:get_option_number("muc_room_default_history_length", room:get_historylength()));
room:set_language(lang or module:get_option_string("muc_room_default_language"));
+ room:set_presence_broadcast(module:get_option("muc_room_default_presence_broadcast", room:get_presence_broadcast()));
end
function create_room(room_jid, config)