diff options
Diffstat (limited to 'internal/db/bundb/relationship.go')
-rw-r--r-- | internal/db/bundb/relationship.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/db/bundb/relationship.go b/internal/db/bundb/relationship.go index c865f8aad..eddd73b49 100644 --- a/internal/db/bundb/relationship.go +++ b/internal/db/bundb/relationship.go @@ -85,6 +85,19 @@ func (r *relationshipDB) GetRelationship(ctx context.Context, requestingAccount return nil, fmt.Errorf("GetRelationship: error checking blockedBy: %w", err) } + // retrieve a note by the requesting account on the target account, if there is one + note, err := r.GetNote( + gtscontext.SetBarebones(ctx), + requestingAccount, + targetAccount, + ) + if err != nil && !errors.Is(err, db.ErrNoEntries) { + return nil, fmt.Errorf("GetRelationship: error fetching note: %w", err) + } + if note != nil { + rel.Note = note.Comment + } + return &rel, nil } |