mod_muc_moderation: Use reserved nickname as fallback
When moderation is invoked from a JID that is not joined, the nickname
is not known, but we should include it in the broadcast for
transparency.
--- a/mod_muc_moderation/mod_muc_moderation.lua Sat Nov 06 16:19:38 2021 +0100
+++ b/mod_muc_moderation/mod_muc_moderation.lua Sat Nov 06 19:03:00 2021 +0100
@@ -63,6 +63,13 @@
return true;
end
+ if not actor_nick then
+ local reserved_nickname = room:get_affiliation_data(jid.bare(actor), "reserved_nickname");
+ if reserved_nickname then
+ actor_nick = jid.join(room.jid, reserved_nickname);
+ end
+ end
+
-- Original stanza to base tombstone on
local original, err;
if muc_log_archive.get then