mod_mam: Move variable into loop scope
authorKim Alvefur <zash@zash.se>
Sun, 03 May 2015 13:21:51 +0200
changeset 1691 838150167871
parent 1690 cc3fad4198bc
child 1692 cd87a2eba8f2
mod_mam: Move variable into loop scope
mod_mam/mod_mam.lua
--- a/mod_mam/mod_mam.lua	Sun May 03 13:27:53 2015 +0200
+++ b/mod_mam/mod_mam.lua	Sun May 03 13:21:51 2015 +0200
@@ -140,7 +140,7 @@
 	local msg_reply_attr = { to = stanza.attr.from, from = stanza.attr.to };
 
 	-- Wrap it in stuff and deliver
-	local fwd_st, first, last;
+	local first, last;
 	local count = 0;
 	local complete = "true";
 	for id, item, when in data do
@@ -149,7 +149,7 @@
 			complete = nil;
 			break;
 		end
-		fwd_st = st.message(msg_reply_attr)
+		local fwd_st = st.message(msg_reply_attr)
 			:tag("result", { xmlns = xmlns_mam, queryid = qid, id = id })
 				:tag("forwarded", { xmlns = xmlns_forward })
 					:tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up();