From c0603739c91ab03a0fe8ce9aa310c70d172ddc89 Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Mon, 25 Mar 2024 11:55:16 -0400 Subject: [PATCH] Notifs only sent for BotAdmins --- src/core/chat.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/chat.rs b/src/core/chat.rs index e82fd0a..c36fcf7 100644 --- a/src/core/chat.rs +++ b/src/core/chat.rs @@ -311,10 +311,15 @@ impl Chat { // if !(user_roles.contains(&identity::UserRole::Mod(Channel(channel_login.clone()))) // || user_roles.contains(&identity::UserRole::SupMod(Channel(channel_login.clone()))) // || user_roles.contains(&identity::UserRole::Broadcaster)) + // if !(user_roles.contains(&identity::UserRole::Mod(Channel(channel_login.clone()))) + // || user_roles.contains(&identity::UserRole::SupMod(Channel(channel_login.clone()))) + // || user_roles.contains(&identity::UserRole::Broadcaster) + // || user_roles.contains(&identity::UserRole::BotAdmin)) + if !(user_roles.contains(&identity::UserRole::Mod(Channel(channel_login.clone()))) || user_roles.contains(&identity::UserRole::SupMod(Channel(channel_login.clone()))) || user_roles.contains(&identity::UserRole::Broadcaster) - || user_roles.contains(&identity::UserRole::BotAdmin)) + ) { @@ -328,8 +333,10 @@ impl Chat { match msginput { BotMsgType::Notif(_) => { - // If the BotMsg is an Error Notification , and the Sender does not have Specific Roles in the Source Channel Sent (where the Error Notif will be sent) - return // return in this case - the User should not see a notification if this path is reached + // If Sender is Not a BotAdmin, don't do anything about the notification and return + if !user_roles.contains(&identity::UserRole::BotAdmin) { + return; + } }, BotMsgType::SayInReplyTo(_,_ ) | BotMsgType::Say(_,_) => { // If the BotMsg a Say/SayInReplyTo (from Developer or Chatter) , and the Sender does not have Specific Roles in the Source Channel Sent