summaryrefslogtreecommitdiff
path: root/internal/api/model/status.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-02-08 12:17:18 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-02-08 12:17:18 +0100
commit4c294a596a9e0524f89b80e1608c3411f4fcf679 (patch)
tree23851533a5f1adb5442fd7c3c034578c34cd3f0d /internal/api/model/status.go
parentupdate outdated comment (diff)
parent[chore] Drone config update (#383) (diff)
downloadgotosocial-4c294a596a9e0524f89b80e1608c3411f4fcf679.tar.xz
Merge branch 'main' into media_refactor
Diffstat (limited to 'internal/api/model/status.go')
-rw-r--r--internal/api/model/status.go30
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