From: Andrzej Popowski Date: Thu, 21 May 2015 08:39:58 +0000 (+0200) Subject: [MessagingEmail] - Fixing a bug on sending message X-Git-Tag: submit/tizen_mobile/20150612.133019^2~2^2~133^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e72568adb74b8cba0ce3172305a4576764dbe0d;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [MessagingEmail] - Fixing a bug on sending message Change-Id: Iea1af989e765c514b145e6c1ecbc12cee58fe1ea Signed-off-by: Andrzej Popowski --- diff --git a/src/messaging/email_manager.cc b/src/messaging/email_manager.cc index 7f430021..30820488 100644 --- a/src/messaging/email_manager.cc +++ b/src/messaging/email_manager.cc @@ -443,30 +443,28 @@ PlatformResult EmailManager::sendMessage(MessageRecipientsCallbackData* callback if (message) { if (!(message->is_id_set())) { platform_result = addOutboxMessagePlatform(callback->getAccountId(), message); - if (platform_result.IsError()) return platform_result; - } - - err = email_get_mail_data(message->getId(),&mail_data); - - if (EMAIL_ERROR_NONE != err) { - LoggerE("email_get_mail_data failed. [%d]\n", err); - platform_result = PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to get platform email structure"); } else { - LoggerD("email_get_mail_data success.\n"); + err = email_get_mail_data(message->getId(),&mail_data); + if (EMAIL_ERROR_NONE != err) { + LoggerE("email_get_mail_data failed. [%d]\n", err); + platform_result = PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to get platform email structure"); + } else { + LoggerD("email_get_mail_data success.\n"); - // Sending EMAIL - mail_data->save_status = EMAIL_MAIL_STATUS_SENDING; + // Sending EMAIL + mail_data->save_status = EMAIL_MAIL_STATUS_SENDING; - int req_id = 0; - err = email_send_mail(mail_data->mail_id, &req_id); + int req_id = 0; + err = email_send_mail(mail_data->mail_id, &req_id); - if (EMAIL_ERROR_NONE != err) { - LoggerE("Failed to send message %d", err); - platform_result = PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to send message"); - } else { - LoggerD("req_id: %d", req_id); - callback->getMessage()->setMessageStatus(MessageStatus::STATUS_SENDING); - m_sendRequests[req_id] = callback; + if (EMAIL_ERROR_NONE != err) { + LoggerE("Failed to send message %d", err); + platform_result = PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to send message"); + } else { + LoggerD("req_id: %d", req_id); + callback->getMessage()->setMessageStatus(MessageStatus::STATUS_SENDING); + m_sendRequests[req_id] = callback; + } } } } else {