2024.02.04 - LATEST PROBLEM
This commit is contained in:
parent
768bb5f03a
commit
8d4db0c657
8 changed files with 815 additions and 121 deletions
src/core
|
@ -1,21 +1,32 @@
|
|||
|
||||
use std::borrow::Borrow;
|
||||
use std::collections::HashMap;
|
||||
use std::error::Error;
|
||||
|
||||
use crate::core::botmodules::{ModulesManager,Listener,BotModule,BotActionTrait, BotCommand};
|
||||
use crate::core::botmodules::bot_actions::actions_util;
|
||||
|
||||
use crate::core::botinstance::{self};
|
||||
use crate::core::botinstance::{self,BotInstance};
|
||||
use futures::lock::Mutex;
|
||||
use twitch_irc::message::{Badge, PrivmsgMessage};
|
||||
|
||||
use crate::core::botmodules::ChType;
|
||||
|
||||
use crate::core::botinstance::ArcBox;
|
||||
|
||||
|
||||
use std::rc::Rc;
|
||||
use std::cell::RefCell;
|
||||
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
fn adminvector() -> Vec<String> {
|
||||
vec![String::from("ModulatingForce")]
|
||||
}
|
||||
|
||||
|
||||
pub fn init(mgr:&mut ModulesManager)
|
||||
// pub fn init(mgr:&mut ModulesManager)
|
||||
pub fn init(mgr:Arc<Mutex<ModulesManager>>)
|
||||
{
|
||||
|
||||
BotCommand {
|
||||
|
@ -32,7 +43,8 @@ pub fn init(mgr:&mut ModulesManager)
|
|||
],
|
||||
}.add_to_modmgr(mgr);
|
||||
|
||||
async fn cmd_promote(bot:botinstance::BotManagers,msg:PrivmsgMessage) {
|
||||
async fn cmd_promote(mut bot:Arc<Mutex<BotInstance>>,msg:PrivmsgMessage)
|
||||
{
|
||||
//println!("(#{}) {}: {}", msg.channel_login, msg.sender.name, msg.message_text);
|
||||
println!("Called cmd promote");
|
||||
|
||||
|
@ -63,6 +75,8 @@ pub fn init(mgr:&mut ModulesManager)
|
|||
|
||||
*/
|
||||
|
||||
//let bot = Rcbot;
|
||||
|
||||
println!("{}",msg.message_text);
|
||||
let mut argv = msg.message_text.split(" ");
|
||||
|
||||
|
@ -84,21 +98,104 @@ pub fn init(mgr:&mut ModulesManager)
|
|||
|
||||
|
||||
match arg1 {
|
||||
Some(a) if a == String::from("admin") => {
|
||||
Some(a1) if a1 == String::from("admin") => {
|
||||
// - BotAdmins can promote admin to give BotAdmin UserRole
|
||||
let a = bot.identity.getspecialuserroles(msg.sender.name.to_lowercase(), Some(ChType::Channel(msg.channel_login.to_lowercase())));
|
||||
//let mut bot = Rc::clone(&bot);
|
||||
// let a = bot.botmgrs.identity.getspecialuserroles(msg.sender.name.to_lowercase(), Some(ChType::Channel(msg.channel_login.to_lowercase())));
|
||||
// let a = Rc::try_unwrap(bot).ok().unwrap().into_inner().botmgrs.identity.getspecialuserroles(msg.sender.name.to_lowercase(), Some(ChType::Channel(msg.channel_login.to_lowercase())));
|
||||
// let a = Rc::try_unwrap(bot.clone()).ok().unwrap().into_inner().botmgrs.identity.getspecialuserroles(msg.sender.name.to_lowercase(), Some(ChType::Channel(msg.channel_login.to_lowercase())));
|
||||
|
||||
// let a = Rc::try_unwrap(bot).ok().unwrap()
|
||||
// // .borrow_mut()
|
||||
// .into_inner()
|
||||
// .botmgrs
|
||||
// .identity
|
||||
// .getspecialuserroles(msg.sender.name.to_lowercase(),
|
||||
// Some(ChType::Channel(msg.channel_login.to_lowercase())));
|
||||
// let p = Rc::try_unwrap(bot.clone())
|
||||
// let p = Arc::try_unwrap(bot.clone())
|
||||
// .ok()
|
||||
// .unwrap()
|
||||
// //.into_inner()
|
||||
// //.to_owned()
|
||||
// // .get_mut()
|
||||
// .into_inner();
|
||||
// // .ok()
|
||||
// // .unwrap();
|
||||
// // let p = p.ok().unwrap();
|
||||
|
||||
// let p = bot.lock().await.get_identity();
|
||||
// let p = p.lock().await;
|
||||
// let ta = p.getspecialuserroles(String::from("Hello"), Some(ChType::Channel(msg.channel_login.to_lowercase()))).await;
|
||||
// // let ta = *ta.await;
|
||||
// let ta = *ta.lock().await;
|
||||
|
||||
// if let Some(a) = ta {
|
||||
|
||||
|
||||
let p = bot.lock().await.get_identity();
|
||||
let mut p = p.lock().await;
|
||||
let ta = p.getspecialuserroles(String::from("Hello"), Some(ChType::Channel(msg.channel_login.to_lowercase()))).await;
|
||||
|
||||
if let Some(a) = ta {
|
||||
|
||||
if let Some(a) = a {
|
||||
if a.contains(&UserRole::BotAdmin) {
|
||||
println!("BotAdmin allowed to promote admin");
|
||||
match bot.identity.promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// Success(_) => {
|
||||
// ;
|
||||
// },
|
||||
ChangeResult::Success(a) => println!("Succesfully promoted : {a} ;"),
|
||||
ChangeResult::Failed(a) => println!("Failed to promote : {a} ; "),
|
||||
ChangeResult::NoChange(a) => println!("No Changes Made : {a} ; "),
|
||||
// let bota = Rc::clone(&bot);
|
||||
// let bota = Rc::get_mut(&bota);
|
||||
// match bota.botmgrs.identity.promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
//let mut bot = Rc::clone(&bot);
|
||||
// let bot = Rc::<&botinstance::BotInstance>::get_mut(&mut bot);
|
||||
// let mut bot = Rc::make_mut(&mut bot);
|
||||
// let mut bot = Rc::make_mut(&bot);
|
||||
// match Rc::<&botinstance::BotInstance>::get_mut(bot) {
|
||||
// Some(bot) => {
|
||||
// match bot.botmgrs.identity.promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// // Success(_) => {
|
||||
// // ;
|
||||
// // },
|
||||
// ChangeResult::Success(a) => println!("Succesfully promoted : {a} ;"),
|
||||
// ChangeResult::Failed(a) => println!("Failed to promote : {a} ; "),
|
||||
// ChangeResult::NoChange(a) => println!("No Changes Made : {a} ; "),
|
||||
|
||||
// }
|
||||
// },
|
||||
// None => (),
|
||||
// }
|
||||
//let bot = Rc::<botinstance::BotInstance>::make_mut(bot);
|
||||
// match Rc::<IdentityManager>::make_mut(&mut Rc::new(bot.botmgrs.identity)).promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// match Rc::try_unwrap(bot.clone()).ok().unwrap().into_inner().botmgrs.identity.promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// match Arc::try_unwrap(bot.clone()).ok().unwrap().into_inner().ok().unwrap().botmgrs.identity.promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// match Arc::try_unwrap(bot.clone()).ok().unwrap().into_inner().botmgrs.identity.promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// match bot.read().ok().unwrap().get_identity().promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// let a = bot.get_mut();
|
||||
// match a.get_identity().promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// let a = (*bot).clone();
|
||||
{
|
||||
// let a = bot.lock().await.get_botmgrs().clone();
|
||||
// let a = bot.lock().await;
|
||||
// let mut mutex = Arc::clone(&bot);
|
||||
// match mutex.get_mut().get_identity().promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)) {
|
||||
// slet ee = ArcBox(bot);
|
||||
// println!("tester: {:?}",(*bot).lock().await.get_prefix());
|
||||
// let mutex = Arc::clone(&bot);
|
||||
// let mut mutex2 = Arc::new(*mutex).into_inner().get_identity();
|
||||
// let mut mutex2 = Arc::clone(&mutex).into_inner().get_identity();
|
||||
// let a = (*bot).lock().await.get_identity();
|
||||
// let mut a = a.lock().await;
|
||||
let p = bot.lock().await.get_identity();
|
||||
let mut p = p.lock().await;
|
||||
let ta = p.promote(msg.sender.name.to_lowercase(), None, Some(UserRole::BotAdmin)).await;
|
||||
|
||||
match ta {
|
||||
// Success(_) => {
|
||||
// ;
|
||||
// },
|
||||
ChangeResult::Success(a) => println!("Succesfully promoted : {a} ;"),
|
||||
ChangeResult::Failed(a) => println!("Failed to promote : {a} ; "),
|
||||
ChangeResult::NoChange(a) => println!("No Changes Made : {a} ; "),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +248,7 @@ pub fn init(mgr:&mut ModulesManager)
|
|||
}.add_to_modmgr(mgr);
|
||||
|
||||
|
||||
async fn cmd_demote(mut _chat:botinstance::BotManagers,_msg:PrivmsgMessage) {
|
||||
async fn cmd_demote(mut _chat:Arc<Mutex<BotInstance>>,_msg:PrivmsgMessage) {
|
||||
println!("Called cmd demote");
|
||||
}
|
||||
|
||||
|
@ -172,7 +269,7 @@ pub fn init(mgr:&mut ModulesManager)
|
|||
}.add_to_modmgr(mgr);
|
||||
|
||||
|
||||
async fn getroles(bot:botinstance::BotManagers,msg:PrivmsgMessage) {
|
||||
async fn getroles(bot:Arc<Mutex<BotInstance>>,msg:PrivmsgMessage) {
|
||||
println!("Called cmd getroles");
|
||||
|
||||
/*
|
||||
|
@ -224,17 +321,57 @@ pub fn init(mgr:&mut ModulesManager)
|
|||
|
||||
let targetchnl = arg2;
|
||||
|
||||
match targetchnl {
|
||||
// // let a = bot.read().ok().unwrap().get_identity();
|
||||
// let a = bot.lock().await;
|
||||
// // let a = a.lock().await;
|
||||
// // let a = a.get_identity().await;
|
||||
// let a = a.botmgrs;
|
||||
// // let a = *(*a).lock().await;
|
||||
// let a = *a.lock().await;
|
||||
// let a = a.identity;
|
||||
// let a = *a.lock().await;
|
||||
|
||||
// let a = bot.clone();
|
||||
// let a = a.into_inner();
|
||||
// let a = a.botmgrs;
|
||||
// let a = a.into_inner();
|
||||
// let a = a.identity;
|
||||
// let a = a.into_inner();
|
||||
let a = bot.clone();
|
||||
let a = a.lock().await;
|
||||
let a = a.get_identity().await;
|
||||
// let a = a.lock().await;
|
||||
let sproles = match targetchnl {
|
||||
None => {
|
||||
let a = bot.identity.getspecialuserroles(String::from(targetuser),None);
|
||||
println!("Retrieved User Roles >> {:?}",a);
|
||||
// let bot = Rc::clone(&bot);
|
||||
//let bot = Arc::clone(&bot);
|
||||
// let a = bot.botmgrs.identity.getspecialuserroles(String::from(targetuser),None);
|
||||
// let a = Arc::try_unwrap(bot).ok().unwrap().into_inner().ok().unwrap();
|
||||
// let a = Arc::try_unwrap(bot.clone()).ok().unwrap().into_inner();
|
||||
// let a = a.botmgrs.identity.getspecialuserroles(String::from(targetuser),None);
|
||||
// let a = a.ok().getspecialuserroles(String::from(targetuser),None);
|
||||
// let a = bot.read().ok().unwrap().rIdentity().getspecialuserroles(String::from(targetuser),None);
|
||||
// println!("Retrieved User Roles >> {:?}",a);
|
||||
a.lock().await.getspecialuserroles(String::from(targetuser),None).await
|
||||
},
|
||||
Some(targetchnl) => {
|
||||
let a = bot.identity.getspecialuserroles(String::from(targetuser), Some(ChType::Channel(String::from(targetchnl))));
|
||||
println!("Retrieved User Roles >> {:?}",a);
|
||||
},
|
||||
}
|
||||
// let bot = Rc::clone(&bot);
|
||||
// let bot = Arc::clone(&bot);
|
||||
// let a = bot.botmgrs.identity.getspecialuserroles(String::from(targetuser), Some(ChType::Channel(String::from(targetchnl))));
|
||||
// Arc::try_unwrap(boxed_bot.clone()).ok().unwrap().into_inner()
|
||||
// let a = Arc::try_unwrap(bot).ok().unwrap().into_inner().ok().unwrap();
|
||||
// let a = Arc::try_unwrap(bot.clone()).ok().unwrap().into_inner();
|
||||
// let a = a.botmgrs.identity.getspecialuserroles(String::from(targetuser), Some(ChType::Channel(String::from(targetchnl))));
|
||||
// let a = bot.read().ok().unwrap().rIdentity().getspecialuserroles(String::from(targetuser),None);
|
||||
// println!("Retrieved User Roles >> {:?}",a);
|
||||
// bot.read().ok().unwrap().rIdentity().getspecialuserroles(String::from(targetuser),None)
|
||||
a.lock().await.getspecialuserroles(String::from(targetuser),None).await
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
println!("Retrieved User Roles >> {:?}",sproles);
|
||||
|
||||
// let a = bot.identity.getuserroles(String::from("ModulatingForce"), Some(ChType::Channel(String::from("ModulatingForcebot"))));
|
||||
// println!("{:?}",a);
|
||||
|
@ -271,7 +408,8 @@ pub enum Permissible {
|
|||
|
||||
#[derive(Clone)]
|
||||
pub struct IdentityManager {
|
||||
special_roles_users : HashMap<String,Vec<UserRole>>, // # <-- (!) This must be String instead of ChType because we're checking a User not a Channel
|
||||
// special_roles_users : HashMap<String,Vec<UserRole>>, // # <-- (!) This must be String instead of ChType because we're checking a User not a Channel
|
||||
special_roles_users : Arc<Mutex<HashMap<String,Vec<UserRole>>>>, // # <-- (!) This must be String instead of ChType because we're checking a User not a Channel
|
||||
// parent_mgr : Box<crate::core::botinstance::BotManagers>,
|
||||
//parent_mgr : Option<Box<crate::core::botinstance::BotManagers>>,
|
||||
}
|
||||
|
@ -298,7 +436,7 @@ impl IdentityManager {
|
|||
};
|
||||
|
||||
IdentityManager {
|
||||
special_roles_users : a,
|
||||
special_roles_users : Arc::new(Mutex::new(a)),
|
||||
//parent_mgr : None,
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +444,8 @@ impl IdentityManager {
|
|||
// [ ] Maybe I should create a can_user_run version that simply takes PrvMsg, but then calls can_user_run directly
|
||||
|
||||
// pub fn can_user_run_PRVMSG(self,msg:&PrivmsgMessage,cmdreqroles:Vec<UserRole>) -> Result<Permissible,Box<dyn Error>>
|
||||
pub fn can_user_run_PRVMSG(self,msg:&PrivmsgMessage,cmdreqroles:Vec<UserRole>) -> Permissible
|
||||
// pub fn can_user_run_PRVMSG(&self,msg:&PrivmsgMessage,cmdreqroles:Vec<UserRole>) -> Permissible
|
||||
pub async fn can_user_run_PRVMSG(self,msg:&PrivmsgMessage,cmdreqroles:Vec<UserRole>) -> Permissible
|
||||
{
|
||||
// println!("(#{}) {}: {}", msg.channel_login, msg.sender.name, msg.message_text);
|
||||
|
||||
|
@ -331,11 +470,28 @@ impl IdentityManager {
|
|||
// ChType::Channel(msg.channel_login.to_owned()),
|
||||
// sender_badge,
|
||||
// cmdreqroles
|
||||
return self.can_user_run(msg.sender.name.to_owned(),
|
||||
ChType::Channel(msg.channel_login.to_owned()),
|
||||
sender_badge,
|
||||
cmdreqroles
|
||||
) ;
|
||||
// return self.can_user_run(msg.sender.name.to_owned(),
|
||||
// let a = Arc::new(Mutex::new(self));
|
||||
// let mut a = a.lock().await;
|
||||
// let a = **a;
|
||||
// let a = a.can_user_run(msg.sender.name.to_owned(),
|
||||
// ChType::Channel(msg.channel_login.to_owned()),
|
||||
// sender_badge,
|
||||
// cmdreqroles
|
||||
// ) ;
|
||||
// let a = *self;
|
||||
// let a = Arc::new(Mutex::new(a));
|
||||
// let a = a.lock().await.can_user_run(msg.sender.name.to_owned(),
|
||||
// ChType::Channel(msg.channel_login.to_owned()),
|
||||
// sender_badge,
|
||||
// cmdreqroles
|
||||
// ) ;
|
||||
// return a;
|
||||
self.can_user_run(msg.sender.name.to_owned(),
|
||||
ChType::Channel(msg.channel_login.to_owned()),
|
||||
sender_badge,
|
||||
cmdreqroles
|
||||
) ;
|
||||
}
|
||||
|
||||
|
||||
|
@ -344,7 +500,7 @@ impl IdentityManager {
|
|||
Permissible::Block
|
||||
}
|
||||
|
||||
pub fn can_user_run(mut self,
|
||||
pub async fn can_user_run(&self,
|
||||
usr:String,
|
||||
channelname:ChType,
|
||||
chat_badge:ChatBadge,
|
||||
|
@ -424,7 +580,8 @@ impl IdentityManager {
|
|||
|
||||
// let Some((k,v)) = self.special_roles_users.get_key_value(usr);
|
||||
// match self.special_roles_users.get_mut(&usr.to_lowercase()) {
|
||||
match self.special_roles_users.get(&usr.to_lowercase()) {
|
||||
// match self.special_roles_users.get(&usr.to_lowercase()) {
|
||||
match self.special_roles_users.lock().await.get(&usr.to_lowercase()) {
|
||||
Some(usrroles) => {
|
||||
// println!("contains mod : {}", usrroles.contains(&UserRole::Mod(channelname.clone())));
|
||||
// println!("contains supmod : {}", usrroles.contains(&UserRole::SupMod(channelname.clone())));
|
||||
|
@ -437,6 +594,7 @@ impl IdentityManager {
|
|||
// usrroles.push(UserRole::Mod(channelname.clone()));
|
||||
// a.push(UserRole::Mod(channelname.clone()));
|
||||
self.special_roles_users
|
||||
.lock().await
|
||||
.get_mut(&usr.to_lowercase())
|
||||
.expect("ERROR")
|
||||
.push(UserRole::Mod(channelname.clone()));
|
||||
|
@ -463,7 +621,7 @@ impl IdentityManager {
|
|||
|
||||
println!("Mod Role required");
|
||||
|
||||
if let Some(a) = self.special_roles_users.get(&usr.to_lowercase()) {
|
||||
if let Some(a) = self.special_roles_users.lock().await.get(&usr.to_lowercase()) {
|
||||
if a.contains(&UserRole::Mod(channelname.clone())) || a.contains(&UserRole::SupMod(channelname.clone())){
|
||||
// return Ok(Permissible::Allow);
|
||||
return Permissible::Allow
|
||||
|
@ -476,7 +634,7 @@ impl IdentityManager {
|
|||
|
||||
|
||||
if cmdreqroles.contains(&UserRole::SupMod(ChType::Channel(String::new()))) {
|
||||
if let Some(a) = self.special_roles_users.get(&usr.to_lowercase()) {
|
||||
if let Some(a) = self.special_roles_users.lock().await.get(&usr.to_lowercase()) {
|
||||
if a.contains(&UserRole::SupMod(channelname.clone())) {
|
||||
// return Ok(Permissible::Allow);
|
||||
return Permissible::Allow
|
||||
|
@ -490,8 +648,8 @@ impl IdentityManager {
|
|||
println!("Eval cmdreqroles with botadmin : {}",cmdreqroles.contains(&UserRole::BotAdmin));
|
||||
|
||||
if cmdreqroles.contains(&UserRole::BotAdmin) {
|
||||
println!("special roles get : {:?}",self.special_roles_users.get(&usr.to_lowercase()));
|
||||
if let Some(a) = self.special_roles_users.get(&usr.to_lowercase()) {
|
||||
println!("special roles get : {:?}",self.special_roles_users.lock().await.get(&usr.to_lowercase()));
|
||||
if let Some(a) = self.special_roles_users.lock().await.get(&usr.to_lowercase()) {
|
||||
println!("special roles contains BotAdmin: {}",a.contains(&UserRole::BotAdmin));
|
||||
if a.contains(&UserRole::BotAdmin) {
|
||||
// return Ok(Permissible::Allow);
|
||||
|
@ -503,20 +661,31 @@ impl IdentityManager {
|
|||
Permissible::Block
|
||||
}
|
||||
|
||||
pub fn promote(mut self,trgchatter:String,channel:Option<ChType>,trg_role:Option<UserRole>) -> ChangeResult {
|
||||
pub async fn promote(&mut self,trgchatter:String,channel:Option<ChType>,trg_role:Option<UserRole>) -> ChangeResult {
|
||||
|
||||
// Note : If channel is none, getspecialuserroles() returns all roles for the user
|
||||
|
||||
// let chatterroles = self.getspecialuserroles(trgchatter, channel);
|
||||
|
||||
let chatterroles = self.getspecialuserroles(trgchatter.clone(), channel.clone());
|
||||
// let chatterroles = self.getspecialuserroles(trgchatter.clone(), channel.clone());
|
||||
// let chatterroles = *self.getspecialuserroles(trgchatter.clone(), channel.clone()).await;
|
||||
// let chatterroles = chatterroles.lock().await;
|
||||
// // let chatterroles = *chatterroles;
|
||||
// let chatterroles = chatterroles.unwrap();
|
||||
|
||||
let emptyvec = vec![];
|
||||
|
||||
let chatterroles = match chatterroles {
|
||||
Some(a) => a,
|
||||
_ => &(emptyvec),
|
||||
};
|
||||
let chatterroles = self.getspecialuserroles(trgchatter.clone(), channel.clone()).await;
|
||||
// let chatterroles = chatterroles.lock().await;
|
||||
// let chatterroles = *chatterroles;
|
||||
let chatterroles = chatterroles.unwrap();
|
||||
|
||||
|
||||
// let emptyvec = vec![];
|
||||
|
||||
// let chatterroles = match chatterroles {
|
||||
// Some(a) => a,
|
||||
// _ => &(emptyvec),
|
||||
// };
|
||||
|
||||
|
||||
match trg_role {
|
||||
|
@ -528,6 +697,7 @@ impl IdentityManager {
|
|||
// # otherwise, trg_role for the given chnl is not assigned to the trgchatter
|
||||
// chatterroles.push(UserRole::Mod(trg_chnl.clone()));
|
||||
self.special_roles_users
|
||||
.lock().await
|
||||
.get_mut(&trgchatter)
|
||||
.expect("Error getting roles")
|
||||
.push(UserRole::Mod(trg_chnl));
|
||||
|
@ -615,7 +785,7 @@ impl IdentityManager {
|
|||
ChangeResult::Success(String::from("TEST > Promotion Successful"))
|
||||
}
|
||||
|
||||
pub fn getspecialuserroles(&self,chattername:String,channel:Option<ChType>) -> Option<&Vec<UserRole>> {
|
||||
pub async fn getspecialuserroles(&self,chattername:String,channel:Option<ChType>) -> Option<Vec<UserRole>> {
|
||||
|
||||
// let a = chattername.to_lowercase();
|
||||
|
||||
|
@ -637,7 +807,21 @@ impl IdentityManager {
|
|||
|
||||
// println!("{a}");
|
||||
|
||||
self.special_roles_users.get(&a)
|
||||
// let b = self.special_roles_users.lock().await.get(&a);
|
||||
// match b
|
||||
// {
|
||||
// Some(b) => Some(*b),
|
||||
// None => None,
|
||||
// }
|
||||
|
||||
let b = self.special_roles_users.lock().await.remove(&a);
|
||||
let outp = b;
|
||||
// let b = Arc::new(Mutex::new(outp));
|
||||
outp
|
||||
|
||||
|
||||
// let b = Arc::new(Mutex::new(b));
|
||||
// b
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue