Comparison

plugins/mod_muc_mam.lua @ 8785:82b889608503

mod_muc_mam: Skip fetching history if built-in recent history is enough
author Kim Alvefur <zash@zash.se>
date Fri, 27 Apr 2018 15:26:29 +0200
parent 8784:64b78e3deb96
child 8786:adffadd88ff0
comparison
equal deleted inserted replaced
8784:64b78e3deb96 8785:82b889608503
252 252
253 if not maxstanzas or maxstanzas > get_historylength(room) then 253 if not maxstanzas or maxstanzas > get_historylength(room) then
254 maxstanzas = get_historylength(room); 254 maxstanzas = get_historylength(room);
255 end 255 end
256 256
257 if room._history and #room._history >= maxstanzas then
258 return -- It can deal with this itself
259 end
260
257 -- Load all the data! 261 -- Load all the data!
258 local query = { 262 local query = {
259 limit = maxstanzas; 263 limit = maxstanzas;
260 start = since; 264 start = since;
261 reverse = true; 265 reverse = true;