From 9f0b42786ec4519f7ed70db594277ae632aa0ee2 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 21 Oct 2017 21:24:07 +0200 Subject: MUC: Split out the nickname from the full room JID in voice request from --- plugins/muc/moderated.lib.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/muc') 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(); -- cgit v1.2.3