diff options
Diffstat (limited to 'internal/processing/account')
| -rw-r--r-- | internal/processing/account/bookmarks.go | 1 | ||||
| -rw-r--r-- | internal/processing/account/statuses.go | 36 | 
2 files changed, 14 insertions, 23 deletions
diff --git a/internal/processing/account/bookmarks.go b/internal/processing/account/bookmarks.go index 32075f592..c6b0c14c1 100644 --- a/internal/processing/account/bookmarks.go +++ b/internal/processing/account/bookmarks.go @@ -82,6 +82,7 @@ func (p *Processor) BookmarksGet(ctx context.Context, requestingAccount *gtsmode  		if bookmark.ID < nextMaxIDValue {  			nextMaxIDValue = bookmark.ID // Lowest ID (for paging down).  		} +  		if bookmark.ID > prevMinIDValue {  			prevMinIDValue = bookmark.ID // Highest ID (for paging up).  		} diff --git a/internal/processing/account/statuses.go b/internal/processing/account/statuses.go index df7064b79..26684265c 100644 --- a/internal/processing/account/statuses.go +++ b/internal/processing/account/statuses.go @@ -93,28 +93,21 @@ func (p *Processor) StatusesGet(  	}  	var ( -		items          = make([]interface{}, 0, count) -		nextMaxIDValue string -		prevMinIDValue string -	) +		items = make([]interface{}, 0, count) -	for i, s := range filtered {  		// Set next + prev values before filtering and API  		// converting, so caller can still page properly. -		if i == count-1 { -			nextMaxIDValue = s.ID -		} - -		if i == 0 { -			prevMinIDValue = s.ID -		} +		nextMaxIDValue = filtered[count-1].ID +		prevMinIDValue = filtered[0].ID +	) +	for _, s := range filtered { +		// Convert filtered statuses to API statuses.  		item, err := p.tc.StatusToAPIStatus(ctx, s, requestingAccount)  		if err != nil { -			log.Debugf(ctx, "skipping status %s because it couldn't be converted to its api representation: %s", s.ID, err) +			log.Errorf(ctx, "error convering to api status: %v", err)  			continue  		} -  		items = append(items, item)  	} @@ -171,23 +164,20 @@ func (p *Processor) WebStatusesGet(ctx context.Context, targetAccountID string,  	}  	var ( -		items          = make([]interface{}, 0, count) -		nextMaxIDValue string -	) +		items = make([]interface{}, 0, count) -	for i, s := range statuses {  		// Set next value before API converting,  		// so caller can still page properly. -		if i == count-1 { -			nextMaxIDValue = s.ID -		} +		nextMaxIDValue = statuses[count-1].ID +	) +	for _, s := range statuses { +		// Convert fetched statuses to API statuses.  		item, err := p.tc.StatusToAPIStatus(ctx, s, nil)  		if err != nil { -			log.Debugf(ctx, "skipping status %s because it couldn't be converted to its api representation: %s", s.ID, err) +			log.Errorf(ctx, "error convering to api status: %v", err)  			continue  		} -  		items = append(items, item)  	}  | 
