summaryrefslogtreecommitdiff
path: root/internal/db/bundb/relationship.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/relationship.go')
-rw-r--r--internal/db/bundb/relationship.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/db/bundb/relationship.go b/internal/db/bundb/relationship.go
index 052f29cb3..cb820d5c4 100644
--- a/internal/db/bundb/relationship.go
+++ b/internal/db/bundb/relationship.go
@@ -20,6 +20,7 @@ package bundb
import (
"context"
"errors"
+ "time"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtscontext"
@@ -108,6 +109,16 @@ func (r *relationshipDB) GetRelationship(ctx context.Context, requestingAccount
rel.Note = note.Comment
}
+ // check if the requesting account is muting the target account
+ mute, err := r.GetMute(ctx, requestingAccount, targetAccount)
+ if err != nil && !errors.Is(err, db.ErrNoEntries) {
+ return nil, gtserror.Newf("error checking muting: %w", err)
+ }
+ if mute != nil && !mute.Expired(time.Now()) {
+ rel.Muting = true
+ rel.MutingNotifications = *mute.Notifications
+ }
+
return &rel, nil
}