Software /
code /
prosody
Comparison
plugins/mod_mam/mod_mam.lua @ 10079:a36c731ed540
mod_mam: Report correct count of results for forward queries
#results is only correct for backwards queries, the table is unused for
forward queries.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 13 Jul 2019 19:57:43 +0200 |
parent | 10078:44371850c6b0 |
child | 10111:0f335815244f |
comparison
equal
deleted
inserted
replaced
10078:44371850c6b0 | 10079:a36c731ed540 |
---|---|
204 :tag("fin", { xmlns = xmlns_mam, queryid = qid, complete = complete }) | 204 :tag("fin", { xmlns = xmlns_mam, queryid = qid, complete = complete }) |
205 :add_child(rsm.generate { | 205 :add_child(rsm.generate { |
206 first = first, last = last, count = total })); | 206 first = first, last = last, count = total })); |
207 | 207 |
208 -- That's all folks! | 208 -- That's all folks! |
209 module:log("debug", "Archive query id=%s completed, %d items returned", qid or stanza.attr.id, #results); | 209 module:log("debug", "Archive query id=%s completed, %d items returned", qid or stanza.attr.id, complete and count or count - 1); |
210 return true; | 210 return true; |
211 end); | 211 end); |
212 | 212 |
213 local function has_in_roster(user, who) | 213 local function has_in_roster(user, who) |
214 local roster = rm_load_roster(user, host); | 214 local roster = rm_load_roster(user, host); |