aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_mam
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-09 23:57:58 +0200
committerKim Alvefur <zash@zash.se>2018-06-09 23:57:58 +0200
commit0c38ebb0cfcc7d4e1480bdd47b4b1affe633ff92 (patch)
tree021df3c92229383fb23f2a1dde96ba1a5fd78033 /plugins/mod_mam
parent28aad3d6909fb864af2b2ea1bd2fcb541aeff17a (diff)
downloadprosody-0c38ebb0cfcc7d4e1480bdd47b4b1affe633ff92.tar.gz
prosody-0c38ebb0cfcc7d4e1480bdd47b4b1affe633ff92.zip
mod_mam: Handle edge-case of max=0 so that complete attr is set (fixes #1128)
Diffstat (limited to 'plugins/mod_mam')
-rw-r--r--plugins/mod_mam/mod_mam.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index cf622e0f..29d4ff7b 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -145,7 +145,7 @@ module:hook("iq-set/self/"..xmlns_mam..":query", function(event)
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;