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 | 8c2964e6a982eef1d18c61b73f83c463014b2ef8 (patch) | |
tree | a2019d86cafae1cb569aa1edf39dabeed1d572c7 /plugins/muc | |
parent | 62fc4e5a0357bb6fe99f3b3eaa84407c445ebcf3 (diff) | |
download | prosody-8c2964e6a982eef1d18c61b73f83c463014b2ef8.tar.gz prosody-8c2964e6a982eef1d18c61b73f83c463014b2ef8.zip |
MUC: Also prevent changing to an invisible nickname
Diffstat (limited to 'plugins/muc')
-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"); |