From 9de6c44b16b1a3fd9a6306b5f02bbba1d82b5334 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 25 Oct 2022 12:31:08 -0400 Subject: [PATCH] Fix an issue with sharing file attachments into the app. --- .../securesms/conversation/ConversationParentFragment.java | 2 +- .../org/thoughtcrime/securesms/mms/AttachmentManager.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java index 1ec3b1dc6..f0770ff7e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java @@ -2052,7 +2052,7 @@ public class ConversationParentFragment extends Fragment inputPanel.setListener(this); inputPanel.setMediaListener(this); - attachmentManager = new AttachmentManager(requireActivity(), this); + attachmentManager = new AttachmentManager(requireContext(), view, this); audioRecorder = new AudioRecorder(requireContext()); typingTextWatcher = new ComposeTextWatcher(); diff --git a/app/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java b/app/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java index 092f6b92f..e54cb2179 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java +++ b/app/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java @@ -101,10 +101,10 @@ public class AttachmentManager { private @NonNull Optional slide = Optional.empty(); private @Nullable Uri captureUri; - public AttachmentManager(@NonNull Activity activity, @NonNull AttachmentListener listener) { - this.context = activity; + public AttachmentManager(@NonNull Context context, @NonNull View rootView, @NonNull AttachmentListener listener) { + this.context = context; this.attachmentListener = listener; - this.attachmentViewStub = ViewUtil.findStubById(activity, R.id.attachment_editor_stub); + this.attachmentViewStub = ViewUtil.findStubById(rootView, R.id.attachment_editor_stub); } private void inflateStub() {