mod_muc_restrict_media: Don't apply restriction to affiliated users
authorKim Alvefur <zash@zash.se>
Mon, 20 Jun 2022 18:24:32 +0200
changeset 4966 5a3031613dbc
parent 4965 18774cc621d6
child 4967 479d618c9e6d
mod_muc_restrict_media: Don't apply restriction to affiliated users Looks like an oversight. Assuming that all truthy affiliations are valid, and that "outcast" would not reach this point anyway.
mod_muc_restrict_media/mod_muc_restrict_media.lua
--- a/mod_muc_restrict_media/mod_muc_restrict_media.lua	Tue Jun 14 19:08:57 2022 +0200
+++ b/mod_muc_restrict_media/mod_muc_restrict_media.lua	Mon Jun 20 18:24:32 2022 +0200
@@ -63,6 +63,7 @@
 module:hook("muc-occupant-groupchat", function (event)
 	local stanza = event.stanza;
 	if stanza.attr.type ~= "groupchat" then return; end
+	if event.room:get_affiliation(stanza.attr.from) then return end
 	if should_restrict_media(event.room) then
 		stanza:maptags(filter_media_tags);
 	end