From 88562eeb5d78edd0bba3246fc29e2a2292462726 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 27 Apr 2018 15:26:29 +0200 Subject: mod_muc_mam: Skip fetching history if built-in recent history is enough --- plugins/mod_muc_mam.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_muc_mam.lua b/plugins/mod_muc_mam.lua index 8c5ea2aa..7e6c9838 100644 --- a/plugins/mod_muc_mam.lua +++ b/plugins/mod_muc_mam.lua @@ -254,6 +254,10 @@ module:hook("muc-get-history", function (event) 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; -- cgit v1.2.3