From d37e36dce4818b44a4d95acb74e0d91ab4f62b4d 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(+) 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