Mercurial > prosody-modules
changeset 5962:a86720654fb9
mod_muc_moderation_delay: Fix lua 5.3/5.4 compatibility.
author | John Livingston <git@john-livingston.fr> |
---|---|
date | Tue, 10 Sep 2024 18:03:03 +0200 |
parents | 7308ec4aaad1 |
children | c61a82f80e57 |
files | mod_muc_moderation_delay/delay.lib.lua |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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):