fix identity so case insensitive
This commit is contained in:
parent
2d5fa269de
commit
cbaad60557
1 changed files with 7 additions and 1 deletions
|
@ -1461,6 +1461,9 @@ impl IdentityManager {
|
||||||
|
|
||||||
// [x] 1. Check if Authorizer Mod Badge then Auto Promote to Mod if not Mod
|
// [x] 1. Check if Authorizer Mod Badge then Auto Promote to Mod if not Mod
|
||||||
|
|
||||||
|
|
||||||
|
let trgchatter = trgchatter.to_lowercase();
|
||||||
|
|
||||||
let (authusrroles,trgusrroles) = if let Some(channel) = channel.clone() {
|
let (authusrroles,trgusrroles) = if let Some(channel) = channel.clone() {
|
||||||
let mut authusrroles = self.getspecialuserroles(
|
let mut authusrroles = self.getspecialuserroles(
|
||||||
authorizer.to_lowercase().clone(),
|
authorizer.to_lowercase().clone(),
|
||||||
|
@ -2073,6 +2076,9 @@ impl IdentityManager {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// [x] 1. If Authorizer's Badge is Mod, ensuring Sender is in DB as Mod(Channel)
|
// [x] 1. If Authorizer's Badge is Mod, ensuring Sender is in DB as Mod(Channel)
|
||||||
|
|
||||||
|
let trgchatter = trgchatter.to_lowercase();
|
||||||
|
|
||||||
if let Some(channel) = channel {
|
if let Some(channel) = channel {
|
||||||
let mut authusrroles = self.getspecialuserroles(
|
let mut authusrroles = self.getspecialuserroles(
|
||||||
authorizer.to_lowercase().clone(),
|
authorizer.to_lowercase().clone(),
|
||||||
|
@ -2156,7 +2162,7 @@ impl IdentityManager {
|
||||||
!trgusrroles.contains(&UserRole::SupMod(channel.clone())) {
|
!trgusrroles.contains(&UserRole::SupMod(channel.clone())) {
|
||||||
return ChangeResult::Failed("Target chatter does not have a role that can be demoted".to_string())
|
return ChangeResult::Failed("Target chatter does not have a role that can be demoted".to_string())
|
||||||
}
|
}
|
||||||
// [x] 4d. WHhen they're only a Mod
|
// [x] 4d. When they're only a Mod
|
||||||
else if authusrroles.contains(&UserRole::Mod(channel.clone())) {
|
else if authusrroles.contains(&UserRole::Mod(channel.clone())) {
|
||||||
return ChangeResult::Failed("You're not permitted to do that".to_string())
|
return ChangeResult::Failed("You're not permitted to do that".to_string())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue