Fixed N_SE-23121 issue.
authorjc47.park <jc47.park@samsung.com>
Mon, 28 Jan 2013 09:48:54 +0000 (18:48 +0900)
committerjc47.park <jc47.park@samsung.com>
Mon, 28 Jan 2013 09:48:54 +0000 (18:48 +0900)
composer/include/email-composer-js.h
composer/include/email-composer.h
composer/src/email-composer-callback.c
composer/src/email-composer-contents.c
composer/src/email-composer-util.c
composer/src/email-composer.c

index 9de5fb0..61836bc 100755 (executable)
 
 #include "email-composer.h"
 
-#define COMPOSER_JS_ENABLE_EDITABLE                    "document.body.contentEditable='true'; void 0"
-#define COMPOSER_JS_DISABLE_EDITABLE           "document.body.contentEditable='false'; void 0"
+#define COMPOSER_JS_BODY_ENABLE_EDITABLE       "document.body.contentEditable='true'; void 0"
+#define COMPOSER_JS_BODY_DISABLE_EDITABLE      "document.body.contentEditable='false'; void 0"
 #define COMPOSER_JS_SET_FOCUS                          "document.body.focus(); void 0"
 #define COMPOSER_JS_SET_UNFOCUS                                "document.body.blur(); void 0"
 
-#define COMPOSER_JS_GET_HTML_CONTENT \
-       "function getHtmlContent() { " \
+#define COMPOSER_JS_GET_BODY_HTML_CONTENT \
+       "function getHtmlBodyContent() { " \
                "console.log(\"Here\");" \
                "var elements = document.getElementsByTagName(\"body\");" \
                "console.log(\"elements[0].outerHTML : \" + elements[0].outerHTML);" \
                "return elements[0].outerHTML;" \
        "};" \
-       "getHtmlContent();"
+       "getHtmlBodyContent();"
 
 #define COMPOSER_JS_GET_LATEST_HTML_CONTENT \
        "function getHtmlOriginalContent() { " \
index 86913f7..b93e1ce 100755 (executable)
@@ -173,8 +173,9 @@ struct ug_data {
        char *latest_info_content;
        char *latest_html_content;
        char *plain_content;
-       char *original_info_content;
-       char *original_html_content;
+
+       char *latest_body_html_content;
+       char *original_body_html_content;
 
        int to_recipients_cnt;
        int cc_recipients_cnt;
index 9b50d1a..0f14fb6 100755 (executable)
@@ -57,8 +57,7 @@ static void _composer_myemail_gl_sel(void *data, Evas_Object *obj, void *event_i
 static Eina_Bool _composer_cc_mbe_set_focus(void *data);
 Eina_Bool _composer_get_html_content_for_draft_cb(void *data);
 static void _composer_plain_text_get_cb(Evas_Object *o, const char *plain_text, void *user_data);
-static void _composer_get_latest_info_content_cb(Evas_Object *o, const char *result, void *data);
-static void _composer_get_latest_html_content_cb(Evas_Object *o, const char *result, void *data);
+static void _composer_get_latest_body_html_content_cb(Evas_Object *o, const char *result, void *data);
 
 void _composer_edit_field_changed_cb(void *data, Evas_Object *obj, void *event_info)
 {
@@ -179,12 +178,16 @@ void _composer_back_button_cb(void *data, Evas_Object *obj, void *event_info)
        debug_log("");
 
        EmailComposerUGD *ugd = (EmailComposerUGD *)data;
+       if (EINA_FALSE == ewk_view_plain_text_get(ugd->body_ewkview, _composer_plain_text_get_cb, (void *)ugd)) {
+               debug_log("ewk_view_plain_text_get Failed");
+       }
 
-       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_INFO_CONTENT, _composer_get_latest_info_content_cb, (void *)ugd))
-               debug_log("COMPOSER_JS_GET_LATEST_INFO_CONTENT failed.");
+       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_IMAGE_LIST, _composer_get_image_list_cb, (void *)ugd)) {
+               debug_log("COMPOSER_JS_GET_IMAGE_LIST error.");
+       }
 
