case MSG_MGR_NOTI_TYPE_CB: {
if (noti_info->active_subject[0] == '\0') {
setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_TITLE, noti_info->active_sender, NULL);
- setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, noti_info->active_text, NULL);
+ if (noti_info->active_text[0] != '\0') {
+ setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, noti_info->active_text, NULL);
+ } else {
+ if (noti_info->active_media_cnt > 1) {
+ char attach_string[20] = {0,};
+ snprintf(attach_string, sizeof(attach_string), "%d attachments", noti_info->active_media_cnt);
+ setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, attach_string, NULL);
+ } else if (noti_info->active_media_cnt == 1) {
+ setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, "1 attachment", NULL);
+ }
+ }
} else {
setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_TITLE, noti_info->active_sender, NULL);
setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_INFO_1, noti_info->active_subject, NULL);
- setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, noti_info->active_text, NULL);
+ if (noti_info->active_text[0] != '\0') {
+ setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, noti_info->active_text, NULL);
+ } else {
+ if (noti_info->active_media_cnt > 1) {
+ char attach_string[20] = {0,};
+ snprintf(attach_string, sizeof(attach_string), "%d attachments", noti_info->active_media_cnt);
+ setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, attach_string, NULL);
+ } else if (noti_info->active_media_cnt == 1) {
+ setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT, "1 attachment", NULL);
+ }
+ }
}
break;
}
char sqlQuery[MAX_QUERY_LEN +1];
unsigned char mainType;
unsigned char subType;
- int msgSize;
+ int msgSize, attachmentCnt;
memset(sqlQuery, 0x00, sizeof(sqlQuery));
#ifdef MSG_NOTI_INTEGRATION
"B.CONV_ID, "
"(COUNT(DISTINCT(CASE WHEN B.MAIN_TYPE = %d THEN B.MSG_ID END))) AS SMS_UNREAD_CNT, "
"(COUNT(DISTINCT(CASE WHEN B.MAIN_TYPE = %d THEN B.MSG_ID END))) AS MMS_UNREAD_CNT, "
- "(CASE WHEN B.MAIN_TYPE = %d AND B.NETWORK_STATUS = %d THEN (SELECT C.MSG_SIZE FROM %s C WHERE B.MSG_ID = C.MSG_ID) ELSE -1 END) "
+ "(CASE WHEN B.MAIN_TYPE = %d AND B.NETWORK_STATUS = %d THEN (SELECT C.MSG_SIZE FROM %s C WHERE B.MSG_ID = C.MSG_ID) ELSE -1 END), "
+ "B.ATTACHMENT_COUNT "
"FROM %s A, %s B "
"WHERE A.CONV_ID=B.CONV_ID "
"AND B.READ_STATUS=0 AND (B.FOLDER_ID=%d OR B.FOLDER_ID=%d) "
smsUnreadCnt = atoi(db_res[col_cnt+7]);
mmsUnreadCnt = atoi(db_res[col_cnt+8]);
msgSize = atoi(db_res[col_cnt+9]);
+ attachmentCnt = atoi(db_res[col_cnt+10]);
noti_info->count = smsUnreadCnt + mmsUnreadCnt;
g_free(msg_size_unit_kb);
}
+ noti_info->active_media_cnt = attachmentCnt;
+
} else {
snprintf(noti_info->text, sizeof(noti_info->text), "%s", db_res[col_cnt+4]);
}
}
int attachCnt = _MsgMmsGetAttachCount(pMmsMsg);
+
+ MMS_ATTACH_S *attach = NULL;
+ int attachCntExceptText = attachCnt;
+ for (int i = 0; i < attachCnt; i++) {
+ attach = (MMS_ATTACH_S *)g_list_nth_data(pMmsMsg->attachlist, i);
+ if (g_strcmp0(attach->szContentType, "text/plain") == 0)
+ attachCntExceptText--;
+ }
+
+
if (attachCnt > 0) {
MMS_ATTACH_S *pAttach = _MsgMmsGetAttachment(pMmsMsg, 0);
MmsPluginStorage::instance()->insertPreviewInfo(msgId, MSG_MMS_ITEM_TYPE_ATTACH, pAttach->szFileName, attachCnt);
- MmsPluginStorage::instance()->updateMmsAttachCount(msgId, attachCnt); /* for Get Message */
+ MmsPluginStorage::instance()->updateMmsAttachCount(msgId, attachCntExceptText); /* for Get Message */
if (attachment_name == NULL) {
attachment_name = pAttach->szFileName;
if (attachCnt + ref_attach_count > 0 && attachment_name) {
MmsPluginStorage::instance()->insertPreviewInfo(msgId, MSG_MMS_ITEM_TYPE_ATTACH, attachment_name, attachCnt + ref_attach_count);
- MmsPluginStorage::instance()->updateMmsAttachCount(msgId, attachCnt + ref_attach_count);
+ MmsPluginStorage::instance()->updateMmsAttachCount(msgId, attachCntExceptText + ref_attach_count);
}
return MSG_SUCCESS;