From f5544e73f3c884406d335b7381ea0147bc9793e6 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Fri, 11 Oct 2024 00:04:41 +0800 Subject: [PATCH] :bug: Bug fixes on visibility --- pkg/internal/services/posts.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/internal/services/posts.go b/pkg/internal/services/posts.go index 474da16..0e9708a 100644 --- a/pkg/internal/services/posts.go +++ b/pkg/internal/services/posts.go @@ -29,11 +29,11 @@ func FilterPostWithUserContext(tx *gorm.DB, user *models.Account) *gorm.DB { ) friends, _ := ListAccountFriends(*user) - friendAllowList := lo.Map(friends, func(item models.Account, index int) uint { + allowlist := lo.Map(friends, func(item models.Account, index int) uint { return item.ID }) blocked, _ := ListAccountBlockedUsers(*user) - blockedDisallowList := lo.Map(blocked, func(item models.Account, index int) uint { + blocklist := lo.Map(blocked, func(item models.Account, index int) uint { return item.ID }) @@ -41,8 +41,8 @@ func FilterPostWithUserContext(tx *gorm.DB, user *models.Account) *gorm.DB { "(visibility != ? OR (visibility != ? AND author_id IN ? AND author_id NOT IN ?) OR (visibility = ? AND ?) OR (visibility = ? AND NOT ?) OR author_id = ?)", NoneVisibility, FriendsVisibility, - friendAllowList, - blockedDisallowList, + allowlist, + blocklist, SelectedVisibility, datatypes.JSONQuery("visible_users").HasKey(strconv.Itoa(int(user.ID))), FilteredVisibility,