Backed out changeset 8446a3ac5060 (bug 921918) Windows XP Debug Bustage on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2013-11-25 08:55:45 +01:00
Родитель 15e2e7d141
Коммит ae87dbcf4b
3 изменённых файлов: 31 добавлений и 28 удалений

Просмотреть файл

@ -43,9 +43,12 @@ interface nsIRilMobileMessageDatabaseService : nsIMobileMessageDatabaseService
*
* - If |type| == "mms", we also need:
* - |delivery| DOMString: the delivery state of received message
* - |deliveryStatus| DOMString: the delivery status of received message
* - |deliveryStatus| DOMString Array: the delivery status of received message
* - |receivers| DOMString Array: the phone numbers of receivers
* - |phoneNumber| DOMString: [optional] my own phone number.
*
* Note: |deliveryStatus| should only contain single string to specify
* the delivery status of MMS message for the phone owner self.
*/
void saveReceivedMessage(in jsval aMessage,
[optional] in nsIRilMobileMessageDatabaseCallback aCallback);

Просмотреть файл

@ -1431,31 +1431,29 @@ MmsService.prototype = {
retrievalMode) {
intermediate.type = "mms";
intermediate.delivery = DELIVERY_NOT_DOWNLOADED;
// As a receiver, we don't need to care about the delivery status of others.
let deliveryInfo = intermediate.deliveryInfo = [{
receiver: mmsConnection.getPhoneNumber(),
deliveryStatus: DELIVERY_STATUS_NOT_APPLICABLE }];
let deliveryStatus;
switch (retrievalMode) {
case RETRIEVAL_MODE_MANUAL:
deliveryStatus = DELIVERY_STATUS_MANUAL;
deliveryInfo[0].deliveryStatus = DELIVERY_STATUS_MANUAL;
break;
case RETRIEVAL_MODE_NEVER:
deliveryStatus = DELIVERY_STATUS_REJECTED;
deliveryInfo[0].deliveryStatus = DELIVERY_STATUS_REJECTED;
break;
case RETRIEVAL_MODE_AUTOMATIC:
deliveryStatus = DELIVERY_STATUS_PENDING;
deliveryInfo[0].deliveryStatus = DELIVERY_STATUS_PENDING;
break;
case RETRIEVAL_MODE_AUTOMATIC_HOME:
if (mmsConnection.isVoiceRoaming()) {
deliveryStatus = DELIVERY_STATUS_MANUAL;
deliveryInfo[0].deliveryStatus = DELIVERY_STATUS_MANUAL;
} else {
deliveryStatus = DELIVERY_STATUS_PENDING;
deliveryInfo[0].deliveryStatus = DELIVERY_STATUS_PENDING;
}
break;
default:
deliveryStatus = DELIVERY_STATUS_NOT_APPLICABLE;
break;
}
// |intermediate.deliveryStatus| will be deleted after being stored in db.
intermediate.deliveryStatus = deliveryStatus;
intermediate.timestamp = Date.now();
intermediate.receivers = [];
@ -1495,8 +1493,10 @@ MmsService.prototype = {
}
savable.delivery = DELIVERY_RECEIVED;
// |savable.deliveryStatus| will be deleted after being stored in db.
savable.deliveryStatus = DELIVERY_STATUS_SUCCESS;
// As a receiver, we don't need to care about the delivery status of others.
savable.deliveryInfo = [{
receiver: mmsConnection.getPhoneNumber(),
deliveryStatus: DELIVERY_STATUS_SUCCESS }];
for (let field in intermediate.headers) {
savable.headers[field] = intermediate.headers[field];
}
@ -2169,8 +2169,7 @@ MmsService.prototype = {
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
return;
}
let deliveryStatus = aMessageRecord.deliveryInfo[0].deliveryStatus;
if (DELIVERY_STATUS_PENDING == deliveryStatus) {
if (DELIVERY_STATUS_PENDING == aMessageRecord.deliveryStatus) {
if (DEBUG) debug("Delivery status of message record is 'pending'.");
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
return;

Просмотреть файл

@ -1976,7 +1976,7 @@ MobileMessageDatabaseService.prototype = {
(aMessage.type == "sms" && (aMessage.messageClass == undefined ||
aMessage.sender == undefined)) ||
(aMessage.type == "mms" && (aMessage.delivery == undefined ||
aMessage.deliveryStatus == undefined ||
!Array.isArray(aMessage.deliveryInfo) ||
!Array.isArray(aMessage.receivers))) ||
aMessage.timestamp == undefined) {
if (aCallback) {
@ -2010,26 +2010,27 @@ MobileMessageDatabaseService.prototype = {
aMessage.transactionIdIndex = aMessage.headers["x-mms-transaction-id"];
aMessage.isReadReportSent = false;
// As a receiver, we don't need to care about the delivery status of
// others, so we put a single element with self's phone number in the
// |deliveryInfo| array.
aMessage.deliveryInfo = [{
receiver: aMessage.phoneNumber,
deliveryStatus: aMessage.deliveryStatus,
deliveryTimestamp: 0,
}];
delete aMessage.deliveryStatus;
// If |deliveryTimestamp| is not specified, use 0 as default.
let deliveryInfo = aMessage.deliveryInfo;
for (let i = 0; i < deliveryInfo.length; i++) {
if (deliveryInfo[i].deliveryTimestamp == undefined) {
deliveryInfo[i].deliveryTimestamp = 0;
}
}
}
if (aMessage.type == "sms") {
aMessage.delivery = DELIVERY_RECEIVED;
aMessage.deliveryStatus = DELIVERY_STATUS_SUCCESS;
aMessage.deliveryTimestamp = 0;
if (aMessage.pid == undefined) {
aMessage.pid = RIL.PDU_PID_DEFAULT;
}
// If |deliveryTimestamp| is not specified, use 0 as default.
if (aMessage.deliveryTimestamp == undefined) {
aMessage.deliveryTimestamp = 0;
}
}
aMessage.deliveryIndex = [aMessage.delivery, timestamp];