From 114bcccb5b95c3d122d2fe5bc3d61c809d76b2c6 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 18 Mar 2014 16:01:53 -0400 Subject: plugins/muc/muc: Only call get_password once in invite creation --- plugins/muc/muc.lib.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 2afe6f58..2c9b58d2 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -1045,9 +1045,10 @@ function room_mt:handle_mediated_invite(origin, stanza, payload) :tag('invite', {from=_from}) :tag('reason'):text(_reason or ""):up() :up(); - if self:get_password() then - invite:tag("password"):text(self:get_password()):up(); - end + local password = self:get_password() + if password then + invite:tag("password"):text(password):up(); + end invite:up() :tag('x', {xmlns="jabber:x:conference", jid=_to}) -- COMPAT: Some older clients expect this :text(_reason or "") -- cgit v1.2.3