Software /
code /
prosody
Comparison
plugins/muc/lock.lib.lua @ 8566:8ea66e42a27b
MUC/lock: Fix locking timeout to account for the direction of time
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 07 Mar 2018 19:18:35 +0100 |
parent | 8565:301e5b82b4d8 |
child | 8866:2c60ae791bdc |
comparison
equal
deleted
inserted
replaced
8565:301e5b82b4d8 | 8566:8ea66e42a27b |
---|---|
21 room._data.locked = nil; | 21 room._data.locked = nil; |
22 end | 22 end |
23 local function is_locked(room) | 23 local function is_locked(room) |
24 local ts = room._data.locked; | 24 local ts = room._data.locked; |
25 if ts then | 25 if ts then |
26 if ts < os.time() then return true; end | 26 if os.time() < ts then return true; end |
27 unlock(room); | 27 unlock(room); |
28 end | 28 end |
29 return false; | 29 return false; |
30 end | 30 end |
31 | 31 |