mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-30 00:01:25 +00:00
Fixing shared inbox bug. Fixes #1865
This commit is contained in:
parent
3925813f3e
commit
9a5bb8a189
2 changed files with 9 additions and 9 deletions
|
@ -360,14 +360,14 @@ test('Check 3 instance shared inbox bug', async () => {
|
|||
|
||||
// Make sure alpha sees it
|
||||
let alphaPost2 = await getPost(alpha, alphaPost.post.id);
|
||||
// TODO remove this after
|
||||
console.log(alphaPost2);
|
||||
expect(alphaPost2.comments[0].comment.content).toBe(commentContent);
|
||||
expect(alphaPost2.comments[0].community.local).toBe(true);
|
||||
expect(alphaPost2.comments[0].community.local).toBe(false);
|
||||
expect(alphaPost2.comments[0].creator.local).toBe(false);
|
||||
expect(alphaPost2.comments[0].counts.score).toBe(1);
|
||||
assertCommentFederation(alphaPost2.comments[0], commentRes.comment_view);
|
||||
|
||||
await unfollowRemotes(alpha);
|
||||
await unfollowRemotes(gamma);
|
||||
});
|
||||
|
||||
test('Fetch in_reply_tos: A is unsubbed from B, B makes a post, and some embedded comments, A subs to B, B updates the lowest level comment, A fetches both the post and all the inreplyto comments for that post.', async () => {
|
||||
|
|
|
@ -83,12 +83,6 @@ pub async fn community_inbox(
|
|||
|
||||
receive_group_inbox(activity.clone(), request, &context).await?;
|
||||
|
||||
if let GroupInboxActivities::AnnouncableActivities(announcable) = activity {
|
||||
let community = extract_community(&announcable.cc(), &context, &mut 0).await?;
|
||||
if community.local {
|
||||
AnnounceActivity::send(announcable, &community, vec![], &context).await?;
|
||||
}
|
||||
}
|
||||
Ok(HttpResponse::Ok().finish())
|
||||
}
|
||||
|
||||
|
@ -97,6 +91,12 @@ pub(in crate::http) async fn receive_group_inbox(
|
|||
request: HttpRequest,
|
||||
context: &LemmyContext,
|
||||
) -> Result<HttpResponse, LemmyError> {
|
||||
if let GroupInboxActivities::AnnouncableActivities(announcable) = activity.clone() {
|
||||
let community = extract_community(&announcable.cc(), context, &mut 0).await?;
|
||||
if community.local {
|
||||
AnnounceActivity::send(announcable, &community, vec![], context).await?;
|
||||
}
|
||||
}
|
||||
receive_activity(request, activity.clone(), context).await
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue