Comparison

mod_mam/mod_mam.lua @ 673:9dcf98018644

mod_mam: Break when the message is more recent than the range requested
author Kim Alvefur <zash@zash.se>
date Thu, 24 May 2012 22:56:12 +0200
parent 672:8ae5317ba032
child 674:699187d18f11
comparison
equal deleted inserted replaced
672:8ae5317ba032 673:9dcf98018644
155 :tag("delay", { xmlns = xmlns_delay, stamp = ts or timestamp(when) }):up(); 155 :tag("delay", { xmlns = xmlns_delay, stamp = ts or timestamp(when) }):up();
156 local orig_stanza = st.deserialize(item.stanza); 156 local orig_stanza = st.deserialize(item.stanza);
157 orig_stanza.attr.xmlns = "jabber:client"; 157 orig_stanza.attr.xmlns = "jabber:client";
158 fwd_st:add_child(orig_stanza); 158 fwd_st:add_child(orig_stanza);
159 origin.send(fwd_st); 159 origin.send(fwd_st);
160 elseif qend and when > qend then
161 break -- We have passed into messages more recent than requested
160 end 162 end
161 end 163 end
162 -- That's all folks! 164 -- That's all folks!
163 module:log("debug", "Archive query %s completed", tostring(qid)); 165 module:log("debug", "Archive query %s completed", tostring(qid));
164 origin.send(st.reply(stanza)); 166 origin.send(st.reply(stanza));