2024-04-11 00:27:17 +02:00
|
|
|
use crate::{Object, Link};
|
|
|
|
|
|
|
|
pub const PUBLIC : &str = "https://www.w3.org/ns/activitystreams#Public";
|
|
|
|
|
2024-05-02 02:58:19 +02:00
|
|
|
pub trait Addressed {
|
2024-04-11 00:27:17 +02:00
|
|
|
fn addressed(&self) -> Vec<String>;
|
|
|
|
}
|
|
|
|
|
2024-05-19 21:19:22 +02:00
|
|
|
impl<T: Object> Addressed for T {
|
2024-04-11 00:27:17 +02:00
|
|
|
fn addressed(&self) -> Vec<String> {
|
|
|
|
let mut to : Vec<String> = self.to().map(|x| x.href().to_string()).collect();
|
|
|
|
to.append(&mut self.bto().map(|x| x.href().to_string()).collect());
|
|
|
|
to.append(&mut self.cc().map(|x| x.href().to_string()).collect());
|
|
|
|
to.append(&mut self.bcc().map(|x| x.href().to_string()).collect());
|
|
|
|
to
|
|
|
|
}
|
|
|
|
}
|