summaryrefslogtreecommitdiff
path: root/internal/visibility/account.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-04-06 16:11:25 +0100
committerLibravatar GitHub <noreply@github.com>2023-04-06 17:11:25 +0200
commite46323c207230b01e48ae1b8e5117a9774d9f157 (patch)
tree088c9476dd4650092b916394364582ee64a7b328 /internal/visibility/account.go
parent[bugfix/chore] Refactor timeline code (#1656) (diff)
downloadgotosocial-e46323c207230b01e48ae1b8e5117a9774d9f157.tar.xz
[bugfix] visibility caching and hometimeline (#1675)v0.8.0-rc1
* fix visibility caching to use correct type key Signed-off-by: kim <grufwub@gmail.com> * check for ID check > max possible ID Signed-off-by: kim <grufwub@gmail.com> * update home timeline code to include relevant threads to owner (e.g. between mutuals/follows) Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/visibility/account.go')
-rw-r--r--internal/visibility/account.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/visibility/account.go b/internal/visibility/account.go
index ca532f5dd..6c7a0059d 100644
--- a/internal/visibility/account.go
+++ b/internal/visibility/account.go
@@ -29,6 +29,8 @@ import (
// AccountVisible will check if given account is visible to requester, accounting for requester with no auth (i.e is nil), suspensions, disabled local users and account blocks.
func (f *Filter) AccountVisible(ctx context.Context, requester *gtsmodel.Account, account *gtsmodel.Account) (bool, error) {
+ const vtype = cache.VisibilityTypeAccount
+
// By default we assume no auth.
requesterID := noauth
@@ -48,10 +50,10 @@ func (f *Filter) AccountVisible(ctx context.Context, requester *gtsmodel.Account
return &cache.CachedVisibility{
ItemID: account.ID,
RequesterID: requesterID,
- Type: cache.VisibilityTypeAccount,
+ Type: vtype,
Value: visible,
}, nil
- }, "account", requesterID, account.ID)
+ }, vtype, requesterID, account.ID)
if err != nil {
return false, err
}