Changeset

8025:8a7c4497569a

MUC: Only create rooms in a locked state when they are created by someone joining (fixes timed deletion of all rooms on startup)
author Kim Alvefur <zash@zash.se>
date Fri, 31 Mar 2017 18:52:53 +0200
parents 8024:8eec715c13a6
children 8026:f237d0155e59 8029:e859f279add4
files plugins/muc/mod_muc.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Fri Mar 31 17:50:19 2017 +0200
+++ b/plugins/muc/mod_muc.lua	Fri Mar 31 18:52:53 2017 +0200
@@ -86,12 +86,12 @@
 	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 @@
 		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