Comparison

plugins/muc/mod_muc.lua @ 6129:6c66571ab0f9

plugins/muc: Have utility methods for locking the room
author daurnimator <quae@daurnimator.com>
date Thu, 20 Mar 2014 11:06:10 -0400
parent 6111:f8b94903be52
child 6141:bf6de8ef66c2
comparison
equal deleted inserted replaced
6128:8a71a1c34202 6129:6c66571ab0f9
89 function create_room(jid) 89 function create_room(jid)
90 local room = muc_new_room(jid); 90 local room = muc_new_room(jid);
91 room.save = room_save; 91 room.save = room_save;
92 rooms[jid] = room; 92 rooms[jid] = room;
93 if lock_rooms then 93 if lock_rooms then
94 room.locked = true; 94 room:lock();
95 if lock_room_timeout and lock_room_timeout > 0 then 95 if lock_room_timeout and lock_room_timeout > 0 then
96 module:add_timer(lock_room_timeout, function () 96 module:add_timer(lock_room_timeout, function ()
97 if room.locked then 97 if room:is_locked() then
98 room:destroy(); -- Not unlocked in time 98 room:destroy(); -- Not unlocked in time
99 end 99 end
100 end); 100 end);
101 end 101 end
102 end 102 end