aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-10-01 22:11:34 +0200
committerKim Alvefur <zash@zash.se>2016-10-01 22:11:34 +0200
commit671a9aadde198731c1dc951d1c2d63ce873705a1 (patch)
treedffef8a3b671facf69c1deafe216c058864aa910 /plugins/muc/muc.lib.lua
parentbe6fbf67163f3480b417d9c0f0ac845115667ffa (diff)
downloadprosody-671a9aadde198731c1dc951d1c2d63ce873705a1.tar.gz
prosody-671a9aadde198731c1dc951d1c2d63ce873705a1.zip
MUC: Fix logic of nickname override detection (thanks mimi89999)
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index aea6848c..3280f444 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -491,7 +491,7 @@ function room_mt:handle_normal_presence(origin, stanza)
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 @@ function room_mt:handle_normal_presence(origin, stanza)
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