Dont send mentions to inbox of local community

also, dont start SendActivityTask for empty `to`, and remove
useless comment
This commit is contained in:
Felix Ableitner 2020-10-06 14:58:37 +02:00
parent 048fe287c2
commit 9e84fe20e6
3 changed files with 5 additions and 5 deletions

View file

@ -164,7 +164,7 @@ where
Kind: Serialize, Kind: Serialize,
<T as Extends<Kind>>::Error: From<serde_json::Error> + Send + Sync + 'static, <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(()); return Ok(());
} }

View 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.extend(mention_inboxes);
inboxes = inboxes.into_iter().unique().collect(); inboxes = inboxes.into_iter().unique().collect();

View file

@ -55,9 +55,6 @@ where
let timeout = Duration::from_secs(60); let timeout = Duration::from_secs(60);
// speed up tests
// before: 305s
// after: 240s
let json = retry(|| { let json = retry(|| {
client client
.get(url.as_str()) .get(url.as_str())