Audio Timeline Item support (#612)

* audio timeline item support

* improved the code to reduce cognitive complexity

* no need anymore for this swiftlint disabling of a rule

* pr comments
This commit is contained in:
Mauro
2023-02-23 12:06:31 +01:00
committed by GitHub
parent e48676e4eb
commit 698b0aea44
17 changed files with 204 additions and 70 deletions
@@ -117,6 +117,11 @@ extension NotificationItemProxy {
senderId: senderId,
roomId: roomId,
mediaProvider: mediaProvider)
case .audio(content: let content):
return try await processAudio(content: content,
senderId: senderId,
roomId: roomId,
mediaProvider: mediaProvider)
case .none:
return nil
}
@@ -222,4 +227,16 @@ extension NotificationItemProxy {
return notification
}
private func processAudio(content: AudioMessageContent,
senderId: String,
roomId: String,
mediaProvider: MediaProviderProtocol?) async throws -> UNMutableNotificationContent {
let notification = try await processCommon(senderId: senderId,
roomId: roomId,
mediaProvider: mediaProvider)
notification.body = "🔊 " + content.body
return notification
}
}