From ee8969e246406c99914365ea866ca60147c1117d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 28 Apr 2018 00:45:09 +0200 Subject: mod_muc_mam: Skip fetching history if no history was requested --- plugins/mod_muc_mam.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins/mod_muc_mam.lua') diff --git a/plugins/mod_muc_mam.lua b/plugins/mod_muc_mam.lua index de59641c..8c5ea2aa 100644 --- a/plugins/mod_muc_mam.lua +++ b/plugins/mod_muc_mam.lua @@ -246,6 +246,10 @@ module:hook("muc-get-history", function (event) local since = event.since; local to = event.to; + if maxstanzas == 0 or maxchars == 0 then + return -- No history requested + end + if not maxstanzas or maxstanzas > get_historylength(room) then maxstanzas = get_historylength(room); end -- cgit v1.2.3