diff options
author | 2022-02-05 12:47:38 +0100 | |
---|---|---|
committer | 2022-02-05 12:47:38 +0100 | |
commit | 1b36e858406ff6b15217229d1abaaabdbeec24e8 (patch) | |
tree | 2a8dba5c81eb69c87aa0d8c930a4e7e2c5c2cfa6 /internal/api/model | |
parent | [docs] Fix documentation to show --config-path in the right position. (#375) (diff) | |
download | gotosocial-1b36e858406ff6b15217229d1abaaabdbeec24e8.tar.xz |
[feature] Rework timeline code to make it useful for more than just statuses (#373)
* add preparable and timelineable interfaces
* initialize timeline manager within the processor
* generic renaming
* move status-specific timeline logic into the processor
* refactor timeline to make it useful for more than statuses
Diffstat (limited to 'internal/api/model')
-rw-r--r-- | internal/api/model/status.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/internal/api/model/status.go b/internal/api/model/status.go index 3ff3f791d..fade58a49 100644 --- a/internal/api/model/status.go +++ b/internal/api/model/status.go @@ -96,6 +96,36 @@ type Status struct { Text string `json:"text"` } +/* +** The below functions are added onto the API model status so that it satisfies +** the Preparable interface in internal/timeline. + */ + +func (s *Status) GetID() string { + return s.ID +} + +func (s *Status) GetAccountID() string { + if s.Account != nil { + return s.Account.ID + } + return "" +} + +func (s *Status) GetBoostOfID() string { + if s.Reblog != nil { + return s.Reblog.ID + } + return "" +} + +func (s *Status) GetBoostOfAccountID() string { + if s.Reblog != nil && s.Reblog.Account != nil { + return s.Reblog.Account.ID + } + return "" +} + // StatusReblogged represents a reblogged status. // // swagger:model statusReblogged |