fix: activities inherit audience

only when addressing activity+object and object has `audience` set
This commit is contained in:
əlemi 2024-11-09 12:07:16 +01:00
parent 98fa0dc58f
commit f5d794824e
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -67,7 +67,7 @@ impl Addresser for crate::Context {
address_to(self, to, None, Some(object.internal), self.is_local(&object.id), object.published, tx).await address_to(self, to, None, Some(object.internal), self.is_local(&object.id), object.published, tx).await
}, },
(Some(activity), Some(object)) => { (Some(activity), Some(object)) => {
let to_activity = BTreeSet::from_iter(expand_addressing(activity.addressed(), None, tx).await?); let to_activity = BTreeSet::from_iter(expand_addressing(activity.addressed(), object.audience.clone(), tx).await?);
let to_object = BTreeSet::from_iter(expand_addressing(object.addressed(), object.audience.clone(), tx).await?); let to_object = BTreeSet::from_iter(expand_addressing(object.addressed(), object.audience.clone(), tx).await?);
let to_common = to_activity.intersection(&to_object).cloned().collect(); let to_common = to_activity.intersection(&to_object).cloned().collect();