Diff

plugins/mod_muc_mam.lua @ 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 (2018-04-27)
parent 8784:64b78e3deb96
child 8786:adffadd88ff0
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;