plugins/muc/password.lib.lua
changeset 12031 5fb16f41f861
parent 10451 b5fd1637f15c
child 12033 631b2afa7bc1
equal deleted inserted replaced
12030:f3b09b8445b3 12031:5fb16f41f861
    49 	if not password or password == "" then password = nil; end
    49 	if not password or password == "" then password = nil; end
    50 	if get_password(room) ~= password then
    50 	if get_password(room) ~= password then
    51 		local from, to = stanza.attr.from, stanza.attr.to;
    51 		local from, to = stanza.attr.from, stanza.attr.to;
    52 		module:log("debug", "%s couldn't join due to invalid password: %s", from, to);
    52 		module:log("debug", "%s couldn't join due to invalid password: %s", from, to);
    53 		local reply = st.error_reply(stanza, "auth", "not-authorized", nil, room.jid):up();
    53 		local reply = st.error_reply(stanza, "auth", "not-authorized", nil, room.jid):up();
    54 		reply.tags[1].attr.code = "401";
       
    55 		event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
    54 		event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
    56 		return true;
    55 		return true;
    57 	end
    56 	end
    58 end, -20);
    57 end, -20);
    59 
    58