-       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_HTML_CONTENT, _composer_get_latest_html_content_cb, (void *)ugd))
-               debug_log("COMPOSER_JS_GET_LATEST_HTML_CONTENT failed.");
+       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_BODY_HTML_CONTENT, _composer_get_latest_body_html_content_cb, (void *)ugd))
+               debug_log("COMPOSER_JS_GET_BODY_HTML_CONTENT failed.");
 
        ugd->bringin_timer = ecore_timer_add(1.0, _composer_get_html_content_for_draft_cb, ugd);
 
@@ -1422,6 +1425,8 @@ void _composer_fail_to_send_popup_cb(void *data, Evas_Object *obj, void *event_i
                ugd->composer_noti = NULL;
        }
 
+       _composer_webkit_set_body_script(data);
+
        elm_object_disabled_set(ugd->send_btn, EINA_FALSE);
        elm_object_disabled_set(ugd->cancel_btn, EINA_FALSE);
 
@@ -2118,7 +2123,7 @@ static void _composer_cbar_save_as_draft_cb(Evas_Object *o, const char *result,
 
                elm_object_tree_focus_allow_set(ugd->c_layout, EINA_TRUE); // block the focus not to open IME.
                _composer_webkit_set_body_script(ugd);
-               if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_ENABLE_EDITABLE, _composer_focus_script_executed_cb, ugd) == EINA_FALSE)
+               if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_BODY_ENABLE_EDITABLE, _composer_focus_script_executed_cb, ugd) == EINA_FALSE)
                        debug_log("COMPOSER_JS_ENABLE_EDITABLE failed.");
                return;
        }
@@ -2148,11 +2153,8 @@ void _composer_cbar_save_as_draft_clicked(void *data, Evas_Object *obj, void *ev
                ugd->context_popup = NULL;
        }
 
-       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_INFO_CONTENT, _composer_get_latest_info_content_cb, (void *)ugd))
-               debug_log("COMPOSER_JS_GET_LATEST_INFO_CONTENT failed.");
-
-       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_HTML_CONTENT, _composer_get_latest_html_content_cb, (void *)ugd))
-               debug_log("COMPOSER_JS_GET_LATEST_HTML_CONTENT failed.");
+       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_BODY_HTML_CONTENT, _composer_get_latest_body_html_content_cb, (void *)ugd))
+               debug_log("COMPOSER_JS_GET_BODY_HTML_CONTENT failed.");
 
        if (EINA_FALSE == ewk_view_plain_text_get(ugd->body_ewkview, _composer_plain_text_get_cb, (void *)ugd))
                debug_log("ewk_view_plain_text_get Failed");
@@ -2160,8 +2162,8 @@ void _composer_cbar_save_as_draft_clicked(void *data, Evas_Object *obj, void *ev
        if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_IMAGE_LIST, _composer_get_image_list_cb, (void *)ugd))
                debug_log("COMPOSER_JS_GET_IMAGE_LIST error.");
 
-       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_HTML_CONTENT, _composer_cbar_save_as_draft_cb, (void *)ugd))
-               debug_log("COMPOSER_JS_GET_LATEST_HTML_CONTENT failed.");
+       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_BODY_DISABLE_EDITABLE, _composer_cbar_save_as_draft_cb, (void*)ugd))
+               debug_log("COMPOSER_JS_BODY_DISABLE_EDITABLE failed.");
 }
 
 static void _composer_priority_radio_cb(void *data, Evas_Object *obj, void *event_info)
@@ -2527,11 +2529,11 @@ void _composer_cbar_send_clicked(void *data, Evas_Object *obj, void *event_info)
                }
        }
 
