summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manager/src/msg-manager-notification.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/manager/src/msg-manager-notification.cpp b/manager/src/msg-manager-notification.cpp
index 760a114..d977352 100644
--- a/manager/src/msg-manager-notification.cpp
+++ b/manager/src/msg-manager-notification.cpp
@@ -1753,10 +1753,10 @@ int getLatestMsgInfo(MSG_MGR_NOTI_INFO_S *noti_info, bool isForInstantMessage)
snprintf(sqlQuery, MAX_QUERY_LEN,
"(COUNT(DISTINCT(CASE WHEN MAIN_TYPE = %d THEN MSG_ID END))) AS SMS_UNREAD_CNT, "
"(COUNT(DISTINCT(CASE WHEN MAIN_TYPE = %d THEN MSG_ID END))) AS MMS_UNREAD_CNT "
- "FROM %s WHERE READ_STATUS = 0;",
+ "FROM %s WHERE READ_STATUS = 0 AND (FOLDER_ID=%d OR FOLDER_ID=%d) AND STORAGE_ID = %d;",
MSG_SMS_TYPE,
MSG_MMS_TYPE,
- MSGFW_MESSAGE_TABLE_NAME);
+ MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_CBMSGBOX_ID, MSG_STORAGE_PHONE);
MSG_MGR_DEBUG("sqlQuery [%s]", sqlQuery);