From 9e84fe20e64b4cf33d181cef6b37c81ee4a65cca Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 6 Oct 2020 14:58:37 +0200 Subject: [PATCH] Dont send mentions to inbox of local community also, dont start SendActivityTask for empty `to`, and remove useless comment --- lemmy_apub/src/activity_queue.rs | 2 +- lemmy_apub/src/comment.rs | 5 ++++- lemmy_apub/src/fetcher.rs | 3 --- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lemmy_apub/src/activity_queue.rs b/lemmy_apub/src/activity_queue.rs index 68b5c3ab0..9f7f38cf1 100644 --- a/lemmy_apub/src/activity_queue.rs +++ b/lemmy_apub/src/activity_queue.rs @@ -164,7 +164,7 @@ where Kind: Serialize, >::Error: From + Send + Sync + 'static, { - if !Settings::get().federation.enabled { + if !Settings::get().federation.enabled || to.is_empty() { return Ok(()); } diff --git a/lemmy_apub/src/comment.rs b/lemmy_apub/src/comment.rs index 7f6885a19..35be5522e 100644 --- a/lemmy_apub/src/comment.rs +++ b/lemmy_apub/src/comment.rs @@ -506,7 +506,10 @@ async fn collect_non_local_mentions_and_addresses( } } - let mut inboxes = vec![community.get_shared_inbox_url()?]; + let mut inboxes: Vec = vec![]; + if !community.local { + inboxes.push(community.get_shared_inbox_url()?); + } inboxes.extend(mention_inboxes); inboxes = inboxes.into_iter().unique().collect(); diff --git a/lemmy_apub/src/fetcher.rs b/lemmy_apub/src/fetcher.rs index 3f2109ecb..226569f67 100644 --- a/lemmy_apub/src/fetcher.rs +++ b/lemmy_apub/src/fetcher.rs @@ -55,9 +55,6 @@ where let timeout = Duration::from_secs(60); - // speed up tests - // before: 305s - // after: 240s let json = retry(|| { client .get(url.as_str())