This commit is contained in:
Alex Emmet 2025-11-21 22:30:52 +01:00
commit 25ee0246de
5 changed files with 173 additions and 43 deletions

View file

@ -15,6 +15,9 @@ pub async fn add_community(community: Arc<Community>) {
.await
.insert(community.get_name().to_string(), community);
}
pub async fn remove_community(name: &str) {
COMMUNITY_REGISTRY.lock().await.remove(name);
}
pub async fn get_community(name: &str) -> Option<Arc<Community>> {
if let Some(c) = COMMUNITY_REGISTRY.lock().await.get(name) {
Some(c.clone())