isDM in Notifications (#1254)

* isDm

* isDm added and some code improvements

* Bump SDK and fix one name.

* changelog

---------

Co-authored-by: Mauro Romito <mauro.romito@element.io>
This commit is contained in:
Doug
2023-07-05 18:40:05 +01:00
committed by GitHub
parent bfd75a335d
commit 9ebc57e1cf
7 changed files with 83 additions and 79 deletions
@@ -112,15 +112,15 @@ extension UNMutableNotificationContent {
var fetchedImage: INImage?
let image: INImage
if let mediaSource = icon.mediaSource {
if let mediaProvider {
switch await mediaProvider.loadImageDataFromSource(mediaSource) {
case .success(let data):
fetchedImage = INImage(imageData: data)
case .failure(let error):
MXLog.error("Couldn't add sender icon: \(error)")
// ...The provider failed to fetch
needsPlaceholder = true
}
switch await mediaProvider?.loadImageDataFromSource(mediaSource) {
case .success(let data):
fetchedImage = INImage(imageData: data)
case .failure(let error):
MXLog.error("Couldn't add sender icon: \(error)")
// ...The provider failed to fetch
needsPlaceholder = true
case .none:
break
}
} else {
// ...There is no media