Comparison

plugins/mod_mam/mod_mam.lua @ 8906:f15e35458ecc

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sun, 10 Jun 2018 01:20:05 +0200
parent 8905:65d1a80d3565
child 9553:9a5485550bfd
comparison
equal deleted inserted replaced
8903:c5d5dfaa8d38 8906:f15e35458ecc
143 143
144 -- Load all the data! 144 -- Load all the data!
145 local data, err = archive:find(origin.username, { 145 local data, err = archive:find(origin.username, {
146 start = qstart; ["end"] = qend; -- Time range 146 start = qstart; ["end"] = qend; -- Time range
147 with = qwith; 147 with = qwith;
148 limit = qmax + 1; 148 limit = qmax == 0 and 0 or qmax + 1;
149 before = before; after = after; 149 before = before; after = after;
150 reverse = reverse; 150 reverse = reverse;
151 total = use_total or qmax == 0; 151 total = use_total or qmax == 0;
152 }); 152 });
153 153
166 local count = 0; 166 local count = 0;
167 local complete = "true"; 167 local complete = "true";
168 for id, item, when in data do 168 for id, item, when in data do
169 count = count + 1; 169 count = count + 1;
170 if count > qmax then 170 if count > qmax then
171 -- We requested qmax+1 items. If that many items are retrieved then
172 -- there are more results to page through, so:
171 complete = nil; 173 complete = nil;
172 break; 174 break;
173 end 175 end
174 local fwd_st = st.message(msg_reply_attr) 176 local fwd_st = st.message(msg_reply_attr)
175 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }) 177 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id })