diff options
author | 2021-05-08 14:25:23 +0200 | |
---|---|---|
committer | 2021-05-08 14:25:23 +0200 | |
commit | ac9adb172b09882b12659a3e43a94d724eb65378 (patch) | |
tree | 0f97edf4377f406df321054d26e731ff5dcc6667 /internal/mastotypes | |
parent | make boosts work woo (#12) (diff) | |
download | gotosocial-ac9adb172b09882b12659a3e43a94d724eb65378.tar.xz |
Revert "make boosts work woo (#12)" (#15)
This reverts commit 9616f46424363adbc124da52c6728ca047506403.
Diffstat (limited to 'internal/mastotypes')
-rw-r--r-- | internal/mastotypes/converter.go | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/internal/mastotypes/converter.go b/internal/mastotypes/converter.go index c11e18638..e689b62da 100644 --- a/internal/mastotypes/converter.go +++ b/internal/mastotypes/converter.go @@ -380,55 +380,7 @@ func (c *converter) StatusToMasto( } } - var mastoRebloggedStatus *mastotypes.Status - if s.BoostOfID != "" { - // the boosted status might have been set on this struct already so check first before doing db calls - var gtsBoostedStatus *gtsmodel.Status - if s.GTSBoostedStatus != nil { - // it's set, great! - gtsBoostedStatus = s.GTSBoostedStatus - } else { - // it's not set so fetch it from the db - gtsBoostedStatus = >smodel.Status{} - if err := c.db.GetByID(s.BoostOfID, gtsBoostedStatus); err != nil { - return nil, fmt.Errorf("error getting boosted status with id %s: %s", s.BoostOfID, err) - } - } - - // the boosted account might have been set on this struct already or passed as a param so check first before doing db calls - var gtsBoostedAccount *gtsmodel.Account - if s.GTSBoostedAccount != nil { - // it's set, great! - gtsBoostedAccount = s.GTSBoostedAccount - } else if boostOfAccount != nil { - // it's been given as a param, great! - gtsBoostedAccount = boostOfAccount - } else if boostOfAccount == nil && s.GTSBoostedAccount == nil { - // it's not set so fetch it from the db - gtsBoostedAccount = >smodel.Account{} - if err := c.db.GetByID(gtsBoostedStatus.AccountID, gtsBoostedAccount); err != nil { - return nil, fmt.Errorf("error getting boosted account %s from status with id %s: %s", gtsBoostedStatus.AccountID, s.BoostOfID, err) - } - } - - // the boosted status might be a reply so check this - var gtsBoostedReplyToAccount *gtsmodel.Account - if gtsBoostedStatus.InReplyToAccountID != "" { - gtsBoostedReplyToAccount = >smodel.Account{} - if err := c.db.GetByID(gtsBoostedStatus.InReplyToAccountID, gtsBoostedReplyToAccount); err != nil { - return nil, fmt.Errorf("error getting account that boosted status was a reply to: %s", err) - } - } - - if gtsBoostedStatus != nil || gtsBoostedAccount != nil { - mastoRebloggedStatus, err = c.StatusToMasto(gtsBoostedStatus, gtsBoostedAccount, requestingAccount, nil, gtsBoostedReplyToAccount, nil) - if err != nil { - return nil, fmt.Errorf("error converting boosted status to mastotype: %s", err) - } - } else { - return nil, fmt.Errorf("boost of id was set to %s but that status or account was nil", s.BoostOfID) - } - } + var mastoRebloggedStatus *mastotypes.Status // TODO var mastoApplication *mastotypes.Application if s.CreatedWithApplicationID != "" { |