From cc91ea057da671ca572b6fae1a65b2acd47b6a66 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:54:38 +0100 Subject: [bugfix] Fix web media not showing as sensitive (#2433) * [bugfix] Fix web media not showing as sensitive * test * go fmt --- internal/typeutils/internaltofrontend.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/typeutils/internaltofrontend.go') 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() -- cgit v1.2.3