Compare commits

...

2 commits

Author SHA1 Message Date
417ab22a7b
fix: public posts have NULL actor 2024-05-27 19:53:51 +02:00
b36e9f5bf5
chore: use pull_object 2024-05-27 19:53:39 +02:00
2 changed files with 2 additions and 4 deletions

View file

@ -21,7 +21,7 @@ pub enum Identity {
impl Identity {
pub fn filter_condition(&self) -> Condition {
let base_cond = Condition::any().add(model::addressing::Column::Actor.eq(apb::target::PUBLIC));
let base_cond = Condition::any().add(model::addressing::Column::Actor.is_null());
match self {
Identity::Anonymous => base_cond,
Identity::Remote { internal, .. } => base_cond.add(model::addressing::Column::Instance.eq(*internal)),

View file

@ -236,9 +236,7 @@ async fn fetch_object_inner(ctx: &Context, id: &str, depth: usize) -> crate::Res
return Ok(x); // already in db, easy
}
let object = Context::request(
Method::GET, id, None, &format!("https://{}", ctx.domain()), ctx.pkey(), ctx.domain(),
).await?.json::<serde_json::Value>().await?;
let object = ctx.pull_object(id).await?;
if let Some(oid) = object.id() {
if oid != id {