aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_mam/mod_mam.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-26 11:55:27 +0200
committerKim Alvefur <zash@zash.se>2017-04-26 11:55:27 +0200
commitd300932f7b75b891e6dfcf7d568d796c227b9502 (patch)
treec7d9b10298595fe019de63ce1fb4853be587de49 /plugins/mod_mam/mod_mam.lua
parent30a4f36e03d8fad67839ee27ee037967ab50b385 (diff)
parent4e955bb01926b7fafe8e3d892807833382e50634 (diff)
downloadprosody-d300932f7b75b891e6dfcf7d568d796c227b9502.tar.gz
prosody-d300932f7b75b891e6dfcf7d568d796c227b9502.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_mam/mod_mam.lua')
-rw-r--r--plugins/mod_mam/mod_mam.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index 0c35f43f..f46d3818 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -52,6 +52,8 @@ if archive.name == "null" or not archive.find then
archive = module:require "fallback_archive";
end
+local use_total = true;
+
local cleanup;
-- Handle prefs.
@@ -137,7 +139,7 @@ module:hook("iq-set/self/"..xmlns_mam..":query", function(event)
limit = qmax + 1;
before = before; after = after;
reverse = reverse;
- total = true;
+ total = get_total;
});
if not data then
@@ -359,6 +361,10 @@ if cleanup_after ~= "never" then
end
return math.random(cleanup_interval, cleanup_interval * 2);
end);
+else
+ -- Don't ask the backend to count the potentially unbounded number of items,
+ -- it'll get slow.
+ use_total = false;
end
-- Stanzas sent by local clients