diff options
author | Kim Alvefur <zash@zash.se> | 2017-10-21 21:24:07 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-10-21 21:24:07 +0200 |
commit | 8fe7d171889ab3a965e8dcddfb0e96ac379939c5 (patch) | |
tree | 9ec30f125e9ae1d50c18637b6a704df5aa98c078 /plugins | |
parent | 7c0452299662f7d5a9721a82eb480ec4b109b448 (diff) | |
download | prosody-8fe7d171889ab3a965e8dcddfb0e96ac379939c5.tar.gz prosody-8fe7d171889ab3a965e8dcddfb0e96ac379939c5.zip |
MUC: Split out the nickname from the full room JID in voice request from
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/muc/moderated.lib.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/muc/moderated.lib.lua b/plugins/muc/moderated.lib.lua index c6ccc771..7f086555 100644 --- a/plugins/muc/moderated.lib.lua +++ b/plugins/muc/moderated.lib.lua @@ -8,6 +8,7 @@ -- local st = require "util.stanza"; +local jid_resource = require "util.jid".resource; local function get_moderated(room) return room._data.moderated; @@ -50,9 +51,10 @@ end, 1); module:hook("muc-voice-request", function(event) if event.occupant.role == "visitor" then local form = event.room:get_voice_form_layout() + local nick = jid_resource(event.occupant.nick); local formdata = { ["muc#jid"] = event.stanza.attr.from; - ["muc#roomnick"] = event.occupant.nick; + ["muc#roomnick"] = nick; }; local message = st.message({ type = "normal"; from = event.room.jid }):add_child(form:form(formdata)):up(); |