plugins/muc/muc: Only call get_password once in invite creation
authordaurnimator <quae@daurnimator.com>
Tue, 18 Mar 2014 16:01:53 -0400
changeset 6107 5491be05b84c
parent 6106 4b15cfae2d11
child 6108 aae7bc9d6e93
plugins/muc/muc: Only call get_password once in invite creation
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Tue Mar 18 15:42:48 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Tue Mar 18 16:01:53 2014 -0400
@@ -1045,9 +1045,10 @@
 				: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 "")