# HG changeset patch # User Kim Alvefur # Date 1428420862 -7200 # Node ID ab4073468dfb8c31832326ed16e9aaf1671fc5d9 # Parent 648ce9087902737c326a3919be003ae5f67e4e04 mod_mam_muc: Fix character limit again(?) diff -r 648ce9087902 -r ab4073468dfb mod_mam_muc/mod_mam_muc.lua --- a/mod_mam_muc/mod_mam_muc.lua Tue Apr 07 17:04:06 2015 +0200 +++ b/mod_mam_muc/mod_mam_muc.lua Tue Apr 07 17:34:22 2015 +0200 @@ -266,18 +266,17 @@ return end - local chars = 0; local history, i = {}, 1; for id, item, when in data do item.attr.to = to; item:tag("delay", { xmlns = "urn:xmpp:delay", from = room_jid, stamp = timestamp(when) }):up(); -- XEP-0203 if maxchars then - chars = #tostring(item); + local chars = #tostring(item); if maxchars - chars < 0 then break end - charcount = maxchars - chars; + maxchars = maxchars - chars; end history[i], i = item, i+1; -- module:log("debug", tostring(item));