mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-27 00:28:58 +00:00
Fix UI side of broken MMS fallback.
1) Actually tell the SendReceiveService to send the MMS if it is one. 2) Display the correct string (SMS vs MMS) in the fallback dialog.
This commit is contained in:
@@ -518,17 +518,24 @@ public class ConversationItem extends LinearLayout {
|
||||
private void handleMessageApproval() {
|
||||
final int title;
|
||||
final int message;
|
||||
|
||||
if (messageRecord.isPendingSecureSmsFallback()) {
|
||||
title = R.string.ConversationItem_click_to_approve_dialog_title;
|
||||
if (messageRecord.isMms()) title = R.string.ConversationItem_click_to_approve_mms_dialog_title;
|
||||
else title = R.string.ConversationItem_click_to_approve_sms_dialog_title;
|
||||
|
||||
message = -1;
|
||||
} else {
|
||||
title = R.string.ConversationItem_click_to_approve_unencrypted_dialog_title;
|
||||
if (messageRecord.isMms()) title = R.string.ConversationItem_click_to_approve_unencrypted_mms_dialog_title;
|
||||
else title = R.string.ConversationItem_click_to_approve_unencrypted_sms_dialog_title;
|
||||
|
||||
message = R.string.ConversationItem_click_to_approve_unencrypted_dialog_message;
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(title);
|
||||
|
||||
if (message > -1) builder.setMessage(message);
|
||||
|
||||
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
@@ -547,12 +554,17 @@ public class ConversationItem extends LinearLayout {
|
||||
database.markAsOutbox(messageRecord.getId());
|
||||
database.markAsForcedSms(messageRecord.getId());
|
||||
}
|
||||
|
||||
Intent intent = new Intent(context, SendReceiveService.class);
|
||||
intent.setAction(SendReceiveService.SEND_SMS_ACTION);
|
||||
intent.setAction(messageRecord.isMms() ?
|
||||
SendReceiveService.SEND_MMS_ACTION :
|
||||
SendReceiveService.SEND_SMS_ACTION);
|
||||
intent.putExtra(SendReceiveService.MASTER_SECRET_EXTRA, masterSecret);
|
||||
|
||||
context.startService(intent);
|
||||
}
|
||||
});
|
||||
|
||||
builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
|
||||
Reference in New Issue
Block a user