fix(apb): oops missed these, also comment out some

just for now because i dont want to implement these everywhere
This commit is contained in:
əlemi 2024-06-01 01:26:19 +02:00
parent 151eb606b6
commit 7f091291af
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -4,42 +4,42 @@ pub const PUBLIC : &str = "https://www.w3.org/ns/activitystreams#Public";
pub trait Addressed {
fn addressed(&self) -> Vec<String>; // TODO rename this? remate others? idk
fn primary_targets(&self) -> Vec<String>;
fn secondary_targets(&self) -> Vec<String>;
fn public_targets(&self) -> Vec<String>;
fn private_targets(&self) -> Vec<String>;
// fn primary_targets(&self) -> Vec<String>;
// fn secondary_targets(&self) -> Vec<String>;
// fn public_targets(&self) -> Vec<String>;
// fn private_targets(&self) -> Vec<String>;
}
impl<T: Object> Addressed for T {
fn addressed(&self) -> Vec<String> {
let mut to : Vec<String> = self.to().ids();
to.append(&mut self.bto().ids());
to.append(&mut self.cc().ids());
to.append(&mut self.bcc().ids());
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());
to
}
fn primary_targets(&self) -> Vec<String> {
let mut to : Vec<String> = self.to().ids();
to.append(&mut self.bto().ids());
to
}
// fn primary_targets(&self) -> Vec<String> {
// let mut to : Vec<String> = self.to().ids();
// to.append(&mut self.bto().ids());
// to
// }
fn secondary_targets(&self) -> Vec<String> {
let mut to : Vec<String> = self.cc().ids();
to.append(&mut self.bcc().ids());
to
}
// fn secondary_targets(&self) -> Vec<String> {
// let mut to : Vec<String> = self.cc().ids();
// to.append(&mut self.bcc().ids());
// to
// }
fn public_targets(&self) -> Vec<String> {
let mut to : Vec<String> = self.to().ids();
to.append(&mut self.cc().ids());
to
}
// fn public_targets(&self) -> Vec<String> {
// let mut to : Vec<String> = self.to().ids();
// to.append(&mut self.cc().ids());
// to
// }
fn private_targets(&self) -> Vec<String> {
let mut to : Vec<String> = self.bto().ids();
to.append(&mut self.bcc().ids());
to
}
// fn private_targets(&self) -> Vec<String> {
// let mut to : Vec<String> = self.bto().ids();
// to.append(&mut self.bcc().ids());
// to
// }
}