}
impl ActorType for UserOrCommunity {
- fn is_local(&self) -> bool {
- todo!()
- }
-
fn actor_id(&self) -> Url {
todo!()
}
- fn name(&self) -> String {
- todo!()
- }
-
fn public_key(&self) -> Option<String> {
match self {
UserOrCommunity::User(p) => p.public_key(),
}
impl ActorType for ApubCommunity {
- fn is_local(&self) -> bool {
- self.local
- }
fn actor_id(&self) -> Url {
self.actor_id.to_owned().into()
}
- fn name(&self) -> String {
- self.name.clone()
- }
fn public_key(&self) -> Option<String> {
self.public_key.to_owned()
}
}
impl ActorType for ApubPerson {
- fn is_local(&self) -> bool {
- self.local
- }
fn actor_id(&self) -> Url {
self.actor_id.to_owned().into()
}
- fn name(&self) -> String {
- self.name.clone()
- }
fn public_key(&self) -> Option<String> {
self.public_key.to_owned()
/// Common methods provided by ActivityPub actors (community and person). Not all methods are
/// implemented by all actors.
pub trait ActorType {
- fn is_local(&self) -> bool;
fn actor_id(&self) -> Url;
- fn name(&self) -> String;
// TODO: this should not be an option (needs db migration in lemmy)
fn public_key(&self) -> Option<String>;