-       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_INFO_CONTENT, _composer_get_latest_info_content_cb, (void *)ugd))
-               debug_log("COMPOSER_JS_GET_LATEST_INFO_CONTENT failed.");
+       if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_BODY_DISABLE_EDITABLE, NULL, NULL) == EINA_FALSE)
+                       debug_log("COMPOSER_JS_BODY_ENABLE_EDITABLE failed.");
 
-       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_HTML_CONTENT, _composer_get_latest_html_content_cb, (void *)ugd))
-               debug_log("COMPOSER_JS_GET_LATEST_HTML_CONTENT failed.");
+       if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_BODY_HTML_CONTENT, _composer_get_latest_body_html_content_cb, (void *)ugd))
+               debug_log("COMPOSER_JS_GET_BODY_HTML_CONTENT failed.");
 
        if (EINA_FALSE == ewk_view_plain_text_get(ugd->body_ewkview, _composer_plain_text_get_cb, (void *)ugd))
                debug_log("ewk_view_plain_text_get Failed");
@@ -2663,37 +2665,20 @@ Eina_Bool _composer_get_html_content_for_draft_cb(void *data)
        return ECORE_CALLBACK_CANCEL;
 }
 
-void _composer_get_latest_info_content_cb(Evas_Object *o, const char *result, void *data)
-{
-       debug_log("");
-       EmailComposerUGD *ugd = (EmailComposerUGD *)data;
-       debug_log("result: \n%s", result);
-
-       if (NULL != ugd->latest_info_content) {
-               g_free(ugd->latest_info_content);
-               ugd->latest_info_content = NULL;
-       }
-
-       if (result != NULL) {
-               ugd->latest_info_content = g_strdup(result);
-               debug_log("ugd->latest_info_content : \n%s", ugd->latest_info_content);
-       }
-}
-
-static void _composer_get_latest_html_content_cb(Evas_Object *o, const char *result, void *data)
+static void _composer_get_latest_body_html_content_cb(Evas_Object *o, const char *result, void *data)
 {
        debug_log("");
        EmailComposerUGD *ugd = (EmailComposerUGD *)data;
        debug_log("result: \n%s", result);
 
-       if (NULL != ugd->latest_html_content) {
-               g_free(ugd->latest_html_content);
-               ugd->latest_html_content = NULL;
+       if (NULL != ugd->latest_body_html_content) {
+               g_free(ugd->latest_body_html_content);
+               ugd->latest_body_html_content = NULL;
        }
 
        if (result != NULL) {
-               ugd->latest_html_content = g_strdup(result);
-               debug_log("ugd->latest_html_content : \n%s", ugd->latest_html_content);
+               ugd->latest_body_html_content = g_strdup(result);
+               debug_log("ugd->latest_body_html_content : \n%s", ugd->latest_body_html_content);
        }
 }
 
index 5866174..3c3233d 100755 (executable)
@@ -35,11 +35,10 @@ void _composer_webview_mouse_up_cb(void *data, Evas * evas, Evas_Object *obj, vo
 
 void _composer_webkit_loadFinished_cb(void *data, Evas_Object *obj, void *event_info);
 
+static void _composer_set_original_body_html_content_cb(Evas_Object *o, const char *result, void *data);
 static void _composer_webkit_script_executed_cb(Evas_Object *o, const char *result, void *data);
 static void _composer_webkit_focused_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _composer_webkit_unfocused_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _composer_set_original_html_content_cb(Evas_Object *o, const char *result, void *data);
-static void _composer_set_original_info_content_cb(Evas_Object *o, const char *result, void *data);
 static void _composer_webkit_scroll_up_cb(void *data, Evas_Object *obj, void *event_info);
 static void _composer_webkit_scroll_down_cb(void *data, Evas_Object *obj, void *event_info);
 
@@ -240,6 +239,9 @@ Evas_Object *_composer_create_body_webview(Evas_Object *parent, char *title, Ema
        evas_object_size_hint_align_set(ugd->body_ewkview, EVAS_HINT_FILL, EVAS_HINT_FILL);
        ewk_view_vertical_panning_hold_set(ugd->body_ewkview, EINA_TRUE);
 
+       if (NULL == ugd->body_ewkview)
+               debug_log("ugd->body_ewkview is NULL.");
+
        elm_object_part_content_set(ly, "webkit.swallow", ugd->body_ewkview);
 
        evas_object_smart_callback_add(ugd->body_ewkview, "edge,top", _composer_webview_reach_top_cb, ugd);
@@ -294,13 +296,15 @@ static void _composer_webkit_script_executed_cb(Evas_Object *o, const char *resu
 
        EmailComposerUGD *ugd = (EmailComposerUGD *)data;
 
-       if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_HTML_CONTENT, _composer_set_original_html_content_cb, (void *)ugd) == EINA_FALSE)
-               debug_log("COMPOSER_JS_GET_LATEST_HTML_CONTENT failed.");
-       if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_INFO_CONTENT, _composer_set_original_info_content_cb, (void *)ugd) == EINA_FALSE)
-               debug_log("COMPOSER_JS_GET_LATEST_INFO_CONTENT failed.");
+       if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_BODY_HTML_CONTENT, _composer_set_original_body_html_content_cb, (void *)ugd) == EINA_FALSE)
+               debug_log("COMPOSER_JS_GET_BODY_HTML_CONTENT failed."); 
+
        if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_IMAGE_LIST, _composer_get_image_list_cb, (void *)ugd)) {
                debug_log("COMPOSER_JS_GET_IMAGE_LIST error.");
        }
