Bug 810099 follow-up fix - B2G MMS: support onretrieving event. r=gene.lian a=leo+
authorChia-hung Tai <ctai@mozilla.com>
Tue, 04 Jun 2013 12:01:58 +0800
changeset 133867 83b67d255bf35784893f6e114a51403ddf96e86f
parent 133866 0cd289fcea166731e947883d303dae45778bc88e
child 133868 e460f5af43115a487fb3b2c220e51626c9833b85
push id1707
push userryanvm@gmail.com
push dateTue, 04 Jun 2013 19:02:26 +0000
treeherderfx-team@b01fedc71f50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgene.lian, leo
bugs810099
milestone24.0a1
Bug 810099 follow-up fix - B2G MMS: support onretrieving event. r=gene.lian a=leo+
dom/mobilemessage/src/ril/MmsService.js
--- a/dom/mobilemessage/src/ril/MmsService.js
+++ b/dom/mobilemessage/src/ril/MmsService.js
@@ -1258,17 +1258,18 @@ MmsService.prototype = {
     }
     let url = savableMessage.headers["x-mms-content-location"].uri;
 
     // For RETRIEVAL_MODE_AUTOMATIC or RETRIEVAL_MODE_AUTOMATIC_HOME but not
     // roaming, proceed to retrieve MMS.
     this.retrieveMessage(url,
                          this.retrieveMessageCallback.bind(this,
                                                            wish,
-                                                           savableMessage));
+                                                           savableMessage),
+                         domMessage);
   },
 
   /**
    * Handle incoming M-Notification.ind PDU.
    *
    * @param notification
    *        The parsed MMS message object.
    */
@@ -1289,18 +1290,17 @@ MmsService.prototype = {
       } catch (e) {}
 
       let savableMessage = this.convertIntermediateToSavable(notification, retrievalMode);
 
       gMobileMessageDatabaseService
         .saveReceivedMessage(savableMessage,
                              this.saveReceivedMessageCallback.bind(this,
                                                                    retrievalMode,
-                                                                   savableMessage),
-                             domMessage);
+                                                                   savableMessage));
     }).bind(this));
   },
 
   /**
    * Handle incoming M-Delivery.ind PDU.
    *
    * @param msg
    *        The MMS message object.
@@ -1471,17 +1471,17 @@ MmsService.prototype = {
         sendTransactionCb(aDomMessage.id, isSentSuccess);
       });
     });
   },
 
   retrieve: function retrieve(aMessageId, aRequest) {
     if (DEBUG) debug("Retrieving message with ID " + aMessageId);
     gMobileMessageDatabaseService.getMessageRecordById(aMessageId,
-        (function notifyResult(aRv, aMessageRecord) {
+        (function notifyResult(aRv, aMessageRecord, aDomMessage) {
       if (Ci.nsIMobileMessageCallback.SUCCESS_NO_ERROR != aRv) {
         if (DEBUG) debug("Function getMessageRecordById() return error.");
         aRequest.notifyGetMessageFailed(aRv);
         return;
       }
       if ("mms" != aMessageRecord.type) {
         if (DEBUG) debug("Type of message record is not 'mms'.");
         aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
@@ -1580,17 +1580,19 @@ MmsService.prototype = {
         }).bind(this));
       };
       // Update the delivery status to pending in DB.
       gMobileMessageDatabaseService
         .setMessageDelivery(aMessageId,
                             null,
                             null,
                             DELIVERY_STATUS_PENDING,
-                            this.retrieveMessage(url, responseNotify.bind(this)));
+                            this.retrieveMessage(url,
+                                                 responseNotify.bind(this),
+                                                 aDomMessage));
     }).bind(this));
   },
 
   // nsIWapPushApplication
 
   receiveWapPush: function receiveWapPush(array, length, offset, options) {
     let data = {array: array, offset: offset};
     let msg = MMS.PduHelper.parse(data, null);