From e46323c207230b01e48ae1b8e5117a9774d9f157 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Thu, 6 Apr 2023 16:11:25 +0100 Subject: [bugfix] visibility caching and hometimeline (#1675) * fix visibility caching to use correct type key Signed-off-by: kim * check for ID check > max possible ID Signed-off-by: kim * update home timeline code to include relevant threads to owner (e.g. between mutuals/follows) Signed-off-by: kim --------- Signed-off-by: kim --- internal/visibility/account.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/visibility/account.go') 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 } -- cgit v1.2.3