Comparison

plugins/mod_muc_mam.lua @ 8784:64b78e3deb96

mod_muc_mam: Skip fetching history if no history was requested
author Kim Alvefur <zash@zash.se>
date Sat, 28 Apr 2018 00:45:09 +0200
parent 8783:79133eca0656
child 8785:82b889608503
comparison
equal deleted inserted replaced
8783:79133eca0656 8784:64b78e3deb96
244 local maxstanzas = event.maxstanzas; 244 local maxstanzas = event.maxstanzas;
245 local maxchars = event.maxchars; 245 local maxchars = event.maxchars;
246 local since = event.since; 246 local since = event.since;
247 local to = event.to; 247 local to = event.to;
248 248
249 if maxstanzas == 0 or maxchars == 0 then
250 return -- No history requested
251 end
252
249 if not maxstanzas or maxstanzas > get_historylength(room) then 253 if not maxstanzas or maxstanzas > get_historylength(room) then
250 maxstanzas = get_historylength(room); 254 maxstanzas = get_historylength(room);
251 end 255 end
252 256
253 -- Load all the data! 257 -- Load all the data!