comparison mod_http_muc_log/mod_http_muc_log.lua @ 4781:306066898e5f

mod_http_muc_log: Show messages moderated using XEP-0425
author Kim Alvefur <zash@zash.se>
date Mon, 22 Nov 2021 21:01:53 +0100
parents 823370bc2e4c
children 13070c6a7ce8
comparison
equal deleted inserted replaced
4780:4abb33a15897 4781:306066898e5f
328 end 328 end
329 329
330 local nick = select(3, jid_split(item.attr.from)); 330 local nick = select(3, jid_split(item.attr.from));
331 local oob = use_oob and item:get_child("x", "jabber:x:oob"); 331 local oob = use_oob and item:get_child("x", "jabber:x:oob");
332 332
333 local moderated = item:get_child("moderated", "urn:xmpp:message-moderate:0");
334 if moderated then
335 local actor = moderated.attr.by;
336 if actor then actor = select(3, jid_split(actor)); end
337 verb = "removed by " .. (actor or "moderator");
338 body = moderated:get_child_text("reason") or "";
339 end
340
341 local moderation = item:find("{urn:xmpp:fasten:0}apply-to/{urn:xmpp:message-moderate:0}moderated");
342 if moderation then
343 nick = nick or "a moderator";
344 verb = "removed a message";
345 body = moderation:get_child_text("reason") or "";
346 end
347
333 local edit = item:find("{urn:xmpp:message-correct:0}replace/@id"); 348 local edit = item:find("{urn:xmpp:message-correct:0}replace/@id");
334 if edit then 349 if edit then
335 local found = false; 350 local found = false;
336 for n = i-1, 1, -1 do 351 for n = i-1, 1, -1 do
337 if not logs[n] then 352 if not logs[n] then