mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-26 13:38:51 +00:00
Return forez status with advanced group information
This commit is contained in:
parent
3da9f26176
commit
82bb23640a
@ -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<ConversationAPI>,
|
||||
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),
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user