Changeset

8904:faca839ddbbb

mod_mam: Handle edge-case of max=0 so that complete attr is set (fixes #1128)
author Kim Alvefur <zash@zash.se>
date Sat, 09 Jun 2018 23:57:58 +0200
parents 8901:eae606b9266c
children 8905:65d1a80d3565
files plugins/mod_mam/mod_mam.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_mam/mod_mam.lua	Sat Jun 09 15:34:00 2018 +0200
+++ b/plugins/mod_mam/mod_mam.lua	Sat Jun 09 23:57:58 2018 +0200
@@ -145,7 +145,7 @@
 	local data, err = archive:find(origin.username, {
 		start = qstart; ["end"] = qend; -- Time range
 		with = qwith;
-		limit = qmax + 1;
+		limit = qmax == 0 and 0 or qmax + 1;
 		before = before; after = after;
 		reverse = reverse;
 		total = use_total or qmax == 0;