Notifs only sent for BotAdmins

This commit is contained in:
ModulatingForce 2024-03-25 11:55:16 -04:00
parent 10d25bf34f
commit c0603739c9

View file

@ -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