-#[async_trait::async_trait(?Send)]
-impl ApubObject for ApubCommunityModerators {
- type DataType = CommunityContext;
- type TombstoneType = ();
- type ApubType = GroupModerators;
-
- fn last_refreshed_at(&self) -> Option<NaiveDateTime> {
- None
- }
-
- #[tracing::instrument(skip_all)]
- async fn read_from_apub_id(
- _object_id: Url,
- data: &Self::DataType,
- ) -> Result<Option<Self>, LemmyError> {
- // Only read from database if its a local community, otherwise fetch over http
- if data.0.local {
- let cid = data.0.id;
- let moderators = blocking(data.1.pool(), move |conn| {
- CommunityModeratorView::for_community(conn, cid)
- })
- .await??;
- Ok(Some(ApubCommunityModerators(moderators)))
- } else {
- Ok(None)
- }
- }
+#[async_trait::async_trait]
+impl Collection for ApubCommunityModerators {
+ type Owner = ApubCommunity;
+ type DataType = LemmyContext;
+ type Kind = GroupModerators;
+ type Error = LemmyError;