From 08c513a957c0ca8b165a1425a2198fcaaea907a8 Mon Sep 17 00:00:00 2001 From: Alexander PapaTutuWawa Date: Mon, 22 Feb 2021 08:33:43 +0100 Subject: [PATCH] mod_mix: Fix setnick --- mod_mix/mod_mix.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod_mix/mod_mix.lua b/mod_mix/mod_mix.lua index 3b28387..d54a479 100644 --- a/mod_mix/mod_mix.lua +++ b/mod_mix/mod_mix.lua @@ -512,7 +512,7 @@ module:hook("iq-set/bare/"..mix_core_xmlns..":setnick", function(event) -- NOTE: Prosody should guarantee us that the setnick stanza exists local setnick = stanza:get_child("setnick", mix_core_xmlns); local nick = setnick:get_child("nick"); - if nick_stanza == nil then + if nick == nil then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Missing ")); return true; end @@ -520,7 +520,7 @@ module:hook("iq-set/bare/"..mix_core_xmlns..":setnick", function(event) -- Change the nick channel.participants[j].nick = nick:get_text(); -- Inform all other members - local srv = pep.get_pep_service(channel.jid); + local srv = pep.get_pep_service(jid.node(channel.jid)); --local participant = channel.participants[participant_index]; publish_participant(srv, channel, channel:get_spid(participant.jid), participant); @@ -649,6 +649,7 @@ module:hook("iq-set/host/"..mix_core_xmlns..":destroy", function(event) return true; end + -- TODO: Permission checks -- TODO: Maybe make this configurable if helpers.find_str(channel.contacts, from) == -1 then origin.send(st.error_reply(stanza, "cancel", "forbidden"));