plugins/muc/muc.lib.lua
changeset 7961 47cb54a08336
parent 7709 d92e186c2a1c
child 8172 a6574fdf8734
equal deleted inserted replaced
7960:083c062c2fb7 7961:47cb54a08336
   515 	if module:fire_event(event_name, event) then return true; end
   515 	if module:fire_event(event_name, event) then return true; end
   516 
   516 
   517 	local nick_changed = dest_occupant and orig_nick ~= dest_occupant.nick;
   517 	local nick_changed = dest_occupant and orig_nick ~= dest_occupant.nick;
   518 
   518 
   519 	-- Check for nick conflicts
   519 	-- Check for nick conflicts
   520 	if dest_occupant ~= nil and not is_first_dest_session and bare_jid ~= jid_bare(dest_occupant.bare_jid) then -- new nick or has different bare real jid
   520 	if dest_occupant ~= nil and not is_first_dest_session
       
   521 		and bare_jid ~= jid_bare(dest_occupant.bare_jid) then
       
   522 		-- new nick or has different bare real jid
   521 		log("debug", "%s couldn't join due to nick conflict: %s", real_jid, dest_occupant.nick);
   523 		log("debug", "%s couldn't join due to nick conflict: %s", real_jid, dest_occupant.nick);
   522 		local reply = st.error_reply(stanza, "cancel", "conflict"):up();
   524 		local reply = st.error_reply(stanza, "cancel", "conflict"):up();
   523 		reply.tags[1].attr.code = "409";
   525 		reply.tags[1].attr.code = "409";
   524 		origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
   526 		origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
   525 		return true;
   527 		return true;