From 093cf2ab12a1f6bfa9629917101afffd2aeb8376 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 10 Apr 2023 21:56:02 +0200 Subject: [feature] Receive notification when followed account posts (if desired) (#1680) * start working on notifs for new posts * tidy up a bit * update swagger * carry over show reblogs + notify from follow req * test notify on status post * update column slice * dedupe update logic + add tests * fix own boosts not being timelined * avoid type check, passing unnecessary accounts * remove unnecessary 'inReplyToID' check * add a couple todo's for future db functions --- internal/processing/fromclientapi.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'internal/processing/fromclientapi.go') diff --git a/internal/processing/fromclientapi.go b/internal/processing/fromclientapi.go index 490fc7d34..082a5ba2e 100644 --- a/internal/processing/fromclientapi.go +++ b/internal/processing/fromclientapi.go @@ -160,11 +160,7 @@ func (p *Processor) processCreateStatusFromClientAPI(ctx context.Context, client return errors.New("note was not parseable as *gtsmodel.Status") } - if err := p.timelineStatus(ctx, status); err != nil { - return err - } - - if err := p.notifyStatus(ctx, status); err != nil { + if err := p.timelineAndNotifyStatus(ctx, status); err != nil { return err } @@ -203,7 +199,7 @@ func (p *Processor) processCreateAnnounceFromClientAPI(ctx context.Context, clie return errors.New("boost was not parseable as *gtsmodel.Status") } - if err := p.timelineStatus(ctx, boostWrapperStatus); err != nil { + if err := p.timelineAndNotifyStatus(ctx, boostWrapperStatus); err != nil { return err } @@ -255,7 +251,7 @@ func (p *Processor) processUpdateReportFromClientAPI(ctx context.Context, client return nil } - return p.notifyReportClosed(ctx, report) + return p.emailReportClosed(ctx, report) } func (p *Processor) processAcceptFollowFromClientAPI(ctx context.Context, clientMsg messages.FromClientAPI) error { @@ -373,7 +369,7 @@ func (p *Processor) processReportAccountFromClientAPI(ctx context.Context, clien } } - if err := p.notifyReport(ctx, report); err != nil { + if err := p.emailReport(ctx, report); err != nil { return fmt.Errorf("processReportAccountFromClientAPI: error notifying report: %w", err) } -- cgit v1.2.3