plugins/muc/lock.lib.lua
changeset 10454 c1edeb9fe337
parent 8869 2c60ae791bdc
child 12981 74b9e05af71e
equal deleted inserted replaced
10453:2e36a54906e4 10454: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