X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapub%2Fsrc%2Ffetcher%2Fuser_or_community.rs;h=156f5e83a6eb6f4969a69ef1576c8340d64e24cc;hb=d20d2b9218235b46c6076554184052269c510ba3;hp=da23ad59a180a85395d27aa9f325e12fa8f4b014;hpb=4ddca46228cdbdfccfdc59b3295519a6da2d74fa;p=lemmy.git diff --git a/crates/apub/src/fetcher/user_or_community.rs b/crates/apub/src/fetcher/user_or_community.rs index da23ad59..156f5e83 100644 --- a/crates/apub/src/fetcher/user_or_community.rs +++ b/crates/apub/src/fetcher/user_or_community.rs @@ -1,6 +1,7 @@ use crate::{ objects::{community::ApubCommunity, person::ApubPerson}, protocol::objects::{group::Group, person::Person}, + ActorType, }; use activitypub_federation::traits::{Actor, ApubObject}; use chrono::NaiveDateTime; @@ -114,3 +115,19 @@ impl Actor for UserOrCommunity { unimplemented!() } } + +impl ActorType for UserOrCommunity { + fn actor_id(&self) -> Url { + match self { + UserOrCommunity::User(u) => u.actor_id(), + UserOrCommunity::Community(c) => c.actor_id(), + } + } + + fn private_key(&self) -> Option { + match self { + UserOrCommunity::User(u) => u.private_key(), + UserOrCommunity::Community(c) => c.private_key(), + } + } +}