dev into main #15

Merged
modulatingforce merged 40 commits from dev into main 2024-02-25 11:31:11 -05:00
Showing only changes of commit b78a2cd2b9 - Show all commits

View file

@ -558,33 +558,27 @@ impl IdentityManager {
println!("Read lock on : Special_Roles_User"); // <-- after this is slightly different between working and problem
let mut roleslock = roleslock.write().await;
match (*roleslock).get(&usr.to_lowercase()) {
Some(usrroles) => { // <-- working got to this point
println!("contains mod : {}", usrroles.read().await.contains(&UserRole::Mod(channelname.clone())));
println!("contains supmod : {}", usrroles.read().await.contains(&UserRole::SupMod(channelname.clone())));
if usrroles.read().await.contains(&UserRole::Mod(channelname.clone())) ||
usrroles.read().await.contains(&UserRole::SupMod(channelname.clone())) {
Some(usrroles) if
usrroles.read().await.contains(&UserRole::Mod(channelname.clone())) ||
usrroles.read().await.contains(&UserRole::SupMod(channelname.clone())) => { // <-- working got to this point
// println!("contains mod : {}", usrroles.read().await.contains(&UserRole::Mod(channelname.clone())));
// println!("contains supmod : {}", usrroles.read().await.contains(&UserRole::SupMod(channelname.clone())));
// if usrroles.read().await.contains(&UserRole::Mod(channelname.clone())) ||
// usrroles.read().await.contains(&UserRole::SupMod(channelname.clone())) {
// Do nothing - this is expected
println!("Already a mod in roles");
} else {
// in this case, they have a ChatBadge::Mod but should have this for the channel
// let mut a = usrroles;
// usrroles.push(UserRole::Mod(channelname.clone()));
// a.push(UserRole::Mod(channelname.clone()));
println!("Was in the else loop");
// let a = &*self;
// let mut lock = a.special_roles_users.write().await;
println!("lock created > adding with a mod role o7");
roleslock.get_mut(&usr.to_lowercase())
// .expect("ERROR")
.unwrap()
.write().await
// .get_mut()
.push(UserRole::Mod(channelname.clone()));
// println!("lock created > adding with a mod role o7");
// roleslock.get_mut(&usr.to_lowercase())
// // .expect("ERROR")
// .unwrap()
// .write().await
// // .get_mut()
// .push(UserRole::Mod(channelname.clone()));
// println!("debug special roles : {:?}",self.special_roles_users);
}
},
}
_ => {
println!("lock created > adding with a mod role o7");
roleslock.get_mut(&usr.to_lowercase())
@ -593,7 +587,7 @@ impl IdentityManager {
.write().await
// .get_mut()
.push(UserRole::Mod(channelname.clone()));
}// <-- I'm assuming problem got to here
} // <-- I'm assuming problem got to here
}
},