[backend/federation] Fix media being incorrectly classified as sensitive
Some AP implementations send an empty string as content warning when they mean no content warning, this is handled correctly by CreateNoteAsync and UpdateNoteAsync but wasn't respected in the attachment processing code paths. This commit resolves that issue.
This commit is contained in:
parent
039d46477a
commit
b6304dc882
1 changed files with 2 additions and 2 deletions
|
@ -759,7 +759,7 @@ public class NoteService(
|
|||
};
|
||||
}
|
||||
|
||||
var sensitive = (note.Sensitive ?? false) || cw != null;
|
||||
var sensitive = (note.Sensitive ?? false) || !string.IsNullOrWhiteSpace(cw);
|
||||
var files = await ProcessAttachmentsAsync(note.Attachments, actor, sensitive);
|
||||
var emoji = (await emojiSvc.ProcessEmojiAsync(note.Tags?.OfType<ASEmoji>().ToList(), actor.Host))
|
||||
.Select(p => p.Id)
|
||||
|
@ -820,7 +820,7 @@ public class NoteService(
|
|||
};
|
||||
}
|
||||
|
||||
var sensitive = (note.Sensitive ?? false) || dbNote.Cw != null;
|
||||
var sensitive = (note.Sensitive ?? false) || !string.IsNullOrWhiteSpace(cw);
|
||||
var files = await ProcessAttachmentsAsync(note.Attachments, actor, sensitive, false);
|
||||
var emoji = (await emojiSvc.ProcessEmojiAsync(note.Tags?.OfType<ASEmoji>().ToList(), actor.Host))
|
||||
.Select(p => p.Id)
|
||||
|
|
Loading…
Add table
Reference in a new issue