}
/* Delete the previous noti */
- emcore_delete_notification_by_account(multi_user_name, account_id, true, true);
- if (g_sending_noti_handle) {
- if ((noti_err = notification_free(g_sending_noti_handle)) != NOTIFICATION_ERROR_NONE)
- err = EMAIL_ERROR_NOTI;
- g_sending_noti_handle = NULL;
- }
+ emcore_delete_notification_by_account(multi_user_name, account_id, false, true, true);
if ((err = emcore_set_join_zone(multi_user_name, &join_zone)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emcore_set_join_zone failed : [%d]", err);
goto FINISH_OFF;
}
- if ((noti_err = notification_insert(noti, &private_id)) != NOTIFICATION_ERROR_NONE) {
+ if ((noti_err = notification_insert(noti, NULL)) != NOTIFICATION_ERROR_NONE) {
EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err);
err = EMAIL_ERROR_NOTI;
goto FINISH_OFF;
}
- EM_DEBUG_LOG("Private_id = [%d]", private_id);
-
- SNPRINTF(vconf_private_id, sizeof(vconf_private_id), "%s/%d", VCONF_KEY_NOTI_PRIVATE_ID, account_id);
- if (vconf_set_int(vconf_private_id, private_id) != 0) {
- EM_DEBUG_EXCEPTION("vconf_set_int failed");
- err = EMAIL_ERROR_GCONF_FAILURE;
- goto FINISH_OFF;
- }
-
break;
case EMAIL_ACTION_SENDING_MAIL:
}
g_sending_noti_handle = noti;
-#if 0
- EM_DEBUG_LOG("Private_id = [%d]", private_id);
-
- SNPRINTF(vconf_private_id, sizeof(vconf_private_id), "%s/%d", VCONF_KEY_NOTI_PRIVATE_ID, account_id);
- if (vconf_set_int (vconf_private_id, private_id) != 0) {
- EM_DEBUG_EXCEPTION("vconf_set_int failed");
- err = EMAIL_ERROR_GCONF_FAILURE;
- goto FINISH_OFF;
- }
-#endif
-
break;
default:
}
for(i = 0; i < account_count; i++) {
- error_code = emcore_delete_notification_by_account(multi_user_name, account_list[i].account_id, false, false);
+ error_code = emcore_delete_notification_by_account(multi_user_name, account_list[i].account_id, true, false, false);
if (error_code != EMAIL_ERROR_NONE)
EM_DEBUG_EXCEPTION("emcore_delete_notification_by_account failed");
}
} else {
- error_code = emcore_delete_notification_by_account(multi_user_name, account_id, false, false);
+ error_code = emcore_delete_notification_by_account(multi_user_name, account_id, true, false, false);
if (error_code != EMAIL_ERROR_NONE)
EM_DEBUG_EXCEPTION("emcore_delete_notification_by_account failed");
}
}
#define EAS_EXECUTABLE_PATH "/usr/bin/eas-engine"
-
-INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int with_noti_tray, int is_delete_sent_fail_noti)
+/* TODO this function will modify with bit flag */
+INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int is_delete_new_mail_noti, int is_delete_sending_noti, int is_delete_sent_fail_noti)
{
- EM_DEBUG_FUNC_BEGIN("account_id [%d], with_noti_tray [%d], is_delete_sent_fail_noti: [%d]", account_id, with_noti_tray, is_delete_sent_fail_noti);
+ EM_DEBUG_FUNC_BEGIN("account_id [%d], is_delete_new_mail_noti[%d], is_delete_sending_noti[%d], is_delete_sent_fail_noti: [%d]", account_id, is_delete_new_mail_noti, is_delete_sending_noti, is_delete_sent_fail_noti);
int error_code = EMAIL_ERROR_NONE;
#ifdef __FEATURE_NOTIFICATION_ENABLE__
EM_DEBUG_LOG("noti_type_str: [%s]", noti_type_str);
// noti_type_str: NEW_MAIL_SINGLE, NEW_MAIL_MULTI, SENT, SENT_FAIL, SENDING
if (account_id_str && (atoi(account_id_str) == account_id)) {
- if (!g_strcmp0(noti_type_str, __NOTI_NEW_MAIL_SINGLE) ||
+
+ if (is_delete_new_mail_noti &&
+ (!g_strcmp0(noti_type_str, __NOTI_NEW_MAIL_SINGLE) ||
!g_strcmp0(noti_type_str, __NOTI_NEW_MAIL_MULTI) ||
- !g_strcmp0(noti_type_str, __NOTI_SENT)) {
+ !g_strcmp0(noti_type_str, __NOTI_SENT))) {
// normal notification
noti_to_be_deleted = noti;
- } else if (with_noti_tray && !g_strcmp0(noti_type_str, __NOTI_SENDING)) {
+ } else if (is_delete_sending_noti && !g_strcmp0(noti_type_str, __NOTI_SENDING)) {
// sending ongoing notification
noti_to_be_deleted = noti;
- } else if (!g_strcmp0(noti_type_str, __NOTI_SENT_FAIL)) {
- // sent failed notification
- if (is_delete_sent_fail_noti) {
- noti_to_be_deleted = noti;
- } else {
- const char *error_str = bundle_get_val(noti_args, "SENDING_ERROR");
- EM_DEBUG_LOG("There is a notification for sending error, not clear this notification [%s].", error_str);
- }
+ g_sending_noti_handle = NULL;
+ } else if (is_delete_sent_fail_noti && !g_strcmp0(noti_type_str, __NOTI_SENT_FAIL)) {
+ noti_to_be_deleted = noti;
}
}