summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/followrequest.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-08-31 15:59:12 +0200
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-09-01 11:11:26 +0200
commit2786b5f88742c3f32b8ed497df3737cb4f57caec (patch)
treec088b71b228a52fb3bbf37628caea82ff7a42067 /internal/gtsmodel/followrequest.go
parentgo fmt (diff)
downloadgotosocial-2786b5f88742c3f32b8ed497df3737cb4f57caec.tar.xz
change muchos things
Diffstat (limited to 'internal/gtsmodel/followrequest.go')
-rw-r--r--internal/gtsmodel/followrequest.go28
1 files changed, 10 insertions, 18 deletions
diff --git a/internal/gtsmodel/followrequest.go b/internal/gtsmodel/followrequest.go
index 5a6cb5e02..c4b3c9997 100644
--- a/internal/gtsmodel/followrequest.go
+++ b/internal/gtsmodel/followrequest.go
@@ -22,22 +22,14 @@ import "time"
// FollowRequest represents one account requesting to follow another, and the metadata around that request.
type FollowRequest struct {
- // id of this follow request in the database
- ID string `bun:"type:CHAR(26),pk,notnull,unique"`
- // When was this follow request created?
- CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
- // When was this follow request last updated?
- UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
- // Who does this follow request originate from?
- AccountID string `bun:"type:CHAR(26),unique:frsrctarget,notnull"`
- Account *Account `bun:"rel:belongs-to"`
- // Who is the target of this follow request?
- TargetAccountID string `bun:"type:CHAR(26),unique:frsrctarget,notnull"`
- TargetAccount *Account `bun:"rel:belongs-to"`
- // Does this follow also want to see reblogs and not just posts?
- ShowReblogs bool `bun:"default:true"`
- // What is the activitypub URI of this follow request?
- URI string `bun:",unique,nullzero"`
- // does the following account want to be notified when the followed account posts?
- Notify bool
+ ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database
+ CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"` // when was item created
+ UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"` // when was item last updated
+ URI string `validate:"required,url" bun:",notnull,nullzero,unique"` // ActivityPub uri of this follow (request).
+ AccountID string `validate:"required,ulid" bun:"type:CHAR(26),unique:frsrctarget,notnull"` // Who does this follow request originate from?
+ Account *Account `validate:"-" bun:"rel:belongs-to"` // Account corresponding to accountID
+ TargetAccountID string `validate:"required,ulid" bun:"type:CHAR(26),unique:frsrctarget,notnull"` // Who is the target of this follow request?
+ TargetAccount *Account `validate:"-" bun:"rel:belongs-to"` // Account corresponding to targetAccountID
+ ShowReblogs bool `validate:"-" bun:",nullzero,default:true"` // Does this follow also want to see reblogs and not just posts?
+ Notify bool `validate:"-" bun:",nullzero,default:false"` // does the following account want to be notified when the followed account posts?
}