diff options
author | Kim Alvefur <zash@zash.se> | 2017-03-31 18:52:53 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-03-31 18:52:53 +0200 |
commit | 79bc05914a516cf0d005b6adff8b264be907eaa0 (patch) | |
tree | fef9783321132fbb97f62c7cec999d4511ac665c /plugins/muc/mod_muc.lua | |
parent | d2b589c2aa0df1e0c372f4f94049e20ef478c609 (diff) | |
download | prosody-79bc05914a516cf0d005b6adff8b264be907eaa0.tar.gz prosody-79bc05914a516cf0d005b6adff8b264be907eaa0.zip |
MUC: Only create rooms in a locked state when they are created by someone joining (fixes timed deletion of all rooms on startup)
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r-- | plugins/muc/mod_muc.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 90b01cc7..8c223cb2 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -86,12 +86,12 @@ local function room_save(room, forced) if forced then persistent_rooms_storage:set(nil, persistent_rooms); end end -function create_room(jid) +function create_room(jid, locked) local room = muc_new_room(jid); room.route_stanza = room_route_stanza; room.save = room_save; rooms[jid] = room; - if lock_rooms then + if locked then room.locked = true; if lock_room_timeout and lock_room_timeout > 0 then module:add_timer(lock_room_timeout, function () @@ -166,7 +166,7 @@ function stanza_handler(event) if not(restrict_room_creation) or is_admin(stanza.attr.from) or (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then - room = create_room(bare); + room = create_room(bare, lock_rooms); end end if room then |