diff mod_muc_restrict_media/mod_muc_restrict_media.lua @ 4962:5a3031613dbc

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.
author Kim Alvefur <zash@zash.se>
date Mon, 20 Jun 2022 18:24:32 +0200
parents e9ac68f9bc16
children 1682166171ff
line wrap: on
line diff
--- 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