From 846057f0d696fded87d105dec1245e9ba32763ce Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Sun, 11 Jul 2021 16:22:21 +0200 Subject: Block/unblock (#96) * remote + local block logic, incl. federation * improve blocking stuff * fiddle with display of blocked profiles * go fmt --- internal/gtsmodel/block.go | 8 +++++--- internal/gtsmodel/status.go | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'internal/gtsmodel') diff --git a/internal/gtsmodel/block.go b/internal/gtsmodel/block.go index 27b39727c..32afede55 100644 --- a/internal/gtsmodel/block.go +++ b/internal/gtsmodel/block.go @@ -11,9 +11,11 @@ type Block struct { // When was this block updated UpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"` // Who created this block? - AccountID string `pg:"type:CHAR(26),notnull"` + AccountID string `pg:"type:CHAR(26),notnull"` + Account *Account `pg:"rel:has-one"` // Who is targeted by this block? - TargetAccountID string `pg:"type:CHAR(26),notnull"` + TargetAccountID string `pg:"type:CHAR(26),notnull"` + TargetAccount *Account `pg:"rel:has-one"` // Activitypub URI for this block - URI string + URI string `pg:",notnull"` } diff --git a/internal/gtsmodel/status.go b/internal/gtsmodel/status.go index caa5a2a25..84b3dfc7c 100644 --- a/internal/gtsmodel/status.go +++ b/internal/gtsmodel/status.go @@ -56,6 +56,8 @@ type Status struct { InReplyToAccountID string `pg:"type:CHAR(26)"` // id of the status this status is a boost of BoostOfID string `pg:"type:CHAR(26)"` + // id of the account that owns the boosted status + BoostOfAccountID string `pg:"type:CHAR(26)"` // cw string for this status ContentWarning string // visibility entry for this status -- cgit v1.2.3