mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-22 15:57:30 -06:00
[feature] Status source endpoint (#2848)
* [feature] statusSource endpoint * finish up
This commit is contained in:
parent
ef16919d4a
commit
cef9924d9a
7 changed files with 320 additions and 0 deletions
|
|
@ -792,6 +792,17 @@ func (c *Converter) StatusToWebStatus(
|
|||
return webStatus, nil
|
||||
}
|
||||
|
||||
// StatusToAPIStatusSource returns the *apimodel.StatusSource of the given status.
|
||||
// Callers should check beforehand whether a requester has permission to view the
|
||||
// source of the status, and ensure they're passing only a local status into this function.
|
||||
func (c *Converter) StatusToAPIStatusSource(ctx context.Context, s *gtsmodel.Status) (*apimodel.StatusSource, error) {
|
||||
return &apimodel.StatusSource{
|
||||
ID: s.ID,
|
||||
Text: s.Text,
|
||||
SpoilerText: s.ContentWarning,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// statusToFrontend is a package internal function for
|
||||
// parsing a status into its initial frontend representation.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue