comparison plugins/muc/lock.lib.lua @ 10450:c1edeb9fe337

MUC: Indicate the component as origin of various errors where there's no room A room that doesn't exist can't return an error, can it?
author Kim Alvefur <zash@zash.se>
date Tue, 26 Nov 2019 00:02:13 +0100
parents 2c60ae791bdc
children 74b9e05af71e
comparison
equal deleted inserted replaced
10449:2e36a54906e4 10450:c1edeb9fe337
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