mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 04:12:26 -06: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:
parent
3510454768
commit
e46323c207
5 changed files with 110 additions and 26 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue