From: Felix Ableitner Date: Tue, 6 Oct 2020 12:58:37 +0000 (+0200) Subject: Dont send mentions to inbox of local community X-Git-Url: http://these/git/%7BprofileRss%7D?a=commitdiff_plain;h=9e84fe20e64b4cf33d181cef6b37c81ee4a65cca;p=lemmy.git Dont send mentions to inbox of local community also, dont start SendActivityTask for empty `to`, and remove useless comment --- diff --git a/lemmy_apub/src/activity_queue.rs b/lemmy_apub/src/activity_queue.rs index 68b5c3ab..9f7f38cf 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 7f6885a1..35be5522 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 3f2109ec..226569f6 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())