1
0
Fork 1

Fix take photo option for choose media

(cherry picked from commit 3857d7e52f7485e0055d8f0b9be08fb53250aa4f)
This commit is contained in:
Stephen Paul Weber 2024-11-27 16:48:42 -05:00 committed by Arne
parent f7978709e5
commit 127bc51034

View file

@ -1427,7 +1427,12 @@ public class ConversationFragment extends XmppFragment
case REQUEST_START_VIDEO_CALL:
triggerRtpSession(RtpSessionActivity.ACTION_MAKE_VIDEO_CALL);
break;
case ATTACHMENT_CHOICE_CHOOSE_IMAGE:
case ATTACHMENT_CHOICE_CHOOSE_IMAGE: {
final Uri takePhotoUri = pendingTakePhotoUri.pop();
if (takePhotoUri != null && data.getData() == null && data.getClipData() == null) {
mediaPreviewAdapter.addMediaPreviews(
Attachment.of(getActivity(), takePhotoUri, Attachment.Type.IMAGE));
}
final List<Attachment> imageUris =
Attachment.extractAttachments(getActivity(), data, Attachment.Type.IMAGE);
if (imageUris.size() == 1) {
@ -1437,7 +1442,8 @@ public class ConversationFragment extends XmppFragment
toggleInputMethod();
}
break;
case ATTACHMENT_CHOICE_TAKE_PHOTO:
}
case ATTACHMENT_CHOICE_TAKE_PHOTO: {
final Uri takePhotoUri = pendingTakePhotoUri.pop();
if (takePhotoUri != null) {
editImage(takePhotoUri);
@ -1454,6 +1460,7 @@ public class ConversationFragment extends XmppFragment
Log.d(Config.LOGTAG, "lost take photo uri. unable to to attach");
}
break;
}
case ATTACHMENT_CHOICE_CHOOSE_FILE:
case ATTACHMENT_CHOICE_RECORD_VIDEO:
case ATTACHMENT_CHOICE_RECORD_VOICE: