mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] visibility caching and hometimeline (#1675)
* 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>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user