# HG changeset patch # User Kim Alvefur # Date 1524835589 -7200 # Node ID 82b889608503a5463f153093609dd98338f8ae50 # Parent 64b78e3deb965c87ed650f910a3b5b55c301f135 mod_muc_mam: Skip fetching history if built-in recent history is enough diff -r 64b78e3deb96 -r 82b889608503 plugins/mod_muc_mam.lua --- 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;