parent
ebc8fc8797
commit
6e92882176
@ -83,11 +83,17 @@ local function moderate(actor, room_jid, stanza_id, retract, reason)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local actor_occupant = room:get_occupant_by_real_jid(actor) or room:new_occupant(jid.bare(actor), actor_nick);
|
||||||
|
|
||||||
local announcement = st.message({ from = room_jid, type = "groupchat", id = id.medium(), })
|
local announcement = st.message({ from = room_jid, type = "groupchat", id = id.medium(), })
|
||||||
:tag("apply-to", { xmlns = xmlns_fasten, id = stanza_id })
|
:tag("apply-to", { xmlns = xmlns_fasten, id = stanza_id })
|
||||||
:tag("moderated", { xmlns = xmlns_moderate, by = actor_nick })
|
:tag("moderated", { xmlns = xmlns_moderate, by = actor_nick })
|
||||||
|
|
||||||
|
if room.get_occupant_id then
|
||||||
|
-- This isn't a regular broadcast message going through the events occupant_id.lib hooks so we do this here
|
||||||
|
announcement:add_child(st.stanza("occupant-id", { xmlns = xmlns_occupant_id; id = room:get_occupant_id(actor_occupant) }));
|
||||||
|
end
|
||||||
|
|
||||||
if retract then
|
if retract then
|
||||||
announcement:tag("retract", { xmlns = xmlns_retract }):up();
|
announcement:tag("retract", { xmlns = xmlns_retract }):up();
|
||||||
end
|
end
|
||||||
@ -101,20 +107,18 @@ local function moderate(actor, room_jid, stanza_id, retract, reason)
|
|||||||
announcement:add_direct_child(moderated_occupant_id);
|
announcement:add_direct_child(moderated_occupant_id);
|
||||||
end
|
end
|
||||||
|
|
||||||
local actor_occupant = room:get_occupant_by_real_jid(actor) or room:new_occupant(jid.bare(actor), actor_nick);
|
|
||||||
if room.get_occupant_id then
|
|
||||||
-- This isn't a regular broadcast message going through the events occupant_id.lib hooks so we do this here
|
|
||||||
announcement:add_direct_child(st.stanza("occupant-id", { xmlns = xmlns_occupant_id; id = room:get_occupant_id(actor_occupant) }))
|
|
||||||
end
|
|
||||||
|
|
||||||
if muc_log_archive.set and retract then
|
if muc_log_archive.set and retract then
|
||||||
local tombstone = st.message({ from = original.attr.from, type = "groupchat", id = original.attr.id })
|
local tombstone = st.message({ from = original.attr.from, type = "groupchat", id = original.attr.id })
|
||||||
:tag("moderated", { xmlns = xmlns_moderate, by = actor_nick })
|
:tag("moderated", { xmlns = xmlns_moderate, by = actor_nick })
|
||||||
:tag("retracted", { xmlns = xmlns_retract, stamp = dt.datetime() }):up();
|
:tag("retracted", { xmlns = xmlns_retract, stamp = dt.datetime() });
|
||||||
|
|
||||||
if room.get_occupant_id then
|
if room.get_occupant_id then
|
||||||
tombstone:add_direct_child(st.stanza("occupant-id", { xmlns = xmlns_occupant_id; id = room:get_occupant_id(actor_occupant) }))
|
tombstone:add_child(st.stanza("occupant-id", { xmlns = xmlns_occupant_id; id = room:get_occupant_id(actor_occupant) }));
|
||||||
|
end
|
||||||
|
|
||||||
|
tombstone:up();
|
||||||
|
|
||||||
|
if room.get_occupant_id then
|
||||||
if moderated_occupant_id then
|
if moderated_occupant_id then
|
||||||
-- Copy occupant id from moderated message
|
-- Copy occupant id from moderated message
|
||||||
tombstone:add_child(moderated_occupant_id);
|
tombstone:add_child(moderated_occupant_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user