From 47a4ebb0ad0c86173cfa9527533dbbd997ccec69 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Mon, 23 Oct 2023 00:04:25 -0700 Subject: [PATCH] Bugfix on viewing other users friends and relationship booleans --- pkg/controller/account/friends.go | 3 --- pkg/models/friend.go | 2 +- web/templates/partials/user_avatar.html | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/controller/account/friends.go b/pkg/controller/account/friends.go index 0922a86..7af5f46 100644 --- a/pkg/controller/account/friends.go +++ b/pkg/controller/account/friends.go @@ -65,9 +65,6 @@ func UserFriends() http.HandlerFunc { return } - // Inject relationship booleans. - models.SetUserRelationships(currentUser, friends) - var vars = map[string]interface{}{ "User": user, "IsSelf": isSelf, diff --git a/pkg/models/friend.go b/pkg/models/friend.go index 9802227..01d6373 100644 --- a/pkg/models/friend.go +++ b/pkg/models/friend.go @@ -390,7 +390,7 @@ func PaginateOtherUserFriends(currentUser *User, user *User, pager *Pagination) userIDs = append(userIDs, friend.TargetUserID) } - return GetUsers(user, userIDs) + return GetUsers(currentUser, userIDs) } // GetFriendRequests returns all pending friend requests for a user. diff --git a/web/templates/partials/user_avatar.html b/web/templates/partials/user_avatar.html index 9a9ba45..2f97315 100644 --- a/web/templates/partials/user_avatar.html +++ b/web/templates/partials/user_avatar.html @@ -93,4 +93,4 @@ {{end}} -{{end}} \ No newline at end of file +{{end}}