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 | fec7a1c262c3aa8d37001cbaf9988b9a01307020 (patch) | |
tree | 6ad716d372a8d19a2a08f7e606252be7de746ffb /plugins/mod_muc_mam.lua | |
parent | de89c2de1119f9b82953690fada3d86464216dca (diff) | |
download | prosody-fec7a1c262c3aa8d37001cbaf9988b9a01307020.tar.gz prosody-fec7a1c262c3aa8d37001cbaf9988b9a01307020.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 |