diff options
author | Kim Alvefur <zash@zash.se> | 2018-07-12 02:14:16 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-07-12 02:14:16 +0200 |
commit | 636df213c34d261182215ad67b236c84cc59307c (patch) | |
tree | 3d92d5afb27fadaf87e4ecad228fd2e8760ec524 /plugins/muc | |
parent | 8c54955afd5aafa610cc702b5622705b3b5d5e57 (diff) | |
download | prosody-636df213c34d261182215ad67b236c84cc59307c.tar.gz prosody-636df213c34d261182215ad67b236c84cc59307c.zip |
MUC: Reject invisible nicknames (fixes #979)
Diffstat (limited to 'plugins/muc')
-rw-r--r-- | plugins/muc/muc.lib.lua | 8 |
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"); |