fix: remove void communities from chats
This commit is contained in:
parent
838b9c1304
commit
81e44d402c
1 changed files with 6 additions and 0 deletions
|
@ -37,9 +37,15 @@ impl DataManager {
|
|||
/// Replace a list of community memberships with the proper community.
|
||||
pub async fn fill_communities(&self, list: Vec<CommunityMembership>) -> Result<Vec<Community>> {
|
||||
let mut communities: Vec<Community> = Vec::new();
|
||||
|
||||
for membership in &list {
|
||||
if membership.community == 0 {
|
||||
continue;
|
||||
}
|
||||
|
||||
communities.push(self.get_community_by_id(membership.community).await?);
|
||||
}
|
||||
|
||||
Ok(communities)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue