From a875db11c4acbfceb6f312b6f0a0637dfe086299 Mon Sep 17 00:00:00 2001 From: Seunghwan Lee Date: Tue, 15 Oct 2013 17:06:18 +0900 Subject: [PATCH] modify update mms message Change-Id: Ic9734ae26c2e603329a393f0ebea9a7db3a4bc01 --- plugin/mms_plugin/MmsPluginStorage.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugin/mms_plugin/MmsPluginStorage.cpp b/plugin/mms_plugin/MmsPluginStorage.cpp index c32b24b..a439b85 100755 --- a/plugin/mms_plugin/MmsPluginStorage.cpp +++ b/plugin/mms_plugin/MmsPluginStorage.cpp @@ -177,7 +177,7 @@ msg_error_t MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SE MmsMsg mmsMsg; MMS_MESSAGE_DATA_S mmsMsgData = {0,}; char raw_filepath[MSG_FILENAME_LEN_MAX+1] = {0,}; - + char raw_filedir[MSG_FILENAME_LEN_MAX+1] = {0,}; bzero(&mmsMsg, sizeof(mmsMsg)); memset(sqlQuery, 0x00, sizeof(sqlQuery)); @@ -189,6 +189,8 @@ msg_error_t MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SE if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS) return MSG_ERR_DB_EXEC; + MSG_DEBUG("msg sub type = [%d]", pMsgInfo->msgType.subType); + if (pMsgInfo->msgType.subType == MSG_SENDREQ_MMS) { if (_MsgMmsDeserializeMessageData(&mmsMsgData, pFileData) == false) { @@ -214,6 +216,8 @@ msg_error_t MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SE } //preview data + MmsPluginStorage::instance()->removePreviewInfo(pMsgInfo->msgId); //remove exist previnfo + err = MmsMakePreviewInfo(pMsgInfo->msgId, &mmsMsgData); err = getMsgText(&mmsMsgData, pMsgInfo->msgText); @@ -224,6 +228,10 @@ msg_error_t MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SE } } + snprintf(raw_filedir, sizeof(raw_filedir), MSG_DATA_PATH"%d.mms.dir", pMsgInfo->msgId); + MsgRmRf(raw_filedir); + rmdir(raw_filedir); + int size = 0; if (MsgGetFileSize(raw_filepath, &size) == false) { @@ -233,6 +241,8 @@ msg_error_t MmsPluginStorage::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SE } pMsgInfo->dataSize = size; + + MmsReadMsgBody(pMsgInfo->msgId, true, false, NULL); } MmsReleaseMmsMsg(&mmsMsg); -- 2.7.4