# HG changeset patch # User John Livingston # Date 1725984183 -7200 # Node ID a86720654fb915a5d80ef00e027119957d48305f # Parent 7308ec4aaad148abbbf7663e11d687907938f690 mod_muc_moderation_delay: Fix lua 5.3/5.4 compatibility. diff -r 7308ec4aaad1 -r a86720654fb9 mod_muc_moderation_delay/delay.lib.lua --- a/mod_muc_moderation_delay/delay.lib.lua Sat Sep 07 15:20:23 2024 +0200 +++ b/mod_muc_moderation_delay/delay.lib.lua Tue Sep 10 18:03:03 2024 +0200 @@ -88,7 +88,7 @@ end local id = stanza.attr.id; if not id then - -- message should alway have an id, but just in case... + -- message should always have an id, but just in case... module:log("warn", "Message has no id, wont delay it."); return; end @@ -106,7 +106,7 @@ if stanza.attr.from then local from_occupant = room:get_occupant_by_nick(stanza.attr.from); if from_occupant and valid_roles[from_occupant.role or "none"] < moderator_role_value then - module:log("debug", "Message %s / %s must be sent separatly to it initialior %s.", id, stanza_id, delay, stanza.attr.from); + module:log("debug", "Message %s / %s must be sent separatly to it initiator %s.", id, stanza_id, delay, stanza.attr.from); room:route_to_occupant(from_occupant, stanza); end end @@ -114,7 +114,7 @@ -- adding a tag, so that moderators can know that this message is delayed. stanza:tag(moderation_delay_tag, { delay = "" .. delay; - waiting = string.format("%i", get_time() + delay); + waiting = string.format("%i", math.floor(get_time() + delay)); }):up(); -- then, sending to moderators (and only moderators):