mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Fix other API change: body renamed to filename
This commit is contained in:
committed by
Benoit Marty
parent
6a1ef6d6f7
commit
c1c9f53015
+1
-1
@@ -299,7 +299,7 @@ class DefaultNotifiableEventResolver @Inject constructor(
|
||||
.getMediaFile(
|
||||
mediaSource = messageType.source,
|
||||
mimeType = messageType.info?.mimetype,
|
||||
body = messageType.filename,
|
||||
filename = messageType.filename,
|
||||
)
|
||||
is VideoMessageType -> null // Use the thumbnail here?
|
||||
else -> null
|
||||
|
||||
+4
-4
@@ -47,13 +47,13 @@ interface NotificationMediaRepo {
|
||||
*
|
||||
* @param mediaSource the media source of the media.
|
||||
* @param mimeType the mime type of the media.
|
||||
* @param body optional body which will be used to name the file.
|
||||
* @param filename optional String which will be used to name the file.
|
||||
* @return A [Result] holding either the media [File] from the cache directory or an [Exception].
|
||||
*/
|
||||
suspend fun getMediaFile(
|
||||
mediaSource: MediaSource,
|
||||
mimeType: String?,
|
||||
body: String?,
|
||||
filename: String?,
|
||||
): Result<File>
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class DefaultNotificationMediaRepo @AssistedInject constructor(
|
||||
override suspend fun getMediaFile(
|
||||
mediaSource: MediaSource,
|
||||
mimeType: String?,
|
||||
body: String?,
|
||||
filename: String?,
|
||||
): Result<File> {
|
||||
val cachedFile = mediaSource.cachedFile()
|
||||
return when {
|
||||
@@ -84,7 +84,7 @@ class DefaultNotificationMediaRepo @AssistedInject constructor(
|
||||
else -> matrixMediaLoader.downloadMediaFile(
|
||||
source = mediaSource,
|
||||
mimeType = mimeType,
|
||||
body = body,
|
||||
filename = filename,
|
||||
).mapCatching {
|
||||
it.use { mediaFile ->
|
||||
val dest = cachedFile.apply { parentFile?.mkdirs() }
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ class FakeNotificationMediaRepo : NotificationMediaRepo {
|
||||
override suspend fun getMediaFile(
|
||||
mediaSource: MediaSource,
|
||||
mimeType: String?,
|
||||
body: String?,
|
||||
filename: String?,
|
||||
): Result<File> {
|
||||
return Result.failure(IllegalStateException("Fake class"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user