From 8c2964e6a982eef1d18c61b73f83c463014b2ef8 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 12 Jul 2018 02:18:46 +0200 Subject: MUC: Also prevent changing to an invisible nickname --- plugins/muc/muc.lib.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins') diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 3ec69923..7f7de4fd 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -409,6 +409,13 @@ module:hook("muc-occupant-pre-join", function(event) 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"); -- cgit v1.2.3