diff options
Diffstat (limited to 'internal/processing/workers/fromclientapi.go')
| -rw-r--r-- | internal/processing/workers/fromclientapi.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/processing/workers/fromclientapi.go b/internal/processing/workers/fromclientapi.go index 75201c7dc..e18f941fa 100644 --- a/internal/processing/workers/fromclientapi.go +++ b/internal/processing/workers/fromclientapi.go @@ -871,6 +871,20 @@ func (p *clientAPI) UndoFollow(ctx context.Context, cMsg *messages.FromClientAPI follow.TargetAccountID, follow.AccountID, ) + + // Clear any notifications that were + // generated by this follow (request). + if err := p.state.DB.DeleteNotifications( + ctx, + []gtsmodel.NotificationType{ + gtsmodel.NotificationFollow, + gtsmodel.NotificationFollowRequest, + }, + follow.TargetAccountID, + follow.AccountID, + ); err != nil { + return gtserror.Newf("db error deleting notifications: %w", err) + } } if err := p.federate.UndoFollow(ctx, follow); err != nil { |
