changeset 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 18774cc621d6
children 479d618c9e6d
files mod_muc_restrict_media/mod_muc_restrict_media.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
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