Timeline manager (#40)

* start messing about with timeline manager

* i have no idea what i'm doing

* i continue to not know what i'm doing

* it's coming along

* bit more progress

* update timeline with new posts as they come in

* lint and fmt

* Select accounts where empty string

* restructure a bunch, get unfaves working

* moving stuff around

* federate status deletes properly

* mention regex better but not 100% there

* fix regex

* some more hacking away at the timeline code phew

* fix up some little things

* i can't even

* more timeline stuff

* move to ulid

* fiddley

* some lil fixes for kibou compatibility

* timelines working pretty alright!

* tidy + lint
This commit is contained in:
Tobi Smethurst
2021-06-13 18:42:28 +02:00
committed by GitHub
parent 6ac6f8d614
commit b4288f3c47
96 changed files with 3458 additions and 1679 deletions

View File

@ -23,7 +23,7 @@ import "time"
// Status represents a user-created 'post' or 'status' in the database, either remote or local
type Status struct {
// id of the status in the database
ID string `pg:"type:uuid,default:gen_random_uuid(),pk,notnull"`
ID string `pg:"type:CHAR(26),pk,notnull"`
// uri at which this status is reachable
URI string `pg:",unique"`
// web url for viewing this status
@ -45,13 +45,13 @@ type Status struct {
// is this status from a local account?
Local bool
// which account posted this status?
AccountID string
AccountID string `pg:"type:CHAR(26),notnull"`
// id of the status this status is a reply to
InReplyToID string
InReplyToID string `pg:"type:CHAR(26)"`
// id of the account that this status replies to
InReplyToAccountID string
InReplyToAccountID string `pg:"type:CHAR(26)"`
// id of the status this status is a boost of
BoostOfID string
BoostOfID string `pg:"type:CHAR(26)"`
// cw string for this status
ContentWarning string
// visibility entry for this status
@ -61,7 +61,7 @@ type Status struct {
// what language is this status written in?
Language string
// Which application was used to create this status?
CreatedWithApplicationID string
CreatedWithApplicationID string `pg:"type:CHAR(26)"`
// advanced visibility for this status
VisibilityAdvanced *VisibilityAdvanced
// What is the activitystreams type of this status? See: https://www.w3.org/TR/activitystreams-vocabulary/#object-types
@ -153,6 +153,7 @@ type VisibilityAdvanced struct {
// 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