From: Dessalines Date: Fri, 9 Oct 2020 17:46:27 +0000 (-0500) Subject: Fixed an issue with blocked post creators in outbox. X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%22https:/hacktivis.me/%7Bthis.getImageSrc%28%29%7D?a=commitdiff_plain;h=cb4a3a03a27573bb960de1a093cbc3476bc51aab;p=lemmy.git Fixed an issue with blocked post creators in outbox. - Fixes #1186 --- diff --git a/lemmy_apub/src/activity_queue.rs b/lemmy_apub/src/activity_queue.rs index 988f1a47..0e018c8d 100644 --- a/lemmy_apub/src/activity_queue.rs +++ b/lemmy_apub/src/activity_queue.rs @@ -189,10 +189,6 @@ where return Ok(()); } - for to_url in &to { - check_is_apub_id_valid(&to_url)?; - } - let activity = activity.into_any_base()?; let serialised_activity = serde_json::to_string(&activity)?; diff --git a/lemmy_apub/src/fetcher.rs b/lemmy_apub/src/fetcher.rs index 226569f6..58b6a1bf 100644 --- a/lemmy_apub/src/fetcher.rs +++ b/lemmy_apub/src/fetcher.rs @@ -338,7 +338,13 @@ async fn fetch_remote_community( } for o in outbox_items { let page = PageExt::from_any_base(o)?.context(location_info!())?; - let post = PostForm::from_apub(&page, context, None).await?; + + // The post creator may be from a blocked instance, + // if it errors, then continue + let post = match PostForm::from_apub(&page, context, None).await { + Ok(post) => post, + Err(_) => continue, + }; let post_ap_id = post.ap_id.as_ref().context(location_info!())?.clone(); // Check whether the post already exists in the local db let existing = blocking(context.pool(), move |conn| {