Changeset

8785:82b889608503

mod_muc_mam: Skip fetching history if built-in recent history is enough
author Kim Alvefur <zash@zash.se>
date Fri, 27 Apr 2018 15:26:29 +0200
parents 8784:64b78e3deb96
children 8786:adffadd88ff0
files plugins/mod_muc_mam.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_muc_mam.lua	Sat Apr 28 00:45:09 2018 +0200
+++ b/plugins/mod_muc_mam.lua	Fri Apr 27 15:26:29 2018 +0200
@@ -254,6 +254,10 @@
 		maxstanzas = get_historylength(room);
 	end
 
+	if room._history and #room._history >= maxstanzas then
+		return -- It can deal with this itself
+	end
+
 	-- Load all the data!
 	local query = {
 		limit = maxstanzas;