From 737d542ca88a87a1a5c9b6c0d678ea408205166f Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 27 May 2021 13:56:26 -0500 Subject: [PATCH] fix: Fixes av moderation logic when granting moderator. --- resources/prosody-plugins/mod_av_moderation_component.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/prosody-plugins/mod_av_moderation_component.lua b/resources/prosody-plugins/mod_av_moderation_component.lua index 65b3db17a..92ec0441d 100644 --- a/resources/prosody-plugins/mod_av_moderation_component.lua +++ b/resources/prosody-plugins/mod_av_moderation_component.lua @@ -64,7 +64,13 @@ function notify_whitelist_change(jid, moderators, room, mediaType) if moderators and occupant.role == 'moderator' then send_json_message(occupant.jid, moderators_body_json_str); elseif occupant.jid == jid then - send_json_message(occupant.jid, participant_body_json_str); + -- if the occupant is not moderator we send him that it is approved + -- if it is moderator we update him with the list, this is moderator joining or grant moderation was executed + if occupant.role == 'moderator' then + send_json_message(occupant.jid, moderators_body_json_str); + else + send_json_message(occupant.jid, participant_body_json_str); + end end end end