From f52deec93ad9bdb5593af8dd2551719c104f4b75 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 12 Jul 2018 02:14:16 +0200 Subject: MUC: Reject invisible nicknames (fixes #979) --- plugins/muc/muc.lib.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/muc/muc.lib.lua') diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 22e3ff93..73c35274 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -401,6 +401,14 @@ module:hook("muc-occupant-pre-join", function(event) end end, -10); +module:hook("muc-occupant-pre-join", function(event) + local nick = jid_resource(event.stanza.attr.from); + if not nick:find("%S") then + event.origin.send(st.error_reply(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