Mercurial > prosody-hg
comparison plugins/muc/lock.lib.lua @ 11200:bf8f2da84007
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 05 Nov 2020 22:31:25 +0100 |
| parents | c1edeb9fe337 |
| children | 74b9e05af71e |
comparison
equal
deleted
inserted
replaced
| 11199:6c7c50a4de32 | 11200:bf8f2da84007 |
|---|---|
| 41 | 41 |
| 42 -- Don't let users into room while it is locked | 42 -- Don't let users into room while it is locked |
| 43 module:hook("muc-occupant-pre-join", function(event) | 43 module:hook("muc-occupant-pre-join", function(event) |
| 44 if not event.is_new_room and is_locked(event.room) then -- Deny entry | 44 if not event.is_new_room and is_locked(event.room) then -- Deny entry |
| 45 module:log("debug", "Room is locked, denying entry"); | 45 module:log("debug", "Room is locked, denying entry"); |
| 46 event.origin.send(st.error_reply(event.stanza, "cancel", "item-not-found")); | 46 event.origin.send(st.error_reply(event.stanza, "cancel", "item-not-found", nil, module.host)); |
| 47 return true; | 47 return true; |
| 48 end | 48 end |
| 49 end, -30); | 49 end, -30); |
| 50 | 50 |
| 51 -- When config is submitted; unlock the room | 51 -- When config is submitted; unlock the room |
