aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-08 03:43:47 +0200
committerKim Alvefur <zash@zash.se>2018-07-08 03:43:47 +0200
commitb2ab7522b3c0213124f892aef6a1fad74ac4c271 (patch)
treed68ef15a1a86b4e272ea69821bf5e76b2ee1a755 /plugins
parent701f263ee70bf1da7c26166b07e2d26889cd2bf8 (diff)
downloadprosody-b2ab7522b3c0213124f892aef6a1fad74ac4c271.tar.gz
prosody-b2ab7522b3c0213124f892aef6a1fad74ac4c271.zip
MUC/password: Rename variable for clarity [luacheck]
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/password.lib.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/muc/password.lib.lua b/plugins/muc/password.lib.lua
index 02ecdc1a..7edab767 100644
--- a/plugins/muc/password.lib.lua
+++ b/plugins/muc/password.lib.lua
@@ -42,8 +42,9 @@ end);
-- Don't allow anyone to join room unless they provide the password
module:hook("muc-occupant-pre-join", function(event)
local room, stanza = event.room, event.stanza;
- local password = stanza:get_child("x", "http://jabber.org/protocol/muc");
- password = password and password:get_child_text("password", "http://jabber.org/protocol/muc");
+ local muc_x = stanza:get_child("x", "http://jabber.org/protocol/muc");
+ if not muc_x then return end
+ local password = muc_x:get_child_text("password", "http://jabber.org/protocol/muc");
if not password or password == "" then password = nil; end
if get_password(room) ~= password then
local from, to = stanza.attr.from, stanza.attr.to;