From 9aac6d99e71d23aa58a5a0501828409c759282b6 Mon Sep 17 00:00:00 2001 From: kosyak Date: Wed, 6 Sep 2023 02:49:04 +0200 Subject: [PATCH] fix crash --- .../conversations/ui/ConversationFragment.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 1760f6dbe..0013b8276 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1705,7 +1705,7 @@ public class ConversationFragment extends XmppFragment .getOngoingRtpConnection(conversation.getContact()); if (ongoingRtpSession.isPresent()) { final OngoingRtpSession id = ongoingRtpSession.get(); - final Intent intent = new Intent(getActivity(), RtpSessionActivity.class); + final Intent intent = new Intent(activity, RtpSessionActivity.class); intent.putExtra( RtpSessionActivity.EXTRA_ACCOUNT, id.getAccount().getJid().asBareJid().toEscapedString()); @@ -1720,7 +1720,7 @@ public class ConversationFragment extends XmppFragment intent.setAction(RtpSessionActivity.ACTION_MAKE_VOICE_CALL); } } - startActivity(intent); + activity.startActivity(intent); } } @@ -2100,13 +2100,13 @@ public class ConversationFragment extends XmppFragment } protected void muteConversationDialog(final Conversation conversation) { - final AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity()); + final AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(R.string.disable_notifications); - final int[] durations = getResources().getIntArray(R.array.mute_options_durations); + final int[] durations = activity.getResources().getIntArray(R.array.mute_options_durations); final CharSequence[] labels = new CharSequence[durations.length]; for (int i = 0; i < durations.length; ++i) { if (durations[i] == -1) { - labels[i] = getString(R.string.until_further_notice); + labels[i] = activity.getString(R.string.until_further_notice); } else { labels[i] = TimeFrameUtils.resolve(activity, 1000L * durations[i]); } @@ -2124,7 +2124,7 @@ public class ConversationFragment extends XmppFragment activity.xmppConnectionService.updateConversation(conversation); activity.onConversationsListItemUpdated(); refresh(); - requireActivity().invalidateOptionsMenu(); + activity.invalidateOptionsMenu(); }); builder.create().show(); } @@ -2162,7 +2162,7 @@ public class ConversationFragment extends XmppFragment this.activity.xmppConnectionService.updateConversation(conversation); this.activity.onConversationsListItemUpdated(); refresh(); - requireActivity().invalidateOptionsMenu(); + activity.invalidateOptionsMenu(); } protected void invokeAttachFileIntent(final int attachmentChoice) {