# HG changeset patch # User Kim Alvefur # Date 1427819473 -7200 # Node ID 1fa25cfb0ad4fe4c41e1300734c7aa680f53343d # Parent 7fa0c41792c7bb845dbe91291b6d952969917fb4# Parent 1d96629f5ddab9bbfed8612a7f83782e1765a0a5 Merge diff -r 1d96629f5dda -r 1fa25cfb0ad4 mod_mam_muc/mod_mam_muc.lua --- a/mod_mam_muc/mod_mam_muc.lua Tue Mar 31 12:46:17 2015 +0100 +++ b/mod_mam_muc/mod_mam_muc.lua Tue Mar 31 18:31:13 2015 +0200 @@ -274,10 +274,10 @@ item:tag("delay", { xmlns = "urn:xmpp:delay", from = room_jid, stamp = timestamp(when) }):up(); -- XEP-0203 if maxchars then chars = #tostring(item); - if chars + charcount > maxchars then + if maxchars - chars < 0 then break end - charcount = charcount + chars; + charcount = maxchars - chars; end history[i], i = item, i+1; -- module:log("debug", tostring(item));