aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-04-28 00:45:09 +0200
committerKim Alvefur <zash@zash.se>2018-04-28 00:45:09 +0200
commitee8969e246406c99914365ea866ca60147c1117d (patch)
tree6ad716d372a8d19a2a08f7e606252be7de746ffb
parent9e2ef3905c6fe1325002959362aa0430916931e1 (diff)
downloadprosody-ee8969e246406c99914365ea866ca60147c1117d.tar.gz
prosody-ee8969e246406c99914365ea866ca60147c1117d.zip
mod_muc_mam: Skip fetching history if no history was requested
-rw-r--r--plugins/mod_muc_mam.lua4
1 files changed, 4 insertions, 0 deletions
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