Bug 828861 - B2G PhoneNumberJS: Don't apply network mcc to to SMS in roaming scenario. r=vyang

This commit is contained in:
Borja Salguero 2013-01-28 18:11:22 -08:00
parent 9c2f05bfc9
commit b5ad552ee6

View File

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