Comparison

mod_mam/mod_mam.lua @ 1684:838150167871

mod_mam: Move variable into loop scope
author Kim Alvefur <zash@zash.se>
date Sun, 03 May 2015 13:21:51 +0200
parent 1683:cc3fad4198bc
child 1685:cd87a2eba8f2
comparison
equal deleted inserted replaced
1683:cc3fad4198bc 1684:838150167871
138 138
139 origin.send(st.reply(stanza)) 139 origin.send(st.reply(stanza))
140 local msg_reply_attr = { to = stanza.attr.from, from = stanza.attr.to }; 140 local msg_reply_attr = { to = stanza.attr.from, from = stanza.attr.to };
141 141
142 -- Wrap it in stuff and deliver 142 -- Wrap it in stuff and deliver
143 local fwd_st, first, last; 143 local first, last;
144 local count = 0; 144 local count = 0;
145 local complete = "true"; 145 local complete = "true";
146 for id, item, when in data do 146 for id, item, when in data do
147 count = count + 1; 147 count = count + 1;
148 if count > qmax then 148 if count > qmax then
149 complete = nil; 149 complete = nil;
150 break; 150 break;
151 end 151 end
152 fwd_st = st.message(msg_reply_attr) 152 local fwd_st = st.message(msg_reply_attr)
153 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }) 153 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id })
154 :tag("forwarded", { xmlns = xmlns_forward }) 154 :tag("forwarded", { xmlns = xmlns_forward })
155 :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up(); 155 :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up();
156 156
157 if not is_stanza(item) then 157 if not is_stanza(item) then