[MPR-1024] support single part mms receiving 40/104640/2 accepted/tizen/3.0/common/20161216.122612 accepted/tizen/3.0/ivi/20161216.083304 accepted/tizen/3.0/mobile/20161216.083201 accepted/tizen/3.0/wearable/20161216.083239 submit/tizen_3.0/20161214.222236
authorKyeonghun Lee <kh9090.lee@samsung.com>
Tue, 13 Dec 2016 07:45:14 +0000 (16:45 +0900)
committerKyeonghun Lee <kh9090.lee@samsung.com>
Wed, 14 Dec 2016 05:43:03 +0000 (14:43 +0900)
- single part mms decode was supported, but the data doesn't be set for app
- add code for setting decoded data from single part mms

Change-Id: I8ca3050384211afbbbce559d9d02c6e9b24a7cfd
Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
plugin/mms_plugin/MmsPluginDecode.cpp
plugin/mms_plugin/MmsPluginMessage.cpp

index 13e972a..4f35fa3 100755 (executable)
@@ -1141,6 +1141,7 @@ bool MmsBinaryDecodeMsgBody(FILE *pFile, char *szFilePath, int totalLength)
                        goto __CATCH;
                }
 
+               snprintf(mmsHeader.msgBody.szOrgFilePath, MSG_FILEPATH_LEN_MAX, "%s", szFilePath);
                mmsHeader.msgBody.size = totalLength - mmsHeader.msgBody.offset;
                mmsHeader.msgType.contentSize = totalLength - mmsHeader.msgBody.offset;
 
index a93eed7..3f4b4a3 100755 (executable)
@@ -979,6 +979,25 @@ bool MmsConvertMmsData(MmsMsg *pMmsMsg, MMS_DATA_S *pMmsData)
                snprintf(pHeaderData->szFrom, sizeof(pHeaderData->szFrom), "%s", pMmsMsg->mmsAttrib.szFrom);
        }
 
+       /* single part item */
+       if (MsgIsMultipart(pMmsMsg->msgType.type) == false && pMmsMsg->nPartCount > 0 && pMmsMsg->msgType.contentSize > 0) {
+               MSG_DEBUG("single part item");
+               MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
+               if (pMultipart) {
+                       pMultipart->type = pMmsMsg->mmsAttrib.contentType;
+                       snprintf(pMultipart->szContentType, sizeof(pMultipart->szContentType), "%s", MimeGetMimeStringFromMimeInt(pMultipart->type));
+                       snprintf(pMultipart->szContentID, sizeof(pMultipart->szContentID), "%s", pMmsMsg->msgType.szContentID);
+                       snprintf(pMultipart->szContentLocation, sizeof(pMultipart->szContentLocation), "%s", pMmsMsg->msgType.szContentLocation);
+                       snprintf(pMultipart->szFileName, sizeof(pMultipart->szFileName), "%s", pMmsMsg->msgType.param.szName);
+                       snprintf(pMultipart->szFilePath, sizeof(pMultipart->szFilePath), "%s", pMmsMsg->msgBody.szOrgFilePath);
+                       pMultipart->drmType = pMmsMsg->msgType.drmInfo.drmType;
+
+                       pMmsData->multipartlist = g_list_append(pMmsData->multipartlist, pMultipart);
+               }
+
+               return true;
+       }
+
        if (pMmsMsg->mmsAttrib.contentType == MIME_MULTIPART_RELATED || pMmsMsg->mmsAttrib.contentType == MIME_APPLICATION_VND_WAP_MULTIPART_RELATED) {
                MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
                if (pMultipart) {
@@ -1009,12 +1028,8 @@ bool MmsConvertMmsData(MmsMsg *pMmsMsg, MMS_DATA_S *pMmsData)
                                snprintf(pMultipart->szContentLocation, sizeof(pMultipart->szContentLocation), "%s", multipart->type.szContentLocation);
                                snprintf(pMultipart->szFileName, sizeof(pMultipart->szFileName), "%s", multipart->type.param.szName);
                                snprintf(pMultipart->szFilePath, sizeof(pMultipart->szFilePath), "%s", multipart->pBody->szOrgFilePath);
+                               pMultipart->drmType = multipart->type.drmInfo.drmType;
 
-#ifdef __SUPPORT_DRM__
-                               if (multipart->type.drmInfo.drmType != MSG_DRM_TYPE_NONE) {
-                                       pMultipart->drmType = multipart->type.drmInfo.drmType;
-                               }
-#endif
                                pMmsData->multipartlist = g_list_append(pMmsData->multipartlist, pMultipart);
                        }
                }