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 | 9f0b42786ec4519f7ed70db594277ae632aa0ee2 (patch) | |
tree | 9ec30f125e9ae1d50c18637b6a704df5aa98c078 /plugins | |
parent | e8da4ca6d9798aa7058dc617dae0ef4f13cff656 (diff) | |
download | prosody-9f0b42786ec4519f7ed70db594277ae632aa0ee2.tar.gz prosody-9f0b42786ec4519f7ed70db594277ae632aa0ee2.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(); |