Changeset

2831:d65868fed77a

mod_mam_muc: Copy max_archive_query_results option from mod_mam
author Kim Alvefur <zash@zash.se>
date Sat, 18 Nov 2017 00:46:44 +0100
parents 2830:92f6f82397c9
children 2832:15a9d508c5f7
files mod_mam_muc/mod_mam_muc.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_mam_muc/mod_mam_muc.lua	Sat Nov 18 00:37:42 2017 +0100
+++ b/mod_mam_muc/mod_mam_muc.lua	Sat Nov 18 00:46:44 2017 +0100
@@ -41,6 +41,7 @@
 local time_now = os.time;
 local m_min = math.min;
 local timestamp, timestamp_parse = require "util.datetime".datetime, require "util.datetime".parse;
+local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50);
 
 local default_history_length = 20;
 local max_history_length = module:get_option_number("max_history_messages", math.huge);
@@ -211,7 +212,7 @@
 
 	-- RSM stuff
 	local qset = rsm.get(query);
-	local qmax = m_min(qset and qset.max or 20, 20);
+	local qmax = m_min(qset and qset.max or default_max_items, max_max_items);
 	local reverse = qset and qset.before or false;
 
 	local before, after = qset and qset.before, qset and qset.after;