# HG changeset patch # User Kim Alvefur # Date 1637611313 -3600 # Node ID 306066898e5fa4b1e4f756df481f19a91fb16e08 # Parent 4abb33a15897d2bcff5f3eb3d8210239903917ad mod_http_muc_log: Show messages moderated using XEP-0425 diff -r 4abb33a15897 -r 306066898e5f mod_http_muc_log/mod_http_muc_log.lua --- a/mod_http_muc_log/mod_http_muc_log.lua Fri Nov 19 17:00:38 2021 +0000 +++ b/mod_http_muc_log/mod_http_muc_log.lua Mon Nov 22 21:01:53 2021 +0100 @@ -330,6 +330,21 @@ local nick = select(3, jid_split(item.attr.from)); local oob = use_oob and item:get_child("x", "jabber:x:oob"); + local moderated = item:get_child("moderated", "urn:xmpp:message-moderate:0"); + if moderated then + local actor = moderated.attr.by; + if actor then actor = select(3, jid_split(actor)); end + verb = "removed by " .. (actor or "moderator"); + body = moderated:get_child_text("reason") or ""; + end + + local moderation = item:find("{urn:xmpp:fasten:0}apply-to/{urn:xmpp:message-moderate:0}moderated"); + if moderation then + nick = nick or "a moderator"; + verb = "removed a message"; + body = moderation:get_child_text("reason") or ""; + end + local edit = item:find("{urn:xmpp:message-correct:0}replace/@id"); if edit then local found = false;