aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-11-03 21:13:34 +0100
committerKim Alvefur <zash@zash.se>2023-11-03 21:13:34 +0100
commit3a91ff2b481ed264559f8e24d191309b68f3c1ce (patch)
treee4fc80832b6faa787f56b87cf346b1c9a26ace3b
parent94f92950422de1df2da9ffa9e69420c114f26245 (diff)
downloadprosody-3a91ff2b481ed264559f8e24d191309b68f3c1ce.tar.gz
prosody-3a91ff2b481ed264559f8e24d191309b68f3c1ce.zip
muc.register: Clarify what's going on when enforcing nicknames
Does this make it clearer what is going on?
-rw-r--r--plugins/muc/register.lib.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/muc/register.lib.lua b/plugins/muc/register.lib.lua
index 24ae7153..82ccb8ea 100644
--- a/plugins/muc/register.lib.lua
+++ b/plugins/muc/register.lib.lua
@@ -94,8 +94,10 @@ local function enforce_nick_policy(event)
local nick = get_registered_nick(room, jid_bare(stanza.attr.from));
if nick then
if event.occupant then
+ -- someone is joining, force their nickname to the registered one
event.occupant.nick = jid_bare(event.occupant.nick) .. "/" .. nick;
elseif event.dest_occupant.nick ~= jid_bare(event.dest_occupant.nick) .. "/" .. nick then
+ -- someone is trying to change nickname to something other than their registered nickname, can't have that
module:log("debug", "Attempt by %s to join as %s, but their reserved nick is %s", stanza.attr.from, requested_nick, nick);
local reply = st.error_reply(stanza, "cancel", "not-acceptable", nil, room.jid):up();
origin.send(reply);