Software /
code /
prosody
Diff
plugins/muc/moderated.lib.lua @ 8854:5cd7813d4e94
MUC: Split out the nickname from the full room JID in voice request from
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 21 Oct 2017 21:24:07 +0200 |
parent | 8853:f84f566dea58 |
child | 8857:f4cc818db995 |
line wrap: on
line diff
--- a/plugins/muc/moderated.lib.lua Fri Oct 20 05:45:40 2017 +0200 +++ b/plugins/muc/moderated.lib.lua Sat Oct 21 21:24:07 2017 +0200 @@ -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 @@ 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();