1
0
Fork 0
forked from alemi/upub

fix: cheap way to make public activities public

This commit is contained in:
əlemi 2024-06-12 06:07:34 +02:00
parent ea655be121
commit 3db892f038
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -60,7 +60,12 @@ impl Addresser for crate::Context {
} }
async fn address_activity(&self, activity: &crate::model::activity::Model, tx: &impl ConnectionTrait) -> Result<(), DbErr> { async fn address_activity(&self, activity: &crate::model::activity::Model, tx: &impl ConnectionTrait) -> Result<(), DbErr> {
let to = expand_addressing(activity.mentioning(), tx).await?; let mut to = expand_addressing(activity.mentioning(), tx).await?;
if !to.iter().any(|x| x == apb::target::PUBLIC)
&& activity.addressed().iter().any(|x| x == apb::target::PUBLIC)
{
to.push(apb::target::PUBLIC.to_string());
}
address_to(self, to, Some(activity.internal), None, self.is_local(&activity.id), tx).await address_to(self, to, Some(activity.internal), None, self.is_local(&activity.id), tx).await
} }
} }