[TNEXT-360] bug on msg_get_message() fixed 55/128455/1 accepted/tizen/unified/20170510.183154 submit/tizen/20170510.054744
authorKyeonghun Lee <kh9090.lee@samsung.com>
Wed, 10 May 2017 05:42:36 +0000 (14:42 +0900)
committerKyeonghun Lee <kh9090.lee@samsung.com>
Wed, 10 May 2017 05:42:36 +0000 (14:42 +0900)
Change-Id: Ia587c9dc0447ebbe482a2c69edd92fa2adb083da
Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
framework/storage-handler/MsgStorageMessage.cpp

index 1f1dfff..8c5111d 100755 (executable)
@@ -2145,6 +2145,14 @@ msg_error_t MsgStoGetMessage(msg_message_id_t msgId, MSG_MESSAGE_INFO_S *pMsg, M
 
        dbHandle->finalizeQuery();
 
+       if (pMsg->msgType.mainType == MSG_MMS_TYPE && pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS) {
+               /* get recipients information. */
+               MsgStoGetRecipientsByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
+       } else {
+               /* get address information. */
+               MsgStoGetAddressByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
+       }
+
        /* Get MMS body if it is MMS. */
        if ((pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS &&
                        (pMsg->msgType.subType == MSG_RETRIEVE_MMS || pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)) ||
@@ -2206,12 +2214,6 @@ msg_error_t MsgStoGetMessage(msg_message_id_t msgId, MSG_MESSAGE_INFO_S *pMsg, M
                        delete [] pDestMsg;
                        pDestMsg = NULL;
                }
-               /* get recipients information. */
-               MsgStoGetRecipientsByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
-
-       } else {
-               /* get address information. */
-               MsgStoGetAddressByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
        }
 
        /* Get SMS Sending Options */