Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 10353:7b602e13c3b6
MUC: Add controls for whose presence is broadcast (closes #1335)
Committed by Zash
author | Lance Stout <lancestout@gmail.com> |
---|---|
date | Sun, 20 Oct 2019 21:58:16 +0200 |
parent | 9647:0f43b901c854 |
child | 10366:5611c939743a |
comparison
equal
deleted
inserted
replaced
10352:dc1e6c2fb50a | 10353:7b602e13c3b6 |
---|---|
83 | 83 |
84 local register = module:require "muc/register"; | 84 local register = module:require "muc/register"; |
85 room_mt.get_registered_nick = register.get_registered_nick; | 85 room_mt.get_registered_nick = register.get_registered_nick; |
86 room_mt.get_registered_jid = register.get_registered_jid; | 86 room_mt.get_registered_jid = register.get_registered_jid; |
87 room_mt.handle_register_iq = register.handle_register_iq; | 87 room_mt.handle_register_iq = register.handle_register_iq; |
88 | |
89 local presence_broadcast = module:require "muc/presence_broadcast"; | |
90 room_mt.get_presence_broadcast = presence_broadcast.get; | |
91 room_mt.set_presence_broadcast = presence_broadcast.set; | |
92 room_mt.get_valid_broadcast_roles = presence_broadcast.get_valid_broadcast_roles; | |
93 | |
88 | 94 |
89 local jid_split = require "util.jid".split; | 95 local jid_split = require "util.jid".split; |
90 local jid_bare = require "util.jid".bare; | 96 local jid_bare = require "util.jid".bare; |
91 local st = require "util.stanza"; | 97 local st = require "util.stanza"; |
92 local cache = require "util.cache"; | 98 local cache = require "util.cache"; |
261 room:set_whois(module:get_option_boolean("muc_room_default_public_jids", | 267 room:set_whois(module:get_option_boolean("muc_room_default_public_jids", |
262 room:get_whois() == "anyone") and "anyone" or "moderators"); | 268 room:get_whois() == "anyone") and "anyone" or "moderators"); |
263 room:set_changesubject(module:get_option_boolean("muc_room_default_change_subject", room:get_changesubject())); | 269 room:set_changesubject(module:get_option_boolean("muc_room_default_change_subject", room:get_changesubject())); |
264 room:set_historylength(module:get_option_number("muc_room_default_history_length", room:get_historylength())); | 270 room:set_historylength(module:get_option_number("muc_room_default_history_length", room:get_historylength())); |
265 room:set_language(lang or module:get_option_string("muc_room_default_language")); | 271 room:set_language(lang or module:get_option_string("muc_room_default_language")); |
272 room:set_presence_broadcast(module:get_option("muc_room_default_presence_broadcast", room:get_presence_broadcast())); | |
266 end | 273 end |
267 | 274 |
268 function create_room(room_jid, config) | 275 function create_room(room_jid, config) |
269 local exists = get_room_from_jid(room_jid); | 276 local exists = get_room_from_jid(room_jid); |
270 if exists then | 277 if exists then |