[backend/masto-client] Set sensitive flag on drive files when posting sensitive status (ISH-292)

This commit is contained in:
Laura Hausmann 2024-05-02 22:39:42 +02:00
parent df1c8e5475
commit 21c042453c
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -389,6 +389,12 @@ public class StatusController(
newText = MfmSerializer.Serialize(parsed).Trim();
}
if (request is { Sensitive: true, MediaIds.Count: > 0 })
{
await db.DriveFiles.Where(p => request.MediaIds.Contains(p.Id) && !p.IsSensitive)
.ExecuteUpdateAsync(p => p.SetProperty(i => i.IsSensitive, _ => true));
}
var quote = request.QuoteId != null
? await db.Notes
.IncludeCommonProperties()