fix crash

This commit is contained in:
kosyak 2023-09-06 02:49:04 +02:00
parent 71ede7c31e
commit 9aac6d99e7

View file

@ -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) {