Software / code / prosody
Diff
plugins/muc/register.lib.lua @ 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 |
| parent | 12977:74b9e05af71e |
| child | 13871:9eee04a95a25 |
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);