diff options
author | Kim Alvefur <zash@zash.se> | 2018-07-12 02:18:46 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-07-12 02:18:46 +0200 |
commit | 0e28ada21955d5be3534baf1e0fdbf6e0f999e49 (patch) | |
tree | a2019d86cafae1cb569aa1edf39dabeed1d572c7 /plugins/muc/muc.lib.lua | |
parent | 00706036b1e782e81ffe47b4f8d06ea1bb425294 (diff) | |
download | prosody-0e28ada21955d5be3534baf1e0fdbf6e0f999e49.tar.gz prosody-0e28ada21955d5be3534baf1e0fdbf6e0f999e49.zip |
MUC: Also prevent changing to an invisible nickname
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 7 |
1 files changed, 7 insertions, 0 deletions
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 <x>, possibly desynced"); |