[bugfix] Fix web media not showing as sensitive (#2433)

* [bugfix] Fix web media not showing as sensitive

* test

* go fmt
This commit is contained in:
tobi
2023-12-09 16:54:38 +01:00
committed by GitHub
parent c6d6fec17d
commit cc91ea057d
6 changed files with 145 additions and 12 deletions

View File

@ -111,11 +111,11 @@ func misskeyReportInlineURLs(content string) []*url.URL {
// </ul>
// </p>
// </aside>
func placeholdUnknownAttachments(arr []apimodel.Attachment) (string, []apimodel.Attachment) {
func placeholdUnknownAttachments(arr []*apimodel.Attachment) (string, []*apimodel.Attachment) {
// Extract unknown-type attachments into a separate
// slice, deleting them from arr in the process.
var unknowns []apimodel.Attachment
arr = slices.DeleteFunc(arr, func(elem apimodel.Attachment) bool {
var unknowns []*apimodel.Attachment
arr = slices.DeleteFunc(arr, func(elem *apimodel.Attachment) bool {
unknown := elem.Type == "unknown"
if unknown {
// Set aside unknown-type attachment.