Changeset

13300:b73547cfd736

muc.register: Clarify what's going on when enforcing nicknames Does this make it clearer what is going on?
author Kim Alvefur <zash@zash.se>
date Fri, 03 Nov 2023 21:13:34 +0100
parents 13299:20b7de7ab66a
children 13301:84d83f4a190f
files plugins/muc/register.lib.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/register.lib.lua	Thu Nov 02 17:35:10 2023 +0100
+++ b/plugins/muc/register.lib.lua	Fri Nov 03 21:13:34 2023 +0100
@@ -94,8 +94,10 @@
 		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);