diff --git a/NotificationExtension/NotificationService.swift b/NotificationExtension/NotificationService.swift index 965c1f925d..c33f72563c 100644 --- a/NotificationExtension/NotificationService.swift +++ b/NotificationExtension/NotificationService.swift @@ -122,7 +122,12 @@ class NotificationService: UNNotificationServiceExtension { let notificationContent: String? if let status = notification.status { - notificationContent = NotificationService.textConverter.convert(html: status.content) + if notification.kind == .mention || notification.kind == .status, + !status.spoilerText.isEmpty { + notificationContent = "⚠️ \(status.spoilerText)" + } else { + notificationContent = NotificationService.textConverter.convert(html: status.content) + } } else if notification.kind == .follow || notification.kind == .followRequest { notificationContent = nil } else { @@ -135,7 +140,9 @@ class NotificationService: UNNotificationServiceExtension { // We deliberately don't include attachments for other types of notifications that have statuses (favs, etc.) // because we risk just fetching the same thing a bunch of times for many senders. if notification.kind == .mention || notification.kind == .status || notification.kind == .update, - let attachment = notification.status?.attachments.first { + let status = notification.status, + !status.sensitive, + let attachment = status.attachments.first { let url = attachment.previewURL ?? attachment.url attachmentDataTask = Task { do {