mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 09:01:16 +00:00
Bug 828861 - B2G PhoneNumberJS: Don't apply network mcc to to SMS in roaming scenario. r=vyang
This commit is contained in:
parent
9c2f05bfc9
commit
b5ad552ee6
@ -764,8 +764,9 @@ SmsDatabaseService.prototype = {
|
||||
|
||||
saveSendingMessage: function saveSendingMessage(
|
||||
aReceiver, aBody, aDeliveryStatus, aDate, aCallback) {
|
||||
let sender = this.mRIL.rilContext.icc
|
||||
? this.mRIL.rilContext.icc.msisdn
|
||||
let rilContext = this.mRIL.rilContext;
|
||||
let sender = rilContext.icc
|
||||
? rilContext.icc.msisdn
|
||||
: null;
|
||||
|
||||
// Workaround an xpconnect issue with undefined string objects.
|
||||
@ -775,18 +776,21 @@ SmsDatabaseService.prototype = {
|
||||
}
|
||||
|
||||
let receiver = aReceiver;
|
||||
if (receiver) {
|
||||
let parsedNumber = PhoneNumberUtils.parse(receiver.toString());
|
||||
receiver = (parsedNumber && parsedNumber.internationalNumber)
|
||||
? parsedNumber.internationalNumber
|
||||
: receiver;
|
||||
}
|
||||
|
||||
if (sender) {
|
||||
let parsedNumber = PhoneNumberUtils.parse(sender.toString());
|
||||
sender = (parsedNumber && parsedNumber.internationalNumber)
|
||||
? parsedNumber.internationalNumber
|
||||
: sender;
|
||||
if (rilContext.voice.network.mcc === rilContext.icc.mcc) {
|
||||
if (receiver) {
|
||||
let parsedNumber = PhoneNumberUtils.parse(receiver.toString());
|
||||
receiver = (parsedNumber && parsedNumber.internationalNumber)
|
||||
? parsedNumber.internationalNumber
|
||||
: receiver;
|
||||
}
|
||||
|
||||
if (sender) {
|
||||
let parsedNumber = PhoneNumberUtils.parse(sender.toString());
|
||||
sender = (parsedNumber && parsedNumber.internationalNumber)
|
||||
? parsedNumber.internationalNumber
|
||||
: sender;
|
||||
}
|
||||
}
|
||||
|
||||
let message = {
|
||||
|
Loading…
Reference in New Issue
Block a user