mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 07:36:16 -06:00
fix issues after rebase on upstream/main
This commit is contained in:
parent
bca5e1b926
commit
7aafaae619
3 changed files with 15 additions and 6 deletions
|
|
@ -102,10 +102,13 @@ func (suite *ListAccountsAddTestSuite) TestPostListAccountNotFollowed() {
|
|||
}
|
||||
|
||||
func (suite *ListAccountsAddTestSuite) TestPostListAccountOK() {
|
||||
entry := suite.testListEntries["local_account_1_list_1_entry_1"]
|
||||
|
||||
// Remove turtle from the list.
|
||||
if err := suite.db.DeleteListEntry(
|
||||
context.Background(),
|
||||
suite.testListEntries["local_account_1_list_1_entry_1"].ID,
|
||||
entry.ListID,
|
||||
entry.FollowID,
|
||||
); err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ func (t *timelineDB) GetHomeTimeline(ctx context.Context, accountID string, maxI
|
|||
// To take account of exclusive lists, get all of
|
||||
// this account's lists, so we can filter out follows
|
||||
// that are in contained in exclusive lists.
|
||||
lists, err := t.state.DB.GetListsForAccountID(ctx, accountID)
|
||||
lists, err := t.state.DB.GetListsByAccountID(ctx, accountID)
|
||||
if err != nil && !errors.Is(err, db.ErrNoEntries) {
|
||||
return nil, gtserror.Newf("db error getting lists for account %s: %w", accountID, err)
|
||||
}
|
||||
|
|
@ -84,9 +84,15 @@ func (t *timelineDB) GetHomeTimeline(ctx context.Context, accountID string, maxI
|
|||
continue
|
||||
}
|
||||
|
||||
// Fetch all follow IDs of the entries ccontained in this list.
|
||||
listFollowIDs, err := t.state.DB.GetFollowIDsInList(ctx, list.ID, nil)
|
||||
if err != nil && !errors.Is(err, db.ErrNoEntries) {
|
||||
return nil, gtserror.Newf("db error getting list entry follow ids: %w", err)
|
||||
}
|
||||
|
||||
// Exclusive list, index all its follow IDs.
|
||||
for _, listEntry := range list.ListEntries {
|
||||
ignoreFollowIDs[listEntry.FollowID] = struct{}{}
|
||||
for _, followID := range listFollowIDs {
|
||||
ignoreFollowIDs[followID] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,8 +184,8 @@ func (suite *TimelineTestSuite) TestGetHomeTimelineIgnoreExclusive() {
|
|||
suite.checkStatuses(s, id.Highest, id.Lowest, 8)
|
||||
|
||||
// Remove admin account from the exclusive list.
|
||||
listEntryID := suite.testListEntries["local_account_1_list_1_entry_2"].ID
|
||||
if err := suite.db.DeleteListEntry(ctx, listEntryID); err != nil {
|
||||
listEntry := suite.testListEntries["local_account_1_list_1_entry_2"]
|
||||
if err := suite.db.DeleteListEntry(ctx, listEntry.ListID, listEntry.FollowID); err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue