aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-03-18 16:01:53 -0400
committerdaurnimator <quae@daurnimator.com>2014-03-18 16:01:53 -0400
commit114bcccb5b95c3d122d2fe5bc3d61c809d76b2c6 (patch)
treebb0bb4fed9a06e73be33e30e34ec6deea314849b
parent176fc76253fd26bca5efc0249b3666feb40ddf99 (diff)
downloadprosody-114bcccb5b95c3d122d2fe5bc3d61c809d76b2c6.tar.gz
prosody-114bcccb5b95c3d122d2fe5bc3d61c809d76b2c6.zip
plugins/muc/muc: Only call get_password once in invite creation
-rw-r--r--plugins/muc/muc.lib.lua7
1 files 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 "")