plugins/mod_mam/mod_mam.lua
changeset 8907 faca839ddbbb
parent 8583 b23da88b3507
child 8908 65d1a80d3565
--- 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;