diff options
Diffstat (limited to 'internal/typeutils/internaltofrontend.go')
-rw-r--r-- | internal/typeutils/internaltofrontend.go | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index c0cd3d7e7..9d99205f6 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -982,13 +982,23 @@ func filterAppliesInContext(filter *gtsmodel.Filter, filterContext statusfilter. func (c *Converter) StatusToWebStatus( ctx context.Context, s *gtsmodel.Status, - requestingAccount *gtsmodel.Account, -) (*apimodel.Status, error) { - webStatus, err := c.statusToFrontend(ctx, s, requestingAccount, statusfilter.FilterContextNone, nil, nil) +) (*apimodel.WebStatus, error) { + apiStatus, err := c.statusToFrontend( + ctx, + s, + nil, // No authed requester. + statusfilter.FilterContextNone, + nil, // No filters. + nil, // No mutes. + ) if err != nil { return nil, err } + webStatus := &apimodel.WebStatus{ + Status: apiStatus, + } + // Whack a newline before and after each "pre" to make it easier to outdent it. webStatus.Content = strings.ReplaceAll(webStatus.Content, "<pre>", "\n<pre>") webStatus.Content = strings.ReplaceAll(webStatus.Content, "</pre>", "</pre>\n") @@ -1014,7 +1024,7 @@ func (c *Converter) StatusToWebStatus( // format them for easier template consumption. totalVotes := poll.VotesCount - webPollOptions := make([]apimodel.WebPollOption, len(poll.Options)) + PollOptions := make([]apimodel.WebPollOption, len(poll.Options)) for i, option := range poll.Options { var voteShare float32 @@ -1046,10 +1056,10 @@ func (c *Converter) StatusToWebStatus( VoteShare: voteShare, VoteShareStr: voteShareStr, } - webPollOptions[i] = webPollOption + PollOptions[i] = webPollOption } - webStatus.WebPollOptions = webPollOptions + webStatus.PollOptions = PollOptions } // Set additional templating @@ -1058,6 +1068,7 @@ func (c *Converter) StatusToWebStatus( a.Sensitive = webStatus.Sensitive } + // Mark this as a local status. webStatus.Local = *s.Local return webStatus, nil |