aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-12 02:14:16 +0200
committerKim Alvefur <zash@zash.se>2018-07-12 02:14:16 +0200
commitf52deec93ad9bdb5593af8dd2551719c104f4b75 (patch)
tree3d92d5afb27fadaf87e4ecad228fd2e8760ec524 /plugins/muc/muc.lib.lua
parentd1bc4d7cb3c4a7671a54cca3d8099738f07bc1d9 (diff)
downloadprosody-f52deec93ad9bdb5593af8dd2551719c104f4b75.tar.gz
prosody-f52deec93ad9bdb5593af8dd2551719c104f4b75.zip
MUC: Reject invisible nicknames (fixes #979)
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua8
1 files changed, 8 insertions, 0 deletions
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 <x>, possibly desynced");