summaryrefslogtreecommitdiff
path: root/internal/typeutils/astointernal.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-06-17 18:02:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-17 18:02:33 +0200
commit82d9f88e424fffacfa9a9c1c26f2f702b97f3e3a (patch)
tree60379f8eb809e9019222f67a13b547e4a26bfc83 /internal/typeutils/astointernal.go
parentTimeline manager (#40) (diff)
downloadgotosocial-82d9f88e424fffacfa9a9c1c26f2f702b97f3e3a.tar.xz
Timeline improvements (#41)
Tidying up. Parent/child statuses now display correctly in status/id/context.
Diffstat (limited to 'internal/typeutils/astointernal.go')
-rw-r--r--internal/typeutils/astointernal.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go
index 5990e750f..dc58346fb 100644
--- a/internal/typeutils/astointernal.go
+++ b/internal/typeutils/astointernal.go
@@ -222,13 +222,14 @@ func (c *converter) ASStatusToStatus(statusable Statusable) (*gtsmodel.Status, e
if err != nil {
return nil, errors.New("attributedTo was empty")
}
- status.APStatusOwnerURI = attributedTo.String()
+ status.AccountURI = attributedTo.String()
statusOwner := &gtsmodel.Account{}
if err := c.db.GetWhere([]db.Where{{Key: "uri", Value: attributedTo.String(), CaseInsensitive: true}}, statusOwner); err != nil {
return nil, fmt.Errorf("couldn't get status owner from db: %s", err)
}
status.AccountID = statusOwner.ID
+ status.AccountURI = statusOwner.URI
status.GTSAuthorAccount = statusOwner
// check if there's a post that this is a reply to
@@ -236,7 +237,7 @@ func (c *converter) ASStatusToStatus(statusable Statusable) (*gtsmodel.Status, e
if err == nil {
// something is set so we can at least set this field on the
// status and dereference using this later if we need to
- status.APReplyToStatusURI = inReplyToURI.String()
+ status.InReplyToURI = inReplyToURI.String()
// now we can check if we have the replied-to status in our db already
inReplyToStatus := &gtsmodel.Status{}
@@ -475,6 +476,7 @@ func (c *converter) ASAnnounceToStatus(announceable Announceable) (*gtsmodel.Sta
return nil, isNew, fmt.Errorf("ASAnnounceToStatus: error in db fetching account with uri %s: %s", actor.String(), err)
}
status.AccountID = boostingAccount.ID
+ status.AccountURI = boostingAccount.URI
// these will all be wrapped in the boosted status so set them empty here
status.Attachments = []string{}