fix build break
[apps/core/preloaded/email.git] / composer / src / email-composer-util.c
index 204c793..750d6bf 100755 (executable)
@@ -405,13 +405,13 @@ int _composer_add_mailbox_folder(EmailComposerUGD *ugd, email_mailbox_type_e mai
 
        nResult = email_add_mail(ugd->new_mail_info->mail_data, ugd->new_mail_info->attachment_list, ugd->new_mail_info->mail_data->attachment_count, NULL, 0);
        if (nResult != EMAIL_ERROR_NONE) {
-               debug_log("email_add_mail failed! %d", nResult);
+               debug_warning("email_add_mail failed! %d", nResult);
                return nResult;
        }
 
        if (email_check_file_exist(ugd->saved_html_path)) {
                if (-1 == remove(ugd->saved_html_path)) {
-                       debug_log("Failed to remove file");
+                       debug_warning("Failed to remove file");
                        return COMPOSER_ERROR_FAIL;
                }
        }
@@ -477,7 +477,7 @@ int _composer_make_mail(EmailComposerUGD *ugd)
        }
 
        ugd->new_mail_info->mail_data->report_status = EMAIL_MAIL_REPORT_NONE;
-/*
+
        if (ugd->tracking_option[0] == 1) {
                ugd->new_mail_info->mail_data->report_status |= EMAIL_MAIL_REQUEST_MDN;
        }
@@ -485,7 +485,7 @@ int _composer_make_mail(EmailComposerUGD *ugd)
                ugd->new_mail_info->mail_data->report_status |= EMAIL_MAIL_REQUEST_DSN;
        }
        debug_log("ugd->new_mail_info->mail_data->report_status = %d", ugd->new_mail_info->mail_data->report_status);
-*/
+
        ugd->new_mail_info->mail_data->priority = ugd->priority_option;
 
        ugd->new_mail_info->mail_data->server_mailbox_name = strdup(ugd->mailbox_info->mail_box->mailbox_name);
@@ -816,10 +816,8 @@ int _composer_send_mail(EmailComposerUGD *ugd)
                return COMPOSER_ERROR_SEND_FAIL;
        }
 
-       email_option_t option = (*ugd->account_info->account).options;
-
        debug_log("priority = %d", (*ugd->account_info->account).options.priority);
