Timeline improvements (#41)

Tidying up.
Parent/child statuses now display correctly in status/id/context.
This commit is contained in:
Tobi Smethurst
2021-06-17 18:02:33 +02:00
committed by GitHub
parent b4288f3c47
commit 82d9f88e42
39 changed files with 739 additions and 602 deletions

View File

@ -46,8 +46,12 @@ type Status struct {
Local bool
// which account posted this status?
AccountID string `pg:"type:CHAR(26),notnull"`
// AP uri of the owner of this status
AccountURI string
// id of the status this status is a reply to
InReplyToID string `pg:"type:CHAR(26)"`
// AP uri of the status this status is a reply to
InReplyToURI string
// id of the account that this status replies to
InReplyToAccountID string `pg:"type:CHAR(26)"`
// id of the status this status is a boost of
@ -97,20 +101,6 @@ type Status struct {
GTSBoostedStatus *Status `pg:"-"`
// Account of the boosted status
GTSBoostedAccount *Account `pg:"-"`
/*
AP NON-DATABASE FIELDS
These are for convenience while passing the status around internally,
but these fields should *never* be put in the db.
*/
// AP URI of the status being replied to.
// Useful when that status doesn't exist in the database yet and we still need to dereference it.
APReplyToStatusURI string `pg:"-"`
// The AP URI of the owner/creator of the status.
// Useful when that account doesn't exist in the database yet and we still need to dereference it.
APStatusOwnerURI string `pg:"-"`
}
// Visibility represents the visibility granularity of a status.
@ -150,12 +140,3 @@ type VisibilityAdvanced struct {
// This status can be liked/faved
Likeable bool `pg:"default:true"`
}
// RelevantAccounts denotes accounts that are replied to, boosted by, or mentioned in a status.
type RelevantAccounts struct {
StatusAuthor *Account
ReplyToAccount *Account
BoostedAccount *Account
BoostedReplyToAccount *Account
MentionedAccounts []*Account
}