mod_muc_mam: Skip fetching history if no history was requested
authorKim Alvefur <zash@zash.se>
Sat, 28 Apr 2018 00:45:09 +0200
changeset 8787 64b78e3deb96
parent 8786 79133eca0656
child 8788 82b889608503
mod_muc_mam: Skip fetching history if no history was requested
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