# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1524869109 -7200
# Node ID 64b78e3deb965c87ed650f910a3b5b55c301f135
# Parent  79133eca065697626a31e4cced1a1b4a49758253
mod_muc_mam: Skip fetching history if no history was requested

diff -r 79133eca0656 -r 64b78e3deb96 plugins/mod_muc_mam.lua
--- a/plugins/mod_muc_mam.lua	Sat Apr 28 00:44:28 2018 +0200
+++ b/plugins/mod_muc_mam.lua	Sat Apr 28 00:45:09 2018 +0200
@@ -246,6 +246,10 @@
 	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