diff options
author | 2023-03-31 12:16:25 +0200 | |
---|---|---|
committer | 2023-03-31 11:16:25 +0100 | |
commit | 344c7e5cbd905c27bdfd1c2c499b660e16995066 (patch) | |
tree | 8849a942d0f6a5f4b05d78c35e11f1621fa9523f /internal/db/bundb/relationship_follow_req.go | |
parent | [docs] Add MASH as 3rd party packaging (#1654) (diff) | |
download | gotosocial-344c7e5cbd905c27bdfd1c2c499b660e16995066.tar.xz |
[bugfix] Fix relationship not updating 'following' on accept follow request (#1658)
Diffstat (limited to 'internal/db/bundb/relationship_follow_req.go')
-rw-r--r-- | internal/db/bundb/relationship_follow_req.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/internal/db/bundb/relationship_follow_req.go b/internal/db/bundb/relationship_follow_req.go index 11200338d..ae398bf3b 100644 --- a/internal/db/bundb/relationship_follow_req.go +++ b/internal/db/bundb/relationship_follow_req.go @@ -204,7 +204,8 @@ func (r *relationshipDB) AcceptFollowRequest(ctx context.Context, sourceAccountI return nil, r.conn.ProcessError(err) } - // Invalidate follow request from cache lookups. + // Invalidate follow request from cache lookups; this will + // invalidate the follow as well via the invalidate hook. r.state.Caches.GTS.FollowRequest().Invalidate("ID", followReq.ID) // Delete original follow request notification @@ -225,12 +226,8 @@ func (r *relationshipDB) RejectFollowRequest(ctx context.Context, sourceAccountI } // Delete original follow request. - if _, err := r.conn. - NewDelete(). - Table("follow_requests"). - Where("? = ?", bun.Ident("id"), followReq.ID). - Exec(ctx); err != nil { - return r.conn.ProcessError(err) + if err := r.DeleteFollowRequestByID(ctx, followReq.ID); err != nil { + return err } // Delete original follow request notification |