mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-22 15:47:28 -06:00
refining status views etc
This commit is contained in:
parent
3868803ff1
commit
eb9de53776
14 changed files with 184 additions and 90 deletions
|
|
@ -87,16 +87,12 @@ func (c *converter) AccountToMastoPublic(a *gtsmodel.Account) (*model.Account, e
|
|||
}
|
||||
|
||||
// count statuses
|
||||
statuses := []gtsmodel.Status{}
|
||||
if err := c.db.GetStatusesByAccountID(a.ID, &statuses); err != nil {
|
||||
statusesCount, err := c.db.CountStatusesByAccountID(a.ID)
|
||||
if err != nil {
|
||||
if _, ok := err.(db.ErrNoEntries); !ok {
|
||||
return nil, fmt.Errorf("error getting last statuses: %s", err)
|
||||
}
|
||||
}
|
||||
var statusesCount int
|
||||
if statuses != nil {
|
||||
statusesCount = len(statuses)
|
||||
}
|
||||
|
||||
// check when the last status was
|
||||
lastStatus := >smodel.Status{}
|
||||
|
|
@ -295,7 +291,6 @@ func (c *converter) StatusToMasto(
|
|||
var faved bool
|
||||
var reblogged bool
|
||||
var bookmarked bool
|
||||
var pinned bool
|
||||
var muted bool
|
||||
|
||||
// requestingAccount will be nil for public requests without auth
|
||||
|
|
@ -320,11 +315,6 @@ func (c *converter) StatusToMasto(
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("error checking if requesting account has bookmarked status: %s", err)
|
||||
}
|
||||
|
||||
pinned, err = c.db.StatusPinnedBy(s, requestingAccount.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error checking if requesting account has pinned status: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
var mastoRebloggedStatus *model.Status
|
||||
|
|
@ -523,7 +513,7 @@ func (c *converter) StatusToMasto(
|
|||
Reblogged: reblogged,
|
||||
Muted: muted,
|
||||
Bookmarked: bookmarked,
|
||||
Pinned: pinned,
|
||||
Pinned: s.Pinned,
|
||||
Content: s.Content,
|
||||
Reblog: mastoRebloggedStatus,
|
||||
Application: mastoApplication,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue