# HG changeset patch # User Kim Alvefur # Date 1427671055 -7200 # Node ID 7fa0c41792c7bb845dbe91291b6d952969917fb4 # Parent b877b75eb97385136d1d25ea16458ebccbb3f688 mod_mam_muc: Fix character limit diff -r b877b75eb973 -r 7fa0c41792c7 mod_mam_muc/mod_mam_muc.lua --- a/mod_mam_muc/mod_mam_muc.lua Wed Mar 25 17:52:31 2015 +0100 +++ b/mod_mam_muc/mod_mam_muc.lua Mon Mar 30 01:17:35 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));