# HG changeset patch # User Kim Alvefur # Date 1475352694 -7200 # Node ID 96c6c25a51e1de22f2e4a0bbbfb7944e5878d814 # Parent 5523880760b354d1cfc28f73d71b24c57bbb3f4c MUC: Fix logic of nickname override detection (thanks mimi89999) diff -r 5523880760b3 -r 96c6c25a51e1 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Thu Sep 29 22:04:59 2016 +0200 +++ b/plugins/muc/muc.lib.lua Sat Oct 01 22:11:34 2016 +0200 @@ -491,7 +491,7 @@ is_first_session = is_first_dest_session; is_last_session = is_last_orig_session; }; - local orig_nick = dest_occupant and dest_occupant.jid; + local orig_nick = dest_occupant and dest_occupant.nick; if orig_occupant == nil then event_name = "muc-occupant-pre-join"; event.occupant = dest_occupant; @@ -504,7 +504,7 @@ event.dest_occupant = dest_occupant; end if module:fire_event(event_name, event) then return true; end - local nick_overridden = dest_occupant and orig_nick ~= dest_occupant.nick; + local nick_overridden = orig_nick and orig_nick ~= dest_occupant.nick; -- Check for nick conflicts 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