From: Felix Ableitner Date: Thu, 11 Feb 2021 13:53:17 +0000 (+0100) Subject: Hide followed communities, except for own user (fixes #1303) X-Git-Url: http://these/git/%7B%60https:/%7B%60css/themes/%22https:/nerdica.net/%7Bpost.url%7D?a=commitdiff_plain;h=3d400ca21d3ecdf3ac482ff50ae9a84d6a89c7c6;p=lemmy.git Hide followed communities, except for own user (fixes #1303) --- diff --git a/crates/api/src/user.rs b/crates/api/src/user.rs index da2b8f30..93d40bda 100644 --- a/crates/api/src/user.rs +++ b/crates/api/src/user.rs @@ -563,10 +563,15 @@ impl Perform for GetUserDetails { }) .await??; - let follows = blocking(context.pool(), move |conn| { - CommunityFollowerView::for_user(conn, user_details_id) - }) - .await??; + let mut follows = vec![]; + if let Some(uid) = user_id { + if uid == user_details_id { + follows = blocking(context.pool(), move |conn| { + CommunityFollowerView::for_user(conn, user_details_id) + }) + .await??; + } + }; let moderates = blocking(context.pool(), move |conn| { CommunityModeratorView::for_user(conn, user_details_id) })