summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/mention.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/gtsmodel/mention.go')
-rw-r--r--internal/gtsmodel/mention.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/internal/gtsmodel/mention.go b/internal/gtsmodel/mention.go
index 47c780521..931e681db 100644
--- a/internal/gtsmodel/mention.go
+++ b/internal/gtsmodel/mention.go
@@ -25,17 +25,20 @@ type Mention struct {
// ID of this mention in the database
ID string `pg:"type:CHAR(26),pk,notnull,unique"`
// ID of the status this mention originates from
- StatusID string `pg:"type:CHAR(26),notnull"`
+ StatusID string `pg:"type:CHAR(26),notnull"`
+ Status *Status `pg:"rel:belongs-to"`
// When was this mention created?
CreatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
// When was this mention last updated?
UpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
// What's the internal account ID of the originator of the mention?
- OriginAccountID string `pg:"type:CHAR(26),notnull"`
+ OriginAccountID string `pg:"type:CHAR(26),notnull"`
+ OriginAccount *Account `pg:"rel:has-one"`
// What's the AP URI of the originator of the mention?
OriginAccountURI string `pg:",notnull"`
// What's the internal account ID of the mention target?
- TargetAccountID string `pg:"type:CHAR(26),notnull"`
+ TargetAccountID string `pg:"type:CHAR(26),notnull"`
+ TargetAccount *Account `pg:"rel:has-one"`
// Prevent this mention from generating a notification?
Silent bool
@@ -52,14 +55,14 @@ type Mention struct {
//
// This will not be put in the database, it's just for convenience.
NameString string `pg:"-"`
- // MentionedAccountURI is the AP ID (uri) of the user mentioned.
+ // TargetAccountURI is the AP ID (uri) of the user mentioned.
//
// This will not be put in the database, it's just for convenience.
- MentionedAccountURI string `pg:"-"`
- // MentionedAccountURL is the web url of the user mentioned.
+ TargetAccountURI string `pg:"-"`
+ // TargetAccountURL is the web url of the user mentioned.
//
// This will not be put in the database, it's just for convenience.
- MentionedAccountURL string `pg:"-"`
+ TargetAccountURL string `pg:"-"`
// A pointer to the gtsmodel account of the mentioned account.
- GTSAccount *Account `pg:"-"`
+
}