mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-17 19:58:57 +03:00
catching any potential errors whilst download/exporting the notification image, will allow us to continue to show the notifications
This commit is contained in:
parent
8cc68e16d2
commit
a37ff83fdc
1 changed files with 9 additions and 5 deletions
|
@ -208,11 +208,15 @@ class NotifiableEventResolver @Inject constructor(
|
|||
}
|
||||
|
||||
private suspend fun TimelineEvent.downloadAndExportImage(session: Session): Uri? {
|
||||
return getLastMessageContent()?.takeAs<MessageWithAttachmentContent>()?.let { imageMessage ->
|
||||
val fileService = session.fileService()
|
||||
fileService.downloadFile(imageMessage)
|
||||
fileService.getTemporarySharableURI(imageMessage)
|
||||
}
|
||||
return kotlin.runCatching {
|
||||
getLastMessageContent()?.takeAs<MessageWithAttachmentContent>()?.let { imageMessage ->
|
||||
val fileService = session.fileService()
|
||||
fileService.downloadFile(imageMessage)
|
||||
fileService.getTemporarySharableURI(imageMessage)
|
||||
}
|
||||
}.onFailure {
|
||||
Timber.e(it, "Failed to download and export image for notification")
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
private fun resolveStateRoomEvent(event: Event, session: Session, canBeReplaced: Boolean, isNoisy: Boolean): NotifiableEvent? {
|
||||
|
|
Loading…
Add table
Reference in a new issue