# HG changeset patch # User Kim Alvefur # Date 1531354726 -7200 # Node ID 4028eb4a9f7f5ed38cb9f7d17e8b4b467e650bff # Parent 91b5a56670168e91f6f7fea66d623eac23a0c0e2 MUC: Also prevent changing to an invisible nickname diff -r 91b5a5667016 -r 4028eb4a9f7f plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Thu Jul 12 02:31:47 2018 +0200 +++ b/plugins/muc/muc.lib.lua Thu Jul 12 02:18:46 2018 +0200 @@ -409,6 +409,13 @@ end end, 1); +module:hook("muc-occupant-pre-change", function(event) + if not jid_resource(event.dest_occupant.nick):find("%S") then + event.origin.send(st.error_reply(event.stanza, "modify", "not-allowed", "Invisible Nicknames are forbidden")); + return true; + end +end, 1); + function room_mt:handle_first_presence(origin, stanza) if not stanza:get_child("x", "http://jabber.org/protocol/muc") then module:log("debug", "Room creation without , possibly desynced");