From 82bb23640aabf144e8ba493a612111cd2759570c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 18 Apr 2021 14:45:37 +0200 Subject: [PATCH] Return forez status with advanced group information --- src/api_data/advanced_group_api.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api_data/advanced_group_api.rs b/src/api_data/advanced_group_api.rs index 5218072..3149c89 100644 --- a/src/api_data/advanced_group_api.rs +++ b/src/api_data/advanced_group_api.rs @@ -5,6 +5,7 @@ use serde::Serialize; use crate::api_data::conversation_api::ConversationAPI; use crate::api_data::group_api::GroupApi; +use crate::data::config::conf; use crate::data::error::ResultBoxError; use crate::data::group::Group; use crate::data::user::UserID; @@ -23,6 +24,7 @@ pub struct AdvancedGroupApi { number_likes: u64, is_liking: bool, conversations: Vec, + is_forez_group: bool, } impl AdvancedGroupApi { @@ -44,6 +46,7 @@ impl AdvancedGroupApi { number_likes: likes_helper::count(g.id.id(), LikeType::GROUP)? as u64, is_liking: likes_helper::is_liking(&user_id.unwrap_or(UserID::invalid()), g.id.id(), LikeType::GROUP)?, conversations: ConversationAPI::for_list(&conversations), + is_forez_group: conf().forez_groups.contains(&g.id), }) } } \ No newline at end of file