Handle no uri to share case.
This commit is contained in:
parent
64cb42af75
commit
767e1b4259
1 changed files with 19 additions and 15 deletions
|
|
@ -75,21 +75,25 @@ class SharePresenter @AssistedInject constructor(
|
||||||
val result = shareIntentHandler.handleIncomingShareIntent(
|
val result = shareIntentHandler.handleIncomingShareIntent(
|
||||||
intent,
|
intent,
|
||||||
onUris = { filesToShare ->
|
onUris = { filesToShare ->
|
||||||
roomIds
|
if (filesToShare.isEmpty()) {
|
||||||
.map { roomId ->
|
false
|
||||||
val room = matrixClient.getRoom(roomId) ?: return@map false
|
} else {
|
||||||
val mediaSender = MediaSender(preProcessor = mediaPreProcessor, room = room)
|
roomIds
|
||||||
filesToShare
|
.map { roomId ->
|
||||||
.map { fileToShare ->
|
val room = matrixClient.getRoom(roomId) ?: return@map false
|
||||||
mediaSender.sendMedia(
|
val mediaSender = MediaSender(preProcessor = mediaPreProcessor, room = room)
|
||||||
uri = fileToShare.uri,
|
filesToShare
|
||||||
mimeType = fileToShare.mimeType,
|
.map { fileToShare ->
|
||||||
compressIfPossible = true,
|
mediaSender.sendMedia(
|
||||||
).isSuccess
|
uri = fileToShare.uri,
|
||||||
}
|
mimeType = fileToShare.mimeType,
|
||||||
.all { it }
|
compressIfPossible = true,
|
||||||
}
|
).isSuccess
|
||||||
.all { it }
|
}
|
||||||
|
.all { it }
|
||||||
|
}
|
||||||
|
.all { it }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onPlainText = { text ->
|
onPlainText = { text ->
|
||||||
roomIds
|
roomIds
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue