mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-03 05:59:25 +00:00
353a1fe0a0
* Rewrite following activities * Rewrite person apub * Rewrite community apub * Rewrite private message activity sending
32 lines
623 B
Rust
32 lines
623 B
Rust
use crate::ActorType;
|
|
use lemmy_db_schema::source::person::Person;
|
|
use url::Url;
|
|
|
|
impl ActorType for Person {
|
|
fn is_local(&self) -> bool {
|
|
self.local
|
|
}
|
|
fn actor_id(&self) -> Url {
|
|
self.actor_id.to_owned().into_inner()
|
|
}
|
|
fn name(&self) -> String {
|
|
self.name.clone()
|
|
}
|
|
|
|
fn public_key(&self) -> Option<String> {
|
|
self.public_key.to_owned()
|
|
}
|
|
|
|
fn private_key(&self) -> Option<String> {
|
|
self.private_key.to_owned()
|
|
}
|
|
|
|
fn get_shared_inbox_or_inbox_url(&self) -> Url {
|
|
self
|
|
.shared_inbox_url
|
|
.clone()
|
|
.unwrap_or_else(|| self.inbox_url.to_owned())
|
|
.into()
|
|
}
|
|
}
|