mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-01 00:28:05 +00:00
6f513793cb
* update activitypub-federation crate to 0.4.0 * fixes * apub compiles! * everything compiling! * almost done, federated follow failing * some test fixes * use release * add code back in
35 lines
1 KiB
Rust
35 lines
1 KiB
Rust
use activitypub_federation::kinds::collection::CollectionType;
|
|
use lemmy_api_common::{context::LemmyContext, utils::generate_followers_url};
|
|
use lemmy_db_schema::source::community::Community;
|
|
use lemmy_db_views_actor::structs::CommunityFollowerView;
|
|
use lemmy_utils::error::LemmyError;
|
|
use serde::{Deserialize, Serialize};
|
|
use url::Url;
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub(crate) struct GroupFollowers {
|
|
id: Url,
|
|
r#type: CollectionType,
|
|
total_items: i32,
|
|
items: Vec<()>,
|
|
}
|
|
|
|
impl GroupFollowers {
|
|
pub(crate) async fn new(
|
|
community: Community,
|
|
context: &LemmyContext,
|
|
) -> Result<GroupFollowers, LemmyError> {
|
|
let community_id = community.id;
|
|
let community_followers =
|
|
CommunityFollowerView::for_community(context.pool(), community_id).await?;
|
|
|
|
Ok(GroupFollowers {
|
|
id: generate_followers_url(&community.actor_id)?.into(),
|
|
r#type: CollectionType::Collection,
|
|
total_items: community_followers.len() as i32,
|
|
items: vec![],
|
|
})
|
|
}
|
|
}
|