|
|
|
@ -735,9 +735,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|
|
|
|
private fun restoreDraftIfNeeded() {
|
|
|
|
|
val mediaURI = intent.data
|
|
|
|
|
val mediaType = AttachmentManager.MediaType.from(intent.type)
|
|
|
|
|
val mimeType = MediaUtil.getMimeType(this, mediaURI)
|
|
|
|
|
if (mediaURI != null && mediaType != null) {
|
|
|
|
|
if (AttachmentManager.MediaType.IMAGE == mediaType || AttachmentManager.MediaType.GIF == mediaType || AttachmentManager.MediaType.VIDEO == mediaType) {
|
|
|
|
|
val media = Media(mediaURI, MediaUtil.getMimeType(this, mediaURI)!!, 0, 0, 0, 0, Optional.absent(), Optional.absent())
|
|
|
|
|
if (mimeType != null && (AttachmentManager.MediaType.IMAGE == mediaType || AttachmentManager.MediaType.GIF == mediaType || AttachmentManager.MediaType.VIDEO == mediaType)) {
|
|
|
|
|
val media = Media(mediaURI, mimeType, 0, 0, 0, 0, Optional.absent(), Optional.absent())
|
|
|
|
|
startActivityForResult(MediaSendActivity.buildEditorIntent(this, listOf( media ), viewModel.recipient!!, ""), PICK_FROM_LIBRARY)
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|