fix: remove void communities from chats

This commit is contained in:
trisua 2025-04-27 23:37:48 -04:00
parent 838b9c1304
commit 81e44d402c

View file

@ -37,9 +37,15 @@ impl DataManager {
/// Replace a list of community memberships with the proper community. /// Replace a list of community memberships with the proper community.
pub async fn fill_communities(&self, list: Vec<CommunityMembership>) -> Result<Vec<Community>> { pub async fn fill_communities(&self, list: Vec<CommunityMembership>) -> Result<Vec<Community>> {
let mut communities: Vec<Community> = Vec::new(); let mut communities: Vec<Community> = Vec::new();
for membership in &list { for membership in &list {
if membership.community == 0 {
continue;
}
communities.push(self.get_community_by_id(membership.community).await?); communities.push(self.get_community_by_id(membership.community).await?);
} }
Ok(communities) Ok(communities)
} }