Reason : draft mms message didn't be updated because msgid is not used
Fix : draft mms messge is updated by using msgid when update is required
Change-Id: Ice23bd5eb80895597c99d132ee223e5c4921499d
int copy_id;
int resend_id;
int retrieve_id;
int copy_id;
int resend_id;
int retrieve_id;
int check_cnt;
int media_chk_cnt;
int del_index;
int check_cnt;
int media_chk_cnt;
int del_index;
int ly_body_h;
int send_check_exception_type;
int ly_body_h;
int send_check_exception_type;
char *working_path;
/* setting data */
char *working_path;
/* setting data */
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_page_duration(int nPage, int duration);
/* save send*/
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_page_duration(int nPage, int duration);
/* save send*/
-COMPOSER_RETURN_TYPE_E msg_ui_composer_save_message(msg_handle_t msg_handle);
+COMPOSER_RETURN_TYPE_E msg_ui_composer_save_message(msg_handle_t msg_handle, int msg_id);
COMPOSER_RETURN_TYPE_E msg_ui_composer_get_message_data(MSG_COMPOSER_VIEW_DATA_S *cd);
COMPOSER_RETURN_TYPE_E msg_ui_composer_get_message_data(MSG_COMPOSER_VIEW_DATA_S *cd);
-COMPOSER_RETURN_TYPE_E msg_ui_composer_message_make_and_send(msg_handle_t msg_handle, msg_thread_id_t *tid);
+COMPOSER_RETURN_TYPE_E msg_ui_composer_message_make_and_send(msg_handle_t msg_handle, int msg_id, msg_thread_id_t *tid);
msg_struct_t msg_ui_composer_message_make_preview(msg_handle_t msg_handle);
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_loaded_data(void *composer_data, bool set_recipient);
msg_struct_t msg_ui_composer_message_make_preview(msg_handle_t msg_handle);
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_loaded_data(void *composer_data, bool set_recipient);
break;
case MSG_STORAGE_CHANGE_UPDATE :
break;
case MSG_STORAGE_CHANGE_UPDATE :
- msg_ui_bubble_item_data_update(BubbleData, conv);
+ if (msg_id == BubbleData->draft_msg_id) {
+ BubbleData->draft_msg_id = 0;
+ msg_ui_bubble_list_append(BubbleData, conv);
+ } else {
+ msg_ui_bubble_item_data_update(BubbleData, conv);
+ }
D_MSG("last draft msgid is %d", msg_id);
cd->loading_draft = true;
D_MSG("last draft msgid is %d", msg_id);
cd->loading_draft = true;
+ /* change composer mode */
+ cd->composer_mode = MSG_COMPOSER_MODE_EDIT;
+ cd->msg_id = msg_id;
+ bubble_data->draft_msg_id = msg_id;
msg_ui_composer_message_init();
msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
msg_ui_composer_message_init();
msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
bubble_data->copy_id = 0;
bubble_data->resend_id = 0;
bubble_data->retrieve_id = 0;
bubble_data->copy_id = 0;
bubble_data->resend_id = 0;
bubble_data->retrieve_id = 0;
+ bubble_data->draft_msg_id = 0;
if (bubble_data->load_animator) {
ecore_animator_del(bubble_data->load_animator);
if (bubble_data->load_animator) {
ecore_animator_del(bubble_data->load_animator);
return COMPOSER_RETURN_SUCCESS;
}
return COMPOSER_RETURN_SUCCESS;
}
-static COMPOSER_RETURN_TYPE_E __msg_ui_composer_make_sms_message(msg_handle_t msg_handle)
+static COMPOSER_RETURN_TYPE_E __msg_ui_composer_make_sms_message(msg_handle_t msg_handle, int msg_id)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+
+ /* set msgid */
+ if (msg_id) {
+ D_MSG("msg_id = %d", msg_id);
+ if (msg_set_int_value(msg_data->msgInfo, MSG_MESSAGE_ID_INT, msg_id) != MSG_SUCCESS) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] set msgId error");
+ }
+ }
+
/* set message type to SMS */
if (msg_set_int_value(msg_data->msgInfo, MSG_MESSAGE_TYPE_INT, MSG_TYPE_SMS) != MSG_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT]msg_ui_comp_core_set_message_type error !!");
/* set message type to SMS */
if (msg_set_int_value(msg_data->msgInfo, MSG_MESSAGE_TYPE_INT, MSG_TYPE_SMS) != MSG_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT]msg_ui_comp_core_set_message_type error !!");
return COMPOSER_RETURN_SUCCESS;
}
return COMPOSER_RETURN_SUCCESS;
}
-static COMPOSER_RETURN_TYPE_E __msg_ui_composer_make_mms_message(msg_handle_t msg_handle)
+static COMPOSER_RETURN_TYPE_E __msg_ui_composer_make_mms_message(msg_handle_t msg_handle, int msg_id)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
ui_mms_data = msg_data->mms_data;
ui_mms_data = msg_data->mms_data;
+ /* set msgid */
+ if (msg_id) {
+ D_MSG("msg_id = %d", msg_id);
+ if (msg_set_int_value(msg_data->msgInfo, MSG_MESSAGE_ID_INT, msg_id) != MSG_SUCCESS) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] set msgId error");
+ }
+ }
+
/* set msg type to MMS */
if (msg_set_int_value(msg_data->msgInfo, MSG_MESSAGE_TYPE_INT, MSG_TYPE_MMS) != MSG_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] set message type[MMS] error");
/* set msg type to MMS */
if (msg_set_int_value(msg_data->msgInfo, MSG_MESSAGE_TYPE_INT, MSG_TYPE_MMS) != MSG_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] set message type[MMS] error");
- if (__msg_ui_composer_make_mms_message(msg_handle)
+ if (__msg_ui_composer_make_mms_message(msg_handle, 0)
!= COMPOSER_RETURN_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "[ERROR] make mms message error !!!");
return NULL;
!= COMPOSER_RETURN_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "[ERROR] make mms message error !!!");
return NULL;
return msg_data->msgInfo;
}
return msg_data->msgInfo;
}
-COMPOSER_RETURN_TYPE_E msg_ui_composer_message_make_and_send(msg_handle_t msg_handle, msg_thread_id_t *tid)
+COMPOSER_RETURN_TYPE_E msg_ui_composer_message_make_and_send(msg_handle_t msg_handle, int msg_id, msg_thread_id_t *tid)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
/* 2. make message */
if (msg_data->msg_type == COMPOSER_MSG_TYPE_SMS) {
/* 2. make message */
if (msg_data->msg_type == COMPOSER_MSG_TYPE_SMS) {
- if (__msg_ui_composer_make_sms_message(msg_handle) != COMPOSER_RETURN_SUCCESS)
+ if (__msg_ui_composer_make_sms_message(msg_handle, msg_id) != COMPOSER_RETURN_SUCCESS)
ret = COMPOSER_RETURN_FAIL;
} else if (msg_data->msg_type == COMPOSER_MSG_TYPE_MMS) {
ret = COMPOSER_RETURN_FAIL;
} else if (msg_data->msg_type == COMPOSER_MSG_TYPE_MMS) {
- if (__msg_ui_composer_make_mms_message(msg_handle) != COMPOSER_RETURN_SUCCESS)
+ if (__msg_ui_composer_make_mms_message(msg_handle, msg_id) != COMPOSER_RETURN_SUCCESS)
ret = COMPOSER_RETURN_FAIL;
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] invalid message type");
ret = COMPOSER_RETURN_FAIL;
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] invalid message type");
-COMPOSER_RETURN_TYPE_E msg_ui_composer_save_message(msg_handle_t msg_handle)
+COMPOSER_RETURN_TYPE_E msg_ui_composer_save_message(msg_handle_t msg_handle, int msg_id)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
/* 2. make message */
if (msg_data->msg_type == COMPOSER_MSG_TYPE_SMS) {
/* 2. make message */
if (msg_data->msg_type == COMPOSER_MSG_TYPE_SMS) {
- if (__msg_ui_composer_make_sms_message(msg_handle) != COMPOSER_RETURN_SUCCESS)
+ if (__msg_ui_composer_make_sms_message(msg_handle, msg_id) != COMPOSER_RETURN_SUCCESS)
ret = COMPOSER_RETURN_FAIL;
} else if (msg_data->msg_type == COMPOSER_MSG_TYPE_MMS) {
ret = COMPOSER_RETURN_FAIL;
} else if (msg_data->msg_type == COMPOSER_MSG_TYPE_MMS) {
- if (__msg_ui_composer_make_mms_message(msg_handle) != COMPOSER_RETURN_SUCCESS)
+ if (__msg_ui_composer_make_mms_message(msg_handle, msg_id) != COMPOSER_RETURN_SUCCESS)
ret = COMPOSER_RETURN_FAIL;
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] invalid message type");
ret = COMPOSER_RETURN_FAIL;
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] invalid message type");
msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
msg_set_bool_value(sendOpt, MSG_SEND_OPT_SETTING_BOOL, false);
msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
msg_set_bool_value(sendOpt, MSG_SEND_OPT_SETTING_BOOL, false);
- ret = msg_add_message(msg_handle, msg_data->msgInfo, sendOpt);
+ if (!msg_id)
+ ret = msg_add_message(msg_handle, msg_data->msgInfo, sendOpt);
+ else
+ ret = msg_update_message(msg_handle, msg_data->msgInfo, sendOpt);
msg_release_struct(&sendOpt);
}
msg_release_struct(&sendOpt);
}
- COMPOSER_RETURN_TYPE_E ret = msg_ui_composer_message_make_and_send(cd->msg_handle, &tid);
+ COMPOSER_RETURN_TYPE_E ret = msg_ui_composer_message_make_and_send(cd->msg_handle, cd->msg_id, &tid);
/* reset region info */
MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
/* reset region info */
MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
}
cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
}
cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
} else {
bool is_closed = false;
} else {
bool is_closed = false;
cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
bool set_recipient = false;
int msg_id = atoi(bundle_txt);
bool set_recipient = false;
int msg_id = atoi(bundle_txt);
- if (cd->composer_mode == MSG_COMPOSER_MODE_EDIT)
+ if (cd->composer_mode == MSG_COMPOSER_MODE_EDIT) {
+ cd->msg_id = msg_id;
msg_ui_composer_message_init();
msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
msg_ui_composer_message_init();
msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
msg_ui_composer_message_init();
if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
msg_ui_composer_message_init();
if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
- msg_ui_composer_save_message(cd->msg_handle);
+ msg_ui_composer_save_message(cd->msg_handle, cd->msg_id);
}
msg_ui_composer_message_destroy();
}
msg_ui_composer_message_destroy();
msg_ui_composer_message_init();
if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
msg_ui_composer_message_init();
if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
- msg_ui_composer_save_message(cd->msg_handle);
+ msg_ui_composer_save_message(cd->msg_handle, cd->msg_id);
}
msg_ui_composer_message_destroy();
}
msg_ui_composer_message_destroy();
if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
D_MSG("save draft message");
if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
D_MSG("save draft message");
- msg_ui_composer_save_message(cd->msg_handle);
+ msg_ui_composer_save_message(cd->msg_handle, cd->msg_id);
/* show saved ticker popup */
msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_AUTO_SAVED);
}
/* show saved ticker popup */
msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_AUTO_SAVED);
}