-       debug_log("keep a copy = %d", (*ugd->account_info->account).options.keep_local_copy);
+       debug_log("request read report = %d", (*ugd->account_info->account).options.req_read_receipt);
 
        if (ugd->composer_type == RUN_COMPOSER_EDIT) {
                /* Currently when a saved email is opened in drafts and edited before sending it then edited mail is not added to Outbox and edited email is not sent.
@@ -867,10 +865,10 @@ int _composer_send_mail(EmailComposerUGD *ugd)
                }
        }
 
-       unsigned handle = 0;
+       int handle = 0;
        int err = 0;
 
-       if ((err = email_send_mail(ugd->new_mail_info->mail_data->mail_id, &option, &handle)) != EMAIL_ERROR_NONE) {
+       if ((err = email_send_mail(ugd->new_mail_info->mail_data->mail_id, &handle)) != EMAIL_ERROR_NONE) {
                debug_log("   fail sending [%d]", err);
                return COMPOSER_ERROR_SEND_FAIL;
        } else {
@@ -968,7 +966,7 @@ void _composer_save_popup_response_cb(void *data, Evas_Object *obj, void *event_
 
                        ugd->idler_save_draft = ecore_idler_add(_composer_show_fail_to_save, ugd);
                } else {
-                       debug_log("Success save in Drafts");
+                       debug_log("Succeed in saving in Drafts");
 
                        if (ugd->composer_type == RUN_COMPOSER_EDIT) {
                                //After a new draft mail is added, the old draft mail is deleted and synced to server
@@ -1173,6 +1171,7 @@ Evas_Object *_composer_load_edj(Evas_Object *parent, const char *file, const cha
 
 Evas_Object *_composer_create_navigation_layout(Evas_Object *parent)
 {
+       debug_log("");
        Evas_Object *navi_bar;
 
        navi_bar = elm_naviframe_add(parent);
@@ -1185,6 +1184,7 @@ Evas_Object *_composer_create_navigation_layout(Evas_Object *parent)
 
 Evas_Object *_composer_create_composer_layout(Evas_Object *parent)
 {
+       debug_log("");
        Evas_Object *layout;
 
        layout = elm_layout_add(parent);
@@ -1199,6 +1199,7 @@ Evas_Object *_composer_create_composer_layout(Evas_Object *parent)
 
 Evas_Object *_composer_create_outer_layout(Evas_Object *parent)
 {
+       debug_log("");
        Evas_Object *layout/*, *bg*/;
 
        layout = elm_layout_add(parent);
@@ -1214,6 +1215,7 @@ Evas_Object *_composer_create_outer_layout(Evas_Object *parent)
 
 Evas_Object *_composer_create_main_scroller(Evas_Object *parent)
 {
+       debug_log("");
        Evas_Object *scroller;
 
        scroller = elm_scroller_add(parent);
@@ -1227,6 +1229,7 @@ Evas_Object *_composer_create_main_scroller(Evas_Object *parent)
 
 Evas_Object *_composer_create_box(Evas_Object *parent)
 {
+       debug_log("");
 
        Evas_Object *box = elm_box_add(parent);
        evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2339,7 +2342,7 @@ void _composer_add_subject(EmailComposerUGD *ugd)
 void _composer_add_body(EmailComposerUGD *ugd)
 {
        debug_log("");
-       char *temp = NULL;
+       char *full_text = NULL;
 
        if (ugd->existing_mail_info->mail_data && ugd->existing_mail_info->mail_data->body_download_status) {
                if (ugd->composer_type == RUN_COMPOSER_EDIT) {
@@ -2359,15 +2362,16 @@ void _composer_add_body(EmailComposerUGD *ugd)
 
                                char szMetaViewportInfo[TEMP_BUFFER_SIZE + 1] = { 0x00, };
                                strncpy(szMetaViewportInfo, HTML_META_INFORMATION, TEMP_BUFFER_SIZE);
-                               char *full_text = NULL;
-                               full_text = g_strconcat(szMetaViewportInfo, html_text_for_body, NULL);
-                               debug_log("html_text_for_body: %s", html_text_for_body);
 
                                if (html_text_for_body) {
+                                       debug_log("html_text_for_body: %s", html_text_for_body);
+                                       full_text = g_strconcat(szMetaViewportInfo, html_text_for_body, NULL);
                                        email_composer_save_file(ugd->saved_html_path, full_text, STR_LEN(full_text));
                                        g_free(html_text_for_body);
                                } else {
                                        html_text_for_body = (char *)email_get_buff_from_file(DATADIR"/_email_default.html", 0);
+                                       debug_log("html_text_for_body: %s", html_text_for_body);
+                                       full_text = g_strconcat(szMetaViewportInfo, html_text_for_body, NULL);
                                        email_composer_save_file(ugd->saved_html_path, full_text, STR_LEN(full_text));
                                        g_free(html_text_for_body);
                                }
@@ -2377,10 +2381,10 @@ void _composer_add_body(EmailComposerUGD *ugd)
                }
        }
 
-       debug_log("Freed body :%s", temp);
-       if (temp) {
-               free(temp);
-               temp = NULL;
+       debug_log("full_text :%s", full_text);
+       if (full_text) {
+               free(full_text);
+               full_text = NULL;
        }
 }
 
@@ -2577,7 +2581,6 @@ void _composer_make_html_body(EmailComposerUGD *ugd)
 
        debug_log("text_for_original_info: %s", text_for_original_info);
        debug_log("html_text_for_body: %s", html_text_for_body);
-
        email_composer_save_file(ugd->saved_html_path, full_text, STR_LEN(full_text));
 
        debug_log("full text:\n%s", full_text);
@@ -2854,14 +2857,12 @@ bool _composer_check_mail_is_modified(void *data)
 
        if ((ugd->attach_initial_list && !ugd->attachment_item_obj_list) || (!ugd->attach_initial_list && ugd->attachment_item_obj_list)) {
                is_attach_modified = true;
-
        } else if (ugd->attach_initial_list && ugd->attachment_item_obj_list) {
                int nInitialListCount = eina_list_count(ugd->attach_initial_list);
                int nAttachmentCount = eina_list_count(ugd->attachment_item_obj_list);
 
                if (nInitialListCount != nAttachmentCount) {
                        is_attach_modified = true;
-
                } else {
                        int i = 0;
                        int nInitialListCount = eina_list_count(ugd->attach_initial_list);
@@ -2900,7 +2901,9 @@ bool _composer_check_mail_is_modified(void *data)
 
 FINISH_OFF:
 
-       _composer_free_initial_email_content(ugd);
+       if (is_modified) {
+               _composer_free_initial_email_content(ugd);
+       }
 
        return is_modified;
 }
@@ -3428,7 +3431,7 @@ void _composer_resize_body_webview(EmailComposerUGD *ugd, int ime_height)
 
        Evas_Coord x, y, w, h;
 
-       debug_log("ime_height %d", ime_height);
+       debug_log(" === ime_height %d", ime_height);
 
        evas_object_geometry_get(ugd->win_main, &x, &y, &w, &h);
        debug_log(" === win_main x:%d, y:%d, w:%d, h:%d", x, y, w, h);