Refactor the NSE so that the original notification content is preserved between all the different processing steps

- building brand new content is probably interfering with how iOS syncs up delivered and seen notifications between devices
- simplify all the various steps and make the flows easier to follow
This commit is contained in:
Stefan Ceriu
2025-04-17 12:21:47 +03:00
committed by Stefan Ceriu
parent 7cf1d08b20
commit 5ad25d8492
6 changed files with 168 additions and 245 deletions
@@ -41,32 +41,4 @@ extension NotificationItemProxyProtocol {
var isDM: Bool {
isRoomDirect && roomJoinedMembers <= 2
}
var hasMedia: Bool {
if (isDM && senderAvatarMediaSource != nil) ||
(!isDM && roomAvatarMediaSource != nil) {
return true
}
switch event {
case .invite, .none:
return false
case .timeline(let event):
switch try? event.eventType() {
case .state, .none:
return false
case let .messageLike(content):
switch content {
case let .roomMessage(messageType, _):
switch messageType {
case .image, .video, .audio:
return true
default:
return false
}
default:
return false
}
}
}
}
}