2024-05-23 01:59:22 +02:00
|
|
|
use crate::Object;
|
2024-04-11 00:27:17 +02:00
|
|
|
|
|
|
|
pub const PUBLIC : &str = "https://www.w3.org/ns/activitystreams#Public";
|
|
|
|
|
2024-05-02 02:58:19 +02:00
|
|
|
pub trait Addressed {
|
2024-06-01 01:04:03 +02:00
|
|
|
fn addressed(&self) -> Vec<String>; // TODO rename this? remate others? idk
|
2024-06-01 01:26:19 +02:00
|
|
|
// fn primary_targets(&self) -> Vec<String>;
|
|
|
|
// fn secondary_targets(&self) -> Vec<String>;
|
|
|
|
// fn public_targets(&self) -> Vec<String>;
|
|
|
|
// fn private_targets(&self) -> Vec<String>;
|
2024-04-11 00:27:17 +02:00
|
|
|
}
|
|
|
|
|
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> {
|
2024-06-01 01:26:19 +02:00
|
|
|
let mut to : Vec<String> = self.to().all_ids();
|
|
|
|
to.append(&mut self.bto().all_ids());
|
|
|
|
to.append(&mut self.cc().all_ids());
|
|
|
|
to.append(&mut self.bcc().all_ids());
|
2024-04-11 00:27:17 +02:00
|
|
|
to
|
|
|
|
}
|
2024-06-01 01:04:03 +02:00
|
|
|
|
2024-06-01 01:26:19 +02:00
|
|
|
// fn primary_targets(&self) -> Vec<String> {
|
|
|
|
// let mut to : Vec<String> = self.to().ids();
|
|
|
|
// to.append(&mut self.bto().ids());
|
|
|
|
// to
|
|
|
|
// }
|
2024-06-01 01:04:03 +02:00
|
|
|
|
2024-06-01 01:26:19 +02:00
|
|
|
// fn secondary_targets(&self) -> Vec<String> {
|
|
|
|
// let mut to : Vec<String> = self.cc().ids();
|
|
|
|
// to.append(&mut self.bcc().ids());
|
|
|
|
// to
|
|
|
|
// }
|
2024-06-01 01:04:03 +02:00
|
|
|
|
2024-06-01 01:26:19 +02:00
|
|
|
// fn public_targets(&self) -> Vec<String> {
|
|
|
|
// let mut to : Vec<String> = self.to().ids();
|
|
|
|
// to.append(&mut self.cc().ids());
|
|
|
|
// to
|
|
|
|
// }
|
2024-06-01 01:04:03 +02:00
|
|
|
|
2024-06-01 01:26:19 +02:00
|
|
|
// fn private_targets(&self) -> Vec<String> {
|
|
|
|
// let mut to : Vec<String> = self.bto().ids();
|
|
|
|
// to.append(&mut self.bcc().ids());
|
|
|
|
// to
|
|
|
|
// }
|
2024-04-11 00:27:17 +02:00
|
|
|
}
|