B2G/gecko/dom/mobilemessage/src/ril/MmsService.js
/**
   * Convert intermediate message to indexedDB savable object.
   *
   * @param retrievalMode
   *        Retrieval mode for MMS receiving setting.
   * @param intermediate
   *        Intermediate MMS message parsed from PDU.
   */
Convert intermediate message to indexedDB savable object.
@param retrievalMode
Retrieval mode for MMS receiving setting.
@param intermediate
Intermediate MMS message parsed from PDU.
Convert intermediate message to indexedDB savable object . @param retrievalMode Retrieval mode for MMS receiving setting . @param intermediate Intermediate MMS message parsed from PDU .
function convertIntermediateToSavable(intermediate,
                                                                      retrievalMode) {
    intermediate.type = "mms";
    intermediate.delivery = DELIVERY_NOT_DOWNLOADED;
    switch(retrievalMode) {
      case RETRIEVAL_MODE_MANUAL:
        intermediate.deliveryStatus = [DELIVERY_STATUS_MANUAL];
        break;
      case RETRIEVAL_MODE_NEVER:
        intermediate.deliveryStatus = [DELIVERY_STATUS_REJECTED];
        break;
      case RETRIEVAL_MODE_AUTOMATIC:
        intermediate.deliveryStatus = [DELIVERY_STATUS_PENDING];
        break;
      case RETRIEVAL_MODE_AUTOMATIC_HOME:
        if (gMmsConnection.isVoiceRoaming()) {
          intermediate.deliveryStatus = [DELIVERY_STATUS_MANUAL];
        } else {
          intermediate.deliveryStatus = [DELIVERY_STATUS_PENDING];
        }
        break;
    }
    intermediate.timestamp = Date.now();
    intermediate.sender = null;
    intermediate.transactionId = intermediate.headers["x-mms-transaction-id"];
    if (intermediate.headers.from) {
      intermediate.sender = intermediate.headers.from.address;
    } else {
      intermediate.sender = "anonymous";
    }
    intermediate.receivers = [];
    return intermediate;
  }
function convertIntermediateToSavable ( intermediate , retrievalMode ) { intermediate . type = "mms" ; intermediate . delivery = DELIVERY_NOT_DOWNLOADED ; switch ( retrievalMode ) { case RETRIEVAL_MODE_MANUAL : intermediate . deliveryStatus = [ DELIVERY_STATUS_MANUAL ] ; break ; case RETRIEVAL_MODE_NEVER : intermediate . deliveryStatus = [ DELIVERY_STATUS_REJECTED ] ; break ; case RETRIEVAL_MODE_AUTOMATIC : intermediate . deliveryStatus = [ DELIVERY_STATUS_PENDING ] ; break ; case RETRIEVAL_MODE_AUTOMATIC_HOME : if ( gMmsConnection . isVoiceRoaming ( ) ) { intermediate . deliveryStatus = [ DELIVERY_STATUS_MANUAL ] ; } else { intermediate . deliveryStatus = [ DELIVERY_STATUS_PENDING ] ; } break ; } intermediate . timestamp = Date . now ( ) ; intermediate . sender = null ; intermediate . transactionId = intermediate . headers [ "x-mms-transaction-id" ] ; if ( intermediate . headers . from ) { intermediate . sender = intermediate . headers . from . address ; } else { intermediate . sender = "anonymous" ; } intermediate . receivers = [ ] ; return intermediate ; }
Convert intermediate message to indexedDB savable object.
Convert intermediate message to indexedDB savable object .