aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-21 21:24:07 +0200
committerKim Alvefur <zash@zash.se>2017-10-21 21:24:07 +0200
commit9f0b42786ec4519f7ed70db594277ae632aa0ee2 (patch)
tree9ec30f125e9ae1d50c18637b6a704df5aa98c078
parente8da4ca6d9798aa7058dc617dae0ef4f13cff656 (diff)
downloadprosody-9f0b42786ec4519f7ed70db594277ae632aa0ee2.tar.gz
prosody-9f0b42786ec4519f7ed70db594277ae632aa0ee2.zip
MUC: Split out the nickname from the full room JID in voice request from
-rw-r--r--plugins/muc/moderated.lib.lua4
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();