mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add developer option to hide media in the timeline. (#3366)
This commit is contained in:
@@ -11,6 +11,7 @@ import UserNotifications
|
||||
|
||||
struct NotificationContentBuilder {
|
||||
let messageEventStringBuilder: RoomMessageEventStringBuilder
|
||||
let settings: CommonSettingsProtocol
|
||||
|
||||
/// Process the given notification item proxy
|
||||
/// - Parameters:
|
||||
@@ -100,6 +101,8 @@ struct NotificationContentBuilder {
|
||||
let displayName = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName
|
||||
notification.body = String(messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: displayName).characters)
|
||||
|
||||
guard !settings.hideTimelineMedia else { return notification }
|
||||
|
||||
switch messageType {
|
||||
case .image(content: let content):
|
||||
notification = await notification.addMediaAttachment(using: mediaProvider,
|
||||
|
||||
@@ -33,7 +33,8 @@ import UserNotifications
|
||||
// database, logging, etc. are only ever setup once per *process*
|
||||
|
||||
private let settings: CommonSettingsProtocol = AppSettings()
|
||||
private let notificationContentBuilder = NotificationContentBuilder(messageEventStringBuilder: RoomMessageEventStringBuilder(attributedStringBuilder: AttributedStringBuilder(mentionBuilder: PlainMentionBuilder()), prefix: .none))
|
||||
private let notificationContentBuilder = NotificationContentBuilder(messageEventStringBuilder: RoomMessageEventStringBuilder(attributedStringBuilder: AttributedStringBuilder(mentionBuilder: PlainMentionBuilder()), prefix: .none),
|
||||
settings: settings)
|
||||
private let keychainController = KeychainController(service: .sessions,
|
||||
accessGroup: InfoPlistReader.main.keychainAccessGroupIdentifier)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user