emcore_delete_notification_by_account(account_id);
emcore_refresh_account_reference();
+ /* Delete contact log */
+ if (!emcore_delete_contacts_log(account_id, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_delete_contacts_log failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
ret = true;
FINISH_OFF:
if (!emstorage_notify_storage_event(NOTI_MAIL_ADD, account_id, mail_id, mailbox_id_param_string, thread_id))
EM_DEBUG_EXCEPTION("emstorage_notify_storage_event [NOTI_MAIL_ADD] failed");
}
-
+
+ /* Set contact log */
+ switch (input_mailbox_tbl->mailbox_type) {
+ case EMAIL_MAILBOX_TYPE_INBOX :
+ if (!emcore_set_received_contacts_log(new_mail_tbl_data, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_set_received_contacts_log failed : [%d]", err);
+ }
+ break;
+ case EMAIL_MAILBOX_TYPE_SENTBOX:
+ case EMAIL_MAILBOX_TYPE_OUTBOX:
+ if (!emcore_set_sent_contacts_log(new_mail_tbl_data, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_set_sent_contacts_log failed : [%d]", err);
+ }
+ break;
+ default:
+ EM_DEBUG_LOG("Mailbox type : [%d]", input_mailbox_tbl->mailbox_type);
+ break;
+ }
+
/* Release for envelope is not required and it may cause crash. Don't free the memory for envelope here. */
/* Envelope data will be freed by garbage collector in mail_close_full */
if (new_mail_tbl_data){
EM_DEBUG_EXCEPTION(" emcore_delete_mail failed [%d]", err);
}
+ /* Set the phone log */
+ if (!emcore_set_sent_contacts_log(mail_tbl_data, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_set_sent_contacts_log failed : [%d]", err);
+ }
+
/*Update status save_status to DB*/
mail_tbl_data->save_status = EMAIL_MAIL_STATUS_SENT;
if (!emstorage_set_field_of_mails_with_integer_value(account_id, &mail_id, 1, "save_status", mail_tbl_data->save_status, false, &err))
if (!emcore_delete_mail(account_id, &mail_id, 1, EMAIL_DELETE_LOCALLY, EMAIL_DELETED_AFTER_SENDING, false, &err))
EM_DEBUG_EXCEPTION("emcore_delete_mail falied [%d]", err);
}
-
+
+ /* Set the phone log */
+ if (!emcore_set_sent_contacts_log(searched_mail_tbl_data, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_set_sent_contacts_log failed : [%d]", err);
+ }
+
if(searched_mail_tbl_data) {
emstorage_free_mail(&searched_mail_tbl_data, 1, NULL);
searched_mail_tbl_data = NULL;