diff options
author | 2023-12-09 16:54:38 +0100 | |
---|---|---|
committer | 2023-12-09 16:54:38 +0100 | |
commit | cc91ea057da671ca572b6fae1a65b2acd47b6a66 (patch) | |
tree | 6c6e1213afa33ada49e1b6cb8286fd959d2b3503 /internal/typeutils/internaltofrontend.go | |
parent | [bugfix] Fix wrong notification type sent for poll end (#2429) (diff) | |
download | gotosocial-cc91ea057da671ca572b6fae1a65b2acd47b6a66.tar.xz |
[bugfix] Fix web media not showing as sensitive (#2433)
* [bugfix] Fix web media not showing as sensitive
* test
* go fmt
Diffstat (limited to 'internal/typeutils/internaltofrontend.go')
-rw-r--r-- | internal/typeutils/internaltofrontend.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index b3d263963..b91b2ad34 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -1530,7 +1530,7 @@ func (c *Converter) PollToAPIPoll(ctx context.Context, requester *gtsmodel.Accou } // convertAttachmentsToAPIAttachments will convert a slice of GTS model attachments to frontend API model attachments, falling back to IDs if no GTS models supplied. -func (c *Converter) convertAttachmentsToAPIAttachments(ctx context.Context, attachments []*gtsmodel.MediaAttachment, attachmentIDs []string) ([]apimodel.Attachment, error) { +func (c *Converter) convertAttachmentsToAPIAttachments(ctx context.Context, attachments []*gtsmodel.MediaAttachment, attachmentIDs []string) ([]*apimodel.Attachment, error) { var errs gtserror.MultiError if len(attachments) == 0 { @@ -1551,7 +1551,7 @@ func (c *Converter) convertAttachmentsToAPIAttachments(ctx context.Context, atta } // Preallocate expected frontend slice - apiAttachments := make([]apimodel.Attachment, 0, len(attachments)) + apiAttachments := make([]*apimodel.Attachment, 0, len(attachments)) // Convert GTS models to frontend models for _, attachment := range attachments { @@ -1560,7 +1560,7 @@ func (c *Converter) convertAttachmentsToAPIAttachments(ctx context.Context, atta errs.Appendf("error converting attchment %s to api attachment: %v", attachment.ID, err) continue } - apiAttachments = append(apiAttachments, apiAttachment) + apiAttachments = append(apiAttachments, &apiAttachment) } return apiAttachments, errs.Combine() |