]> Untitled Git - lemmy.git/commitdiff
Dont send mentions to inbox of local community
authorFelix Ableitner <me@nutomic.com>
Tue, 6 Oct 2020 12:58:37 +0000 (14:58 +0200)
committerFelix Ableitner <me@nutomic.com>
Tue, 6 Oct 2020 12:58:37 +0000 (14:58 +0200)
also, dont start SendActivityTask for empty `to`, and remove
useless comment

lemmy_apub/src/activity_queue.rs
lemmy_apub/src/comment.rs
lemmy_apub/src/fetcher.rs

index 68b5c3ab0d294669fa884b7ed748fff8cd854196..9f7f38cf1dad7f5f3aebe3c594052af360777c8d 100644 (file)
@@ -164,7 +164,7 @@ where
   Kind: Serialize,
   <T as Extends<Kind>>::Error: From<serde_json::Error> + Send + Sync + 'static,
 {
-  if !Settings::get().federation.enabled {
+  if !Settings::get().federation.enabled || to.is_empty() {
     return Ok(());
   }
 
index 7f6885a1908572b8512bb7543e3d78e56610b0ce..35be5522e2ef14b599ea13c26e88a8a59cc8a38b 100644 (file)
@@ -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<Url> = vec![];
+  if !community.local {
+    inboxes.push(community.get_shared_inbox_url()?);
+  }
   inboxes.extend(mention_inboxes);
   inboxes = inboxes.into_iter().unique().collect();
 
index 3f2109ecbb71d13629105bdf3316635f69299009..226569f674d7842145709ceb5fa6a13ad567454a 100644 (file)
@@ -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())