diff options
author | Kim Alvefur <zash@zash.se> | 2018-04-27 15:26:29 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-04-27 15:26:29 +0200 |
commit | 88562eeb5d78edd0bba3246fc29e2a2292462726 (patch) | |
tree | ece014b2e1dd941ea2c894ccd8ecdbad4fbc4cea /plugins/mod_muc_mam.lua | |
parent | fec7a1c262c3aa8d37001cbaf9988b9a01307020 (diff) | |
download | prosody-88562eeb5d78edd0bba3246fc29e2a2292462726.tar.gz prosody-88562eeb5d78edd0bba3246fc29e2a2292462726.zip |
mod_muc_mam: Skip fetching history if built-in recent history is enough
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 8c5ea2aa..7e6c9838 100644 --- a/plugins/mod_muc_mam.lua +++ b/plugins/mod_muc_mam.lua @@ -254,6 +254,10 @@ module:hook("muc-get-history", function (event) maxstanzas = get_historylength(room); end + if room._history and #room._history >= maxstanzas then + return -- It can deal with this itself + end + -- Load all the data! local query = { limit = maxstanzas; |