+
+       if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_BODY_ENABLE_EDITABLE, _composer_focus_script_executed_cb, (void *)ugd) == EINA_FALSE)
+               debug_log("COMPOSER_JS_BODY_ENABLE_EDITABLE failed.");
 }
 
 void _composer_webkit_loadFinished_cb(void *data, Evas_Object *obj, void *event_info)
@@ -439,34 +443,15 @@ void _composer_webview_reach_bottom_cb(void *data, Evas_Object *obj, void *event
        }
 }
 
-static void _composer_set_original_html_content_cb(Evas_Object *o, const char *result, void *data)
-{
-       debug_log("");
-
-       EmailComposerUGD *ugd = (EmailComposerUGD *)data;
-
-       if (result != NULL) {
-               ugd->original_html_content = g_strdup(result);
-               debug_log("ugd->original_html_content => \n%s", ugd->original_html_content);
-       }
-
-       if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_ENABLE_EDITABLE, _composer_focus_script_executed_cb, NULL) == EINA_FALSE)
-               debug_log("COMPOSER_JS_ENABLE_EDITABLE failed.");
-}
-
-static void _composer_set_original_info_content_cb(Evas_Object *o, const char *result, void *data)
+static void _composer_set_original_body_html_content_cb(Evas_Object *o, const char *result, void *data)
 {
        debug_log("");
 
        EmailComposerUGD *ugd = (EmailComposerUGD *)data;
 
        if (result != NULL) {
-               if (ugd->original_info_content) {
-                       g_free(ugd->original_info_content);
-                       ugd->original_info_content = NULL;
-               }
-               ugd->original_info_content = g_strdup(result);
-               debug_log("ugd->original_info_content => \n%s", ugd->original_info_content);
+               ugd->original_body_html_content = g_strdup(result);
+               debug_log("ugd->original_body_html_content => \n%s", ugd->original_body_html_content);
        }
 }
 
index a919880..3308fcb 100755 (executable)
@@ -503,11 +503,8 @@ int _composer_add_mailbox_folder(EmailComposerUGD *ugd, email_mailbox_type_e mai
                ugd->new_mail_info->attachment_list, ugd->new_mail_info->mail_data->attachment_count);
 
 
