mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-10 20:15:56 +00:00
filter follow+report activities by local
This commit is contained in:
parent
e945e9f308
commit
884307ac60
3 changed files with 15 additions and 6 deletions
|
@ -50,8 +50,11 @@ impl Report {
|
||||||
id: id.clone(),
|
id: id.clone(),
|
||||||
audience: Some(community.id().into()),
|
audience: Some(community.id().into()),
|
||||||
};
|
};
|
||||||
// todo: this should probably filter and only send if the community is remote?
|
let inbox = if community.local {
|
||||||
let inbox = ActivitySendTargets::to_inbox(community.shared_inbox_or_inbox());
|
ActivitySendTargets::empty()
|
||||||
|
} else {
|
||||||
|
ActivitySendTargets::to_inbox(community.shared_inbox_or_inbox())
|
||||||
|
};
|
||||||
send_lemmy_activity(&context, report, &actor, inbox, false).await
|
send_lemmy_activity(&context, report, &actor, inbox, false).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,11 @@ impl Follow {
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
let follow = Follow::new(actor, community, context)?;
|
let follow = Follow::new(actor, community, context)?;
|
||||||
// todo: this should probably filter and only send if the community is remote?
|
let inbox = if community.local {
|
||||||
let inbox = ActivitySendTargets::to_inbox(community.shared_inbox_or_inbox());
|
ActivitySendTargets::empty()
|
||||||
|
} else {
|
||||||
|
ActivitySendTargets::to_inbox(community.shared_inbox_or_inbox())
|
||||||
|
};
|
||||||
send_lemmy_activity(context, follow, actor, inbox, true).await
|
send_lemmy_activity(context, follow, actor, inbox, true).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,11 @@ impl UndoFollow {
|
||||||
&context.settings().get_protocol_and_hostname(),
|
&context.settings().get_protocol_and_hostname(),
|
||||||
)?,
|
)?,
|
||||||
};
|
};
|
||||||
// todo: this should probably filter and only send if the community is remote?
|
let inbox = if community.local {
|
||||||
let inbox = ActivitySendTargets::to_inbox(community.shared_inbox_or_inbox());
|
ActivitySendTargets::empty()
|
||||||
|
} else {
|
||||||
|
ActivitySendTargets::to_inbox(community.shared_inbox_or_inbox())
|
||||||
|
};
|
||||||
send_lemmy_activity(context, undo, actor, inbox, true).await
|
send_lemmy_activity(context, undo, actor, inbox, true).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue