diff options
Diffstat (limited to 'internal/processing/timeline')
| -rw-r--r-- | internal/processing/timeline/faved.go | 2 | ||||
| -rw-r--r-- | internal/processing/timeline/notification.go | 14 | ||||
| -rw-r--r-- | internal/processing/timeline/timeline.go | 17 |
3 files changed, 6 insertions, 27 deletions
diff --git a/internal/processing/timeline/faved.go b/internal/processing/timeline/faved.go index c1b44fa92..65b23c702 100644 --- a/internal/processing/timeline/faved.go +++ b/internal/processing/timeline/faved.go @@ -56,7 +56,7 @@ func (p *Processor) FavedTimelineGet(ctx context.Context, authed *apiutil.Auth, continue } - apiStatus, err := p.converter.StatusToAPIStatus(ctx, s, authed.Account, gtsmodel.FilterContextNone, nil) + apiStatus, err := p.converter.StatusToAPIStatus(ctx, s, authed.Account, gtsmodel.FilterContextNone) if err != nil { log.Errorf(ctx, "error convering to api status: %v", err) continue diff --git a/internal/processing/timeline/notification.go b/internal/processing/timeline/notification.go index 143145bb9..784b2b824 100644 --- a/internal/processing/timeline/notification.go +++ b/internal/processing/timeline/notification.go @@ -27,11 +27,11 @@ import ( apimodel "code.superseriousbusiness.org/gotosocial/internal/api/model" apiutil "code.superseriousbusiness.org/gotosocial/internal/api/util" "code.superseriousbusiness.org/gotosocial/internal/db" - "code.superseriousbusiness.org/gotosocial/internal/filter/status" "code.superseriousbusiness.org/gotosocial/internal/gtserror" "code.superseriousbusiness.org/gotosocial/internal/gtsmodel" "code.superseriousbusiness.org/gotosocial/internal/log" "code.superseriousbusiness.org/gotosocial/internal/paging" + "code.superseriousbusiness.org/gotosocial/internal/typeutils" "code.superseriousbusiness.org/gotosocial/internal/util" ) @@ -59,12 +59,6 @@ func (p *Processor) NotificationsGet( return util.EmptyPageableResponse(), nil } - filters, err := p.state.DB.GetFiltersByAccountID(ctx, requester.ID) - if err != nil { - err = gtserror.Newf("error getting account %s filters: %w", requester.ID, err) - return nil, gtserror.NewErrorInternalError(err) - } - var ( items = make([]interface{}, 0, count) @@ -115,9 +109,9 @@ func (p *Processor) NotificationsGet( } } - item, err := p.converter.NotificationToAPINotification(ctx, n, filters) + item, err := p.converter.NotificationToAPINotification(ctx, n, true) if err != nil { - if !errors.Is(err, status.ErrHideStatus) { + if !errors.Is(err, typeutils.ErrHideStatus) { log.Debugf(ctx, "skipping notification %s because it couldn't be converted to its api representation: %s", n.ID, err) } continue @@ -160,7 +154,7 @@ func (p *Processor) NotificationGet(ctx context.Context, account *gtsmodel.Accou // or mute checking for a notification directly // fetched by ID. only from timelines etc. - apiNotif, err := p.converter.NotificationToAPINotification(ctx, notif, nil) + apiNotif, err := p.converter.NotificationToAPINotification(ctx, notif, false) if err != nil { err := gtserror.Newf("error converting to api model: %w", err) return nil, gtserror.WrapWithCode(http.StatusInternalServerError, err) diff --git a/internal/processing/timeline/timeline.go b/internal/processing/timeline/timeline.go index a37785879..64d33e430 100644 --- a/internal/processing/timeline/timeline.go +++ b/internal/processing/timeline/timeline.go @@ -25,9 +25,7 @@ import ( apimodel "code.superseriousbusiness.org/gotosocial/internal/api/model" timelinepkg "code.superseriousbusiness.org/gotosocial/internal/cache/timeline" - "code.superseriousbusiness.org/gotosocial/internal/db" "code.superseriousbusiness.org/gotosocial/internal/filter/mutes" - statusfilter "code.superseriousbusiness.org/gotosocial/internal/filter/status" "code.superseriousbusiness.org/gotosocial/internal/filter/visibility" "code.superseriousbusiness.org/gotosocial/internal/gtserror" "code.superseriousbusiness.org/gotosocial/internal/gtsmodel" @@ -79,18 +77,6 @@ func (p *Processor) getStatusTimeline( gtserror.WithCode, ) { var err error - var filters []*gtsmodel.Filter - - if requester != nil { - // Fetch all filters relevant for requesting account. - filters, err = p.state.DB.GetFiltersByAccountID(ctx, - requester.ID, - ) - if err != nil && !errors.Is(err, db.ErrNoEntries) { - err := gtserror.Newf("error getting account filters: %w", err) - return nil, gtserror.NewErrorInternalError(err) - } - } // Ensure we have valid // input paging cursor. @@ -135,9 +121,8 @@ func (p *Processor) getStatusTimeline( status, requester, filterCtx, - filters, ) - if err != nil && !errors.Is(err, statusfilter.ErrHideStatus) { + if err != nil && !errors.Is(err, typeutils.ErrHideStatus) { return nil, err } return apiStatus, nil |