-       if (ugd->composer_type == RUN_COMPOSER_EDIT) {
-               nResult = email_update_mail(ugd->new_mail_info->mail_data, ugd->new_mail_info->attachment_list, ugd->new_mail_info->mail_data->attachment_count, NULL, 0);
-       } else {
-               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);
-       }
+
+       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);
 
        debug_log("result of email_add_mail: %d", nResult);
        if (nResult != EMAIL_ERROR_NONE) {
@@ -568,23 +565,7 @@ static void _composer_make_draft_html_content(EmailComposerUGD *ugd, char **html
 {
        debug_log("");
 
-       char *latest_info_content = _composer_make_text_with_div_tag(ugd->latest_info_content, 0);
-       char *latest_html_content = _composer_make_text_with_div_tag(ugd->latest_html_content, 1);
-
-       if (b_save_to_draft == EINA_TRUE) {
-               *html_content = g_strconcat(HTML_TAG_START, BODY_TAG_START, latest_info_content, latest_html_content, BODY_TAG_END, HTML_TAG_END, NULL);
-       } else {
-               *html_content = g_strconcat(HTML_TAG_START, BODY_TAG_START, ugd->latest_info_content, ugd->latest_html_content, BODY_TAG_END, HTML_TAG_END, NULL);
-       }
-
-       if (latest_info_content) {
-               g_free(latest_info_content);
-               latest_info_content = NULL;
-       }
-       if (latest_html_content) {
-               g_free(latest_html_content);
-               latest_html_content = NULL;
-       }
+       *html_content = g_strdup(ugd->latest_body_html_content);
 }
 
 int _composer_make_mail(EmailComposerUGD *ugd, Eina_Bool b_save_to_draft)
@@ -717,13 +698,17 @@ int _composer_make_mail(EmailComposerUGD *ugd, Eina_Bool b_save_to_draft)
                g_free(html_content_processed);
                html_content_processed = NULL;
 
-
-               plain_text_content = g_strdup(ugd->plain_content);
+               if (ugd->plain_content != NULL && strlen(ugd->plain_content) == 0) {
+                       plain_text_content = g_strdup("\n");
+               } else {
+                       plain_text_content = g_strdup(ugd->plain_content);
+               }
 
                if (NULL == plain_text_content) {
                        debug_log("ugd->plain_content is NULL");
                        return COMPOSER_ERROR_MAKE_MAIL_FAIL;
                }
+               
                if (EINA_FALSE == email_composer_save_file(SAVE_URI, plain_text_content, strlen(plain_text_content))) {
                        debug_log("Write to %s file failed", SAVE_URI);
                        g_free(plain_text_content);
@@ -1088,17 +1073,17 @@ void _composer_save_draft_mail(EmailComposerUGD * ugd)
                debug_log("Succeed in saving in Drafts");
                debug_log("Account id [%d] mailbox id [%d] mail id [%d]", ugd->account_info->account->account_id, ugd->mailbox_info->mailbox_id, ugd->nExistingMailID);
 
-               if (ugd->save_drafts == 0) {
-                       if (ugd->popup_list) {
-                               debug_log("popup count = %d", eina_list_count(ugd->popup_list));
-                               debug_log("composer_noti: %p", ugd->composer_noti);
-
-                               ugd->popup_list = eina_list_remove(ugd->popup_list, ugd->composer_noti/*obj*/);
-                       }
+               if (ugd->popup_list) {
+                       debug_log("popup count = %d", eina_list_count(ugd->popup_list));
+                       debug_log("composer_noti: %p", ugd->composer_noti);
+               
+                       ugd->popup_list = eina_list_remove(ugd->popup_list, ugd->composer_noti/*obj*/);
+               }
 
-                       evas_object_del(ugd->composer_noti);
-                       ugd->composer_noti = NULL;
+               evas_object_del(ugd->composer_noti);
+               ugd->composer_noti = NULL;
 
+               if (ugd->save_drafts == 0) {
                        ugd->idler_save_draft = ecore_idler_add(_composer_show_success_to_save, ugd);
                } else {
                        char str[128] = { 0, };
@@ -1144,8 +1129,8 @@ void _composer_save_popup_response_cb(void *data, Evas_Object *obj, void *event_
        } else if (pszBtnText && strcmp(pszBtnText, dgettext("sys_string", "IDS_COM_SK_NO")) == 0) {
                ugd->idler_save_draft = ecore_idler_add(_composer_idler_destroy, ugd);
        } else if (pszBtnText && strcmp(pszBtnText, dgettext("sys_string", "IDS_COM_SK_CANCEL")) == 0) {
-               if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_ENABLE_EDITABLE, _composer_focus_script_executed_cb, NULL) == EINA_FALSE)
-                       debug_log("COMPOSER_JS_ENABLE_EDITABLE failed.");
+               if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_BODY_ENABLE_EDITABLE, _composer_focus_script_executed_cb, NULL) == EINA_FALSE)
+                       debug_log("COMPOSER_JS_BODY_ENABLE_EDITABLE failed.");
                _composer_noti_response_cb(data, obj, event_info);
        }
 }
