fix jira issue[TSAM9784] for notification 37/96737/1 accepted/tizen/3.0/common/20161114.143232 accepted/tizen/3.0/ivi/20161111.003108 accepted/tizen/3.0/mobile/20161111.003035 accepted/tizen/3.0/wearable/20161111.003050 submit/tizen_3.0/20161110.053115 submit/tizen_3.0_common/20161114.081136
authorintae, jeon <intae.jeon@samsung.com>
Thu, 10 Nov 2016 00:53:06 +0000 (09:53 +0900)
committerintae jeon <intae.jeon@samsung.com>
Thu, 10 Nov 2016 05:12:58 +0000 (21:12 -0800)
Change-Id: Ide1d5325934623eb512c8f160d4472ec75e93fcd
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
(cherry picked from commit 9e99a40ce1372b9f9a39e1aac36ffcde60418ce0)

email-core/email-core-auto-download.c
email-core/email-core-smtp.c
email-core/email-core-utils.c
email-daemon/email-daemon-event.c

index 7f5d045..7a4cb6e 100755 (executable)
@@ -494,7 +494,6 @@ CHECK_CONTINUE:
                        LEAVE_RECURSIVE_CRITICAL_SECTION(_auto_download_queue_lock);
                        EM_DEBUG_LOG_DEV(">>>>>>>>>>>>>>> Got auto download event_data !!! <<<<<<<<<<<<<<<");
                        int state1 = 0, state2 = 0, state3 = 0, wifi_status = 0;
-                       char uid_str[50] = {0, };
                        emstorage_mail_tbl_t *mail = NULL;
                        emstorage_mailbox_tbl_t *target_mailbox = NULL;
                        email_account_t *account_ref = NULL;
index 2e5dba4..8e41b93 100755 (executable)
@@ -1695,7 +1695,6 @@ INTERNAL_FUNC int emcore_send_mail(char *multi_user_name, int mail_id, int *err_
        emstorage_read_mail_uid_tbl_t *downloaded_mail = NULL;
        int dst_mailbox_id = 0;
        int total_mail_size = 0;
-       int sent_flag = 0;
        char *server_uid = NULL;
        MAILSTREAM *mail_stream = NULL;
 
@@ -1896,7 +1895,6 @@ INTERNAL_FUNC int emcore_send_mail(char *multi_user_name, int mail_id, int *err_
                goto FINISH_OFF;
        }
 
-       sent_flag = 1;
 
        /*  sent mail is moved to 'SENT' box or deleted. */
        if (opt->keep_local_copy) {
index 0d1bc43..e473f20 100755 (executable)
@@ -1149,7 +1149,6 @@ static int emcore_layout_single_noti(notification_h noti, char *account_name, in
 {
        EM_DEBUG_FUNC_BEGIN();
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
-
        noti_err = notification_set_layout(noti, NOTIFICATION_LY_NOTI_EVENT_SINGLE);
        if (noti_err != NOTIFICATION_ERROR_NONE) {
                EM_DEBUG_EXCEPTION("notification_set_layout NOTI_EVENT_SINGLE failed [%d]", noti_err);
@@ -1378,6 +1377,73 @@ FINISH_OFF:
 }
 #endif
 
+static int __emcore_show_new_mail_noti(void)
+{
+       EM_DEBUG_FUNC_BEGIN();
+       notification_h noti = NULL;
+       notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+
+       int err = EMAIL_ERROR_NONE;
+
+       noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
+       if (noti == NULL) {
+               EM_DEBUG_EXCEPTION("notification_new failed");
+               err = EMAIL_ERROR_SYSTEM_FAILURE;
+               goto FINISH_OFF;
+       }
+       if ((noti_err = notification_set_pkgname(noti, NATIVE_EMAIL_APPLICATION_PKG)) != NOTIFICATION_ERROR_NONE) {
+               EM_DEBUG_EXCEPTION("notification_set_pkgname failed [%d]", noti_err);
+               err = EMAIL_ERROR_SYSTEM_FAILURE;
+               goto FINISH_OFF;
+       }
+
+       if ((noti_err = notification_set_text_domain(noti, NATIVE_EMAIL_DOMAIN, tzplatform_mkpath(TZ_SYS_RO_APP,"org.tizen.email/res/locale"))) != NOTIFICATION_ERROR_NONE) {
+               EM_DEBUG_EXCEPTION("notification_set_text_domain failed [%d]", noti_err);
+               err = EMAIL_ERROR_SYSTEM_FAILURE;
+               goto FINISH_OFF;
+       }
+
+
+       if ((noti_err = notification_set_layout(noti, NOTIFICATION_LY_NOTI_EVENT_SINGLE)) != NOTIFICATION_ERROR_NONE) {
+               EM_DEBUG_EXCEPTION("notification_set_layout failed [%d]", noti_err);
+               err = EMAIL_ERROR_NOTI;
+               goto FINISH_OFF;
+       }
+
+       if ((noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, EMAIL_NOTI_ICON_PATH)) != NOTIFICATION_ERROR_NONE) {
+               EM_DEBUG_EXCEPTION("notification_set_image failed [%d]", noti_err);
+               err = EMAIL_ERROR_NOTI;
+               goto FINISH_OFF;
+       }
+
+       if ((noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, "New email", "IDS_EMAIL_TPOP_NEW_EMAIL_RECEIVED_ABB", NOTIFICATION_VARIABLE_TYPE_NONE)) != NOTIFICATION_ERROR_NONE) {
+               EM_DEBUG_EXCEPTION("notification_set_text failed [%d]", noti_err);
+               err = EMAIL_ERROR_SYSTEM_FAILURE;
+               goto FINISH_OFF;
+       }
+
+
+       if ((noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_TICKER)) != NOTIFICATION_ERROR_NONE) {
+               EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err);
+               err = EMAIL_ERROR_SYSTEM_FAILURE;
+               goto FINISH_OFF;
+       }
+
+       if ((noti_err = notification_insert(noti, NULL)) != NOTIFICATION_ERROR_NONE) {
+               EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err);
+               err = EMAIL_ERROR_SYSTEM_FAILURE;
+               goto FINISH_OFF;
+       }
+
+FINISH_OFF:
+       if (noti)
+               notification_free(noti);
+
+       EM_DEBUG_FUNC_END("ret [%d]", err);
+       return err;
+}
+
+
 
 INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id, int mail_id, int unread_mail_count, int vip_unread_mail_count, int input_play_alert_tone, int sending_error, unsigned long display)
 {
@@ -1425,6 +1491,7 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id,
        }
 
        unseen = unread_mail_count_t;
