MUC: Move the locked flag into persisted data (so not to lose it on eviction)
authorKim Alvefur <zash@zash.se>
Thu, 28 Apr 2016 21:14:09 +0000 (23:14 +0200)
committerKim Alvefur <zash@zash.se>
Thu, 28 Apr 2016 21:14:09 +0000 (23:14 +0200)
plugins/muc/lock.lib.lua

index 82f0dc3f94c0143aa462944799f1d71d28ec97c6..e316c57c94789594845da72c44d928680451e121 100644 (file)
@@ -14,14 +14,14 @@ local lock_room_timeout = module:get_option_number("muc_room_lock_timeout", 300)
 
 local function lock(room)
        module:fire_event("muc-room-locked", {room = room;});
-       room.locked = true;
+       room._data.locked = true;
 end
 local function unlock(room)
        module:fire_event("muc-room-unlocked", {room = room;});
-       room.locked = nil;
+       room._data.locked = nil;
 end
 local function is_locked(room)
-       return not not room.locked;
+       return not not room._data.locked;
 end
 
 if lock_rooms then