# HG changeset patch # User Kim Alvefur # Date 1531014227 -7200 # Node ID 2df7dc99566ab564448f3565dd326e93d03768a7 # Parent 2e6f7ab97794a0d1ae10e7fb833fcd6a2c1156af MUC/password: Rename variable for clarity [luacheck] diff -r 2e6f7ab97794 -r 2df7dc99566a plugins/muc/password.lib.lua --- a/plugins/muc/password.lib.lua Sun Jul 08 00:37:01 2018 +0200 +++ b/plugins/muc/password.lib.lua Sun Jul 08 03:43:47 2018 +0200 @@ -42,8 +42,9 @@ -- 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;