+
        display_status = account_tbl->options.display_content_status;
 
        /* Load the previous noti */
@@ -1607,12 +1674,18 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id,
                /* err = EMAIL_ERROR_PRIORITY_SENDER_MAIL_NOT_FOUND;*/ /*there is no mail for priority sender*/
        }
 
-       if ((noti_err = notification_set_display_applist(noti, display)) != NOTIFICATION_ERROR_NONE) {
+       if ((noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_LOCK )) != NOTIFICATION_ERROR_NONE) {
                EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err);
                err = EMAIL_ERROR_SYSTEM_FAILURE;
                goto FINISH_OFF;
        }
 
+       if ((err = __emcore_show_new_mail_noti()) != EMAIL_ERROR_NONE){
+               EM_DEBUG_EXCEPTION("notification new_mail ticker failed!!");
+
+       }
+
+
        if (new_noti) {
                if ((noti_err = notification_insert(noti, &private_id)) != NOTIFICATION_ERROR_NONE) {
                        EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err);
@@ -1683,11 +1756,9 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac
        EM_DEBUG_FUNC_BEGIN("account_id: %d, mail_id: %d, action:%d", account_id, mail_id, action);
        int err = EMAIL_ERROR_NONE;
 #ifdef __FEATURE_NOTIFICATION_ENABLE__
-       int private_id = 0;
        void *join_zone = NULL;
        char *mailbox_name = NULL;
 /*     char *dgettext_string = NULL; */
-       char vconf_private_id[MAX_PATH] = {0, };
        notification_h noti = NULL;
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
        emstorage_mail_tbl_t *p_mail_data = NULL;
index cef3a18..e973dfb 100644 (file)
@@ -2042,7 +2042,7 @@ static gpointer partial_body_download_thread(gpointer data)
        int err = EMAIL_ERROR_NONE;
        email_session_t *session = NULL;
        email_event_partial_body_thd partial_body_thd_event;
-       int i, account_count = 0;
+       int account_count = 0;
        emstorage_account_tbl_t *account_list = NULL;
        int event_que_state = 0;
        int send_event_que_state = 0;