mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-07 04:24:29 +00:00
Fix dynamic permissions problem for MMS messages
This commit is contained in:
parent
425d6b8adf
commit
512dc19471
@ -1668,7 +1668,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
Permissions.with(this)
|
Permissions.with(this)
|
||||||
.request(Manifest.permission.SEND_SMS)
|
.request(Manifest.permission.SEND_SMS, Manifest.permission.READ_SMS)
|
||||||
.ifNecessary(!isSecureText || forceSms)
|
.ifNecessary(!isSecureText || forceSms)
|
||||||
.withPermanentDenialDialog(getString(R.string.ConversationActivity_signal_needs_sms_permission_in_order_to_send_an_sms))
|
.withPermanentDenialDialog(getString(R.string.ConversationActivity_signal_needs_sms_permission_in_order_to_send_an_sms))
|
||||||
.onAllGranted(() -> {
|
.onAllGranted(() -> {
|
||||||
|
@ -172,7 +172,7 @@ public class MmsSendJob extends SendJob {
|
|||||||
throws UndeliverableMessageException
|
throws UndeliverableMessageException
|
||||||
{
|
{
|
||||||
SendReq req = new SendReq();
|
SendReq req = new SendReq();
|
||||||
String lineNumber = Utils.getMyPhoneNumber(context);
|
String lineNumber = getMyNumber(context);
|
||||||
Address destination = message.getRecipient().getAddress();
|
Address destination = message.getRecipient().getAddress();
|
||||||
MediaConstraints mediaConstraints = MediaConstraints.getMmsMediaConstraints(message.getSubscriptionId());
|
MediaConstraints mediaConstraints = MediaConstraints.getMmsMediaConstraints(message.getSubscriptionId());
|
||||||
List<Attachment> scaledAttachments = scaleAttachments(masterSecret, mediaConstraints, message.getAttachments());
|
List<Attachment> scaledAttachments = scaleAttachments(masterSecret, mediaConstraints, message.getAttachments());
|
||||||
@ -287,4 +287,12 @@ public class MmsSendJob extends SendJob {
|
|||||||
MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getMyNumber(Context context) throws UndeliverableMessageException {
|
||||||
|
try {
|
||||||
|
return Utils.getMyPhoneNumber(context);
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
throw new UndeliverableMessageException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user