@@ -2797,7 +2782,11 @@ static void _composer_get_original_body_info(EmailComposerUGD *ugd, char **text_
                tmp_info_text = g_strdup("\n");
        }
 
-       *text_for_original_info = g_strconcat(DIV_TAG_START_ORIGIN_INFO, signature_text, tmp_info_text, DIV_TAG_END, NULL);
+       if (signature_text == NULL) {
+               *text_for_original_info = g_strconcat(DIV_TAG_START_ORIGIN_INFO, tmp_info_text, DIV_TAG_END, NULL);
+       } else {
+               *text_for_original_info = g_strconcat(DIV_TAG_START_ORIGIN_INFO, signature_text, tmp_info_text, DIV_TAG_END, NULL);
+       }
        debug_log("text_for_original_info: \n%s", *text_for_original_info);
 
        if (tmp_info_text) {
@@ -3208,23 +3197,17 @@ bool _composer_check_mail_is_modified(void *data)
        }
 
        if (EINA_TRUE == ugd->has_body_html) {
-               if (ugd->latest_info_content == NULL) {
-                       debug_log("ugd->latest_info_content is NULL");
+               if (ugd->latest_body_html_content == NULL) {
+                       debug_log("ugd->latest_body_html_content is NULL");
                        is_modified = false;
                        goto FINISH_OFF;
                }
 
-               if (ugd->latest_html_content == NULL) {
-                       debug_log("ugd->latest_html_content is NULL");
-                       is_modified = false;
-                       goto FINISH_OFF;
-               }
-
-               if (ugd->latest_info_content && ugd->original_info_content) {
-                       debug_log("original_info_content:\n%s", ugd->original_info_content);
-                       debug_log("latest_info_content:\n%s", ugd->latest_info_content);
-                       if (g_strcmp0(ugd->original_info_content, ugd->latest_info_content) != 0) {
-                               debug_log("diff => %d", g_strcmp0(ugd->original_info_content, ugd->latest_info_content));
+               if (ugd->latest_body_html_content && ugd->original_body_html_content) {
+                       debug_log("original_body_html_content:\n%s", ugd->original_body_html_content);
+                       debug_log("latest_body_html_content:\n%s", ugd->latest_body_html_content);
+                       if (g_strcmp0(ugd->original_body_html_content, ugd->latest_body_html_content) != 0) {
+                               debug_log("diff => %d", g_strcmp0(ugd->original_body_html_content, ugd->latest_body_html_content));
                                is_modified = true;
                                goto FINISH_OFF;
                        }
@@ -3232,17 +3215,6 @@ bool _composer_check_mail_is_modified(void *data)
                        is_modified = false;    /*if latest_html_content and/or saved_html_content is NULL,
                                                                is_modified set to false; on return false, destroy composer is called*/
                }
-
-               if (ugd->latest_html_content && ugd->original_html_content) {
-                       debug_log("original_html_content:\n%s", ugd->original_html_content);
-                       debug_log("latest_html_content:\n%s", ugd->latest_html_content);
-                       if (g_strcmp0(ugd->original_html_content, ugd->latest_html_content) != 0) {
-                               is_modified = true;
-                       }
-               } else {
-                       is_modified = false;    /*if latest_html_content and/or saved_html_content is NULL,
-                                                               is_modified set to false; on return false, destroy composer is called*/
-               }
        }
 
 FINISH_OFF:
index 3b02a83..0e0628d 100755 (executable)
@@ -426,25 +426,17 @@ static void on_destroy(ui_gadget_h ug, service_h data, void *priv)
                        g_free(ugd->saved_html_path);
                        ugd->saved_html_path = NULL;
                }
-               if (ugd->latest_info_content) {
-                       g_free(ugd->latest_info_content);
-                       ugd->latest_info_content = NULL;
-               }
-               if (ugd->latest_html_content) {
-                       g_free(ugd->latest_html_content);
-                       ugd->latest_html_content = NULL;
-               }
                if (ugd->plain_content) {
                        g_free(ugd->plain_content);
                        ugd->plain_content = NULL;
                }
-               if (ugd->original_info_content) {
-                       g_free(ugd->original_info_content);
-                       ugd->original_info_content = NULL;
+               if (ugd->latest_body_html_content) {
+                       g_free(ugd->latest_body_html_content);
+                       ugd->latest_body_html_content = NULL;
                }
-               if (ugd->original_html_content) {
-                       g_free(ugd->original_html_content);
-                       ugd->original_html_content = NULL;
+               if (ugd->original_body_html_content) {
+                       g_free(ugd->original_body_html_content);
+                       ugd->original_body_html_content = NULL;
                }
        }
 
@@ -893,11 +885,11 @@ static void _composer_init_data(void *data)
        ugd->body_ewkview = NULL;
        ugd->has_body_html = EINA_FALSE;
        ugd->saved_html_path = NULL;
-       ugd->latest_info_content = NULL;
-       ugd->latest_html_content = NULL;
        ugd->plain_content = NULL;
-       ugd->original_info_content = NULL;
-       ugd->original_html_content = NULL;
+
+       ugd->latest_body_html_content = NULL;
+       ugd->original_body_html_content = NULL;
+
        ugd->to_recipients_cnt = 0;
        ugd->cc_recipients_cnt = 0;
        ugd->bcc_recipients_cnt = 0;
@@ -1032,25 +1024,17 @@ static void _composer_finish_service(void *data)
                        g_free(ugd->saved_html_path);
                        ugd->saved_html_path = NULL;
                }
-               if (ugd->latest_info_content) {
-                       g_free(ugd->latest_info_content);
-                       ugd->latest_info_content = NULL;
-               }
-               if (ugd->latest_html_content) {
-                       g_free(ugd->latest_html_content);
-                       ugd->latest_html_content = NULL;
-               }
                if (ugd->plain_content) {
                        g_free(ugd->plain_content);
                        ugd->plain_content = NULL;
                }
-               if (ugd->original_info_content) {
-                       g_free(ugd->original_info_content);
-                       ugd->original_info_content = NULL;
+               if (ugd->latest_body_html_content) {
+                       g_free(ugd->latest_body_html_content);
+                       ugd->latest_body_html_content = NULL;
                }
-               if (ugd->original_html_content) {
-                       g_free(ugd->original_html_content);
-                       ugd->original_html_content = NULL;
+               if (ugd->original_body_html_content) {
+                       g_free(ugd->original_body_html_content);
+                       ugd->original_body_html_content = NULL;
                }
        }