apply Tizen 3.0 Message UX Guide
[platform/core/messaging/msg-service.git] / framework / storage-handler / MsgStorageMessage.cpp
index e5b6dbe..24196e0 100755 (executable)
@@ -708,6 +708,8 @@ msg_error_t MsgStoDeleteMessage(msg_message_id_t msgId, bool bCheckIndication)
 
        dbHandle->finalizeQuery();
 
+       MsgDeleteSentReadReportNotification(msgId);
+
        /* Get SUB_TYPE, STORAGE_ID */
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
        snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MAIN_TYPE, SUB_TYPE, FOLDER_ID, STORAGE_ID, READ_STATUS, CONV_ID, SIM_INDEX \
@@ -1471,6 +1473,7 @@ msg_error_t MsgStoDeleteMessageByList(msg_id_list_s *pMsgIdList)
 
        /* delete report notification */
        char tempAddr[MAX_ADDRESS_VAL_LEN+1];
+       bool isSentReadReportDeleted = false;
        while (!threadList1.empty()) {
                memset(tempAddr, 0x00, sizeof(tempAddr));
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
@@ -1493,6 +1496,13 @@ msg_error_t MsgStoDeleteMessageByList(msg_id_list_s *pMsgIdList)
 
                dbHandle->finalizeQuery();
 
+               int msgId = 0;
+               if (!isSentReadReportDeleted && !MsgIsSentReadReportNotificationExist(threadList1.front(), &msgId)) {
+                       //delete read report sent notification
+                       MsgDeleteSentReadReportNotification(msgId);
+                       isSentReadReportDeleted = true;
+               }
+
                threadList1.pop();
        }