diff options
author | Kim Alvefur <zash@zash.se> | 2018-04-28 00:45:09 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-04-28 00:45:09 +0200 |
commit | ee8969e246406c99914365ea866ca60147c1117d (patch) | |
tree | 6ad716d372a8d19a2a08f7e606252be7de746ffb /plugins/mod_muc_mam.lua | |
parent | 9e2ef3905c6fe1325002959362aa0430916931e1 (diff) | |
download | prosody-ee8969e246406c99914365ea866ca60147c1117d.tar.gz prosody-ee8969e246406c99914365ea866ca60147c1117d.zip |
mod_muc_mam: Skip fetching history if no history was requested
Diffstat (limited to 'plugins/mod_muc_mam.lua')
-rw-r--r-- | plugins/mod_muc_mam.lua | 4 |
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 |