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 | d37e36dce4818b44a4d95acb74e0d91ab4f62b4d (patch) | |
tree | ece014b2e1dd941ea2c894ccd8ecdbad4fbc4cea | |
parent | ee8969e246406c99914365ea866ca60147c1117d (diff) | |
download | prosody-d37e36dce4818b44a4d95acb74e0d91ab4f62b4d.tar.gz prosody-d37e36dce4818b44a4d95acb74e0d91ab4f62b4d.zip |
mod_muc_mam: Skip fetching history if built-in recent history is enough
-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; |