]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/fetcher/user_or_community.rs
Making public key required. Fixes #1934
[lemmy.git] / crates / apub / src / fetcher / user_or_community.rs
index e5bc49ba84b80e3255124bfb77317c66c1e627c7..00612cbbce9828e31aaa708b0195a8c6f2ec229c 100644 (file)
@@ -2,11 +2,12 @@ use crate::{
   objects::{community::ApubCommunity, person::ApubPerson},
   protocol::objects::{group::Group, person::Person},
 };
-use activitystreams::{chrono::NaiveDateTime, url::Url};
+use chrono::NaiveDateTime;
 use lemmy_apub_lib::traits::{ActorType, ApubObject};
 use lemmy_utils::LemmyError;
 use lemmy_websocket::LemmyContext;
 use serde::Deserialize;
+use url::Url;
 
 #[derive(Clone, Debug)]
 pub enum UserOrCommunity {
@@ -96,10 +97,13 @@ impl ApubObject for UserOrCommunity {
 
 impl ActorType for UserOrCommunity {
   fn actor_id(&self) -> Url {
-    todo!()
+    match self {
+      UserOrCommunity::User(p) => p.actor_id(),
+      UserOrCommunity::Community(p) => p.actor_id(),
+    }
   }
 
-  fn public_key(&self) -> Option<String> {
+  fn public_key(&self) -> String {
     match self {
       UserOrCommunity::User(p) => p.public_key(),
       UserOrCommunity::Community(p) => p.public_key(),