]> Untitled Git - lemmy.git/blob - crates/apub/src/activities/send/person.rs
Rewrite activitypub following, person, community, pm (#1692)
[lemmy.git] / crates / apub / src / activities / send / person.rs
1 use crate::ActorType;
2 use lemmy_db_schema::source::person::Person;
3 use url::Url;
4
5 impl ActorType for Person {
6   fn is_local(&self) -> bool {
7     self.local
8   }
9   fn actor_id(&self) -> Url {
10     self.actor_id.to_owned().into_inner()
11   }
12   fn name(&self) -> String {
13     self.name.clone()
14   }
15
16   fn public_key(&self) -> Option<String> {
17     self.public_key.to_owned()
18   }
19
20   fn private_key(&self) -> Option<String> {
21     self.private_key.to_owned()
22   }
23
24   fn get_shared_inbox_or_inbox_url(&self) -> Url {
25     self
26       .shared_inbox_url
27       .clone()
28       .unwrap_or_else(|| self.inbox_url.to_owned())
29       .into()
30   }
31 }