mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Client API endpoints + v. basic web view for pinned posts (#1547)
* implement status pin client api + web handler * make test names + comments more descriptive * don't use separate table for status pins * remove unused add + remove checking * tidy up + add some more tests
This commit is contained in:
@ -32,6 +32,7 @@ type statusInteractions struct {
|
||||
Muted bool
|
||||
Bookmarked bool
|
||||
Reblogged bool
|
||||
Pinned bool
|
||||
}
|
||||
|
||||
func (c *converter) interactionsWithStatusForAccount(ctx context.Context, s *gtsmodel.Status, requestingAccount *gtsmodel.Account) (*statusInteractions, error) {
|
||||
@ -61,6 +62,12 @@ func (c *converter) interactionsWithStatusForAccount(ctx context.Context, s *gts
|
||||
return nil, fmt.Errorf("error checking if requesting account has bookmarked status: %s", err)
|
||||
}
|
||||
si.Bookmarked = bookmarked
|
||||
|
||||
// The only time 'pinned' should be true is if the
|
||||
// requesting account is looking at its OWN status.
|
||||
if s.AccountID == requestingAccount.ID {
|
||||
si.Pinned = !s.PinnedAt.IsZero()
|
||||
}
|
||||
}
|
||||
return si, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user