mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 20:31:19 +00:00
Merge branch 'main' of https://github.com/lemmynet/lemmy into main
This commit is contained in:
commit
2189d15e5b
1 changed files with 8 additions and 2 deletions
|
@ -495,15 +495,21 @@ impl Perform for FollowCommunity {
|
||||||
return Err(APIError::err("community_follower_already_exists").into());
|
return Err(APIError::err("community_follower_already_exists").into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: this needs to return a "pending" state, until Accept is received from the remote server
|
|
||||||
|
|
||||||
let community_id = data.community_id;
|
let community_id = data.community_id;
|
||||||
let user_id = user.id;
|
let user_id = user.id;
|
||||||
let community_view = blocking(context.pool(), move |conn| {
|
let mut community_view = blocking(context.pool(), move |conn| {
|
||||||
CommunityView::read(conn, community_id, Some(user_id))
|
CommunityView::read(conn, community_id, Some(user_id))
|
||||||
})
|
})
|
||||||
.await??;
|
.await??;
|
||||||
|
|
||||||
|
// TODO: this needs to return a "pending" state, until Accept is received from the remote server
|
||||||
|
// For now, just assume that remote follows are accepted.
|
||||||
|
// Otherwise, the subscribed will be null
|
||||||
|
if !community.local {
|
||||||
|
community_view.subscribed = Some(data.follow);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(CommunityResponse {
|
Ok(CommunityResponse {
|
||||||
community: community_view,
|
community: community_view,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue