From 4b395682597398571602b6c0b8fb0bdcd9daa068 Mon Sep 17 00:00:00 2001 From: Kisub Song Date: Tue, 28 Aug 2012 18:41:18 +0900 Subject: [PATCH] Update change log and spec for wrt-plugins-tizen_0.2.73 Changed Modules : Messaging and Download [Version] 0.2.73 [Project] GT-I8800, Public [Title] SEL Verification [Team] WebAPI [BinType] PDA [Customer] Open [Issue#] WEB-1723 [Problem] Messaging - empty message body is return after loadMessageBody() [Cause] email body updated but old message body is returned [Solution] update email body for updated one [Issue#] WEB-1243 [Problem] Messaging - loadMessageAttachment callback error [Cause] throw exception on loadMessageAttachment [Solution] loadMessageAttachment exception bug fix [SCMRequest] N/A --- debian/changelog | 8 ++ packaging/wrt-plugins-tizen.spec | 2 +- src/platform/API/Download/OnDownloadStateChanged.h | 1 + src/platform/Tizen/Download/DownloadManager.cpp | 23 +++-- src/platform/Tizen/Messaging/MailSync.cpp | 109 ++++++++++----------- 5 files changed, 74 insertions(+), 69 deletions(-) diff --git a/debian/changelog b/debian/changelog index dc9c4cc..b7a836c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +wrt-plugins-tizen (0.2.73) unstable; urgency=low + + * Bug fix on Messaging + * Git : slp/pkgs/w/wrt-plugins-tizen + * Tag : wrt-plugins-tizen_0.2.73 + + -- Kisub Song Tue, 28 Aug 2012 18:37:01 +0900 + wrt-plugins-tizen (0.2.72) unstable; urgency=low * Bug fix on Messaging, Notification, Alarm, LBS and Contact diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index e0f832d..31f4269 100755 --- a/packaging/wrt-plugins-tizen.spec +++ b/packaging/wrt-plugins-tizen.spec @@ -1,6 +1,6 @@ Name: wrt-plugins-tizen Summary: JavaScript plugins for WebRuntime -Version: 0.2.72 +Version: 0.2.73 Release: 0 Group: TO_BE_FILLED License: TO_BE_FILLED diff --git a/src/platform/API/Download/OnDownloadStateChanged.h b/src/platform/API/Download/OnDownloadStateChanged.h index e6d599d..3aab71c 100755 --- a/src/platform/API/Download/OnDownloadStateChanged.h +++ b/src/platform/API/Download/OnDownloadStateChanged.h @@ -36,6 +36,7 @@ class OnDownloadStateChanged : public WrtDeviceApis::Commons::ListenerEventsetFileName(fullPath.substr(found+1)); + if( path ) { + std::string fullPath(path); + found = fullPath.find_last_of("/\\"); + eventPtr->setFileName(fullPath.substr(found+1)); + LogInfo("Full path: "<getFileName()); + } eventPtr->setDownloadId((long) download); eventPtr->setDownloadState(TIZEN_ENUM_DOWNLOAD_STATE_COMPLETED); eventPtr->setResult(true); thisDownloadManager->m_changeEmitters[download]->emit(eventPtr); - //thisDownloadManager->m_changeEmitters.erase(download); + thisDownloadManager->m_changeEmitters.erase(download); - /*ret = url_download_destroy(download); + ret = url_download_destroy(download); if (ret != URL_DOWNLOAD_ERROR_NONE) { ThrowMsg(PlatformException, "Platform error while destroying download handle: "<m_changeEmitters[download]->emit(eventPtr); - //thisDownloadManager->m_changeEmitters.erase(download); + thisDownloadManager->m_changeEmitters.erase(download); - /*ret = url_download_destroy(download); + ret = url_download_destroy(download); if (ret != URL_DOWNLOAD_ERROR_NONE) { LogWarning("Platform error while destroying download handle: "<getMailId(); //if email body download mode. - int status = syncNetworkStatus->getStatus(); - int handle = syncNetworkStatus->getHandle(); + LogDebug("OnEventReceived"); + SyncNetworkStatusPtr syncNetworkStatus(new SyncNetworkStatus(event.GetArg0())); + int mailId = syncNetworkStatus->getMailId(); //if email body download mode. + int status = syncNetworkStatus->getStatus(); + int handle = syncNetworkStatus->getHandle(); // if Attachment Load - if ( status == NOTI_DOWNLOAD_ATTACH_FINISH || - status == NOTI_DOWNLOAD_ATTACH_FAIL ) - { + if ( status == NOTI_DOWNLOAD_ATTACH_FINISH ||status == NOTI_DOWNLOAD_ATTACH_FAIL ) + { int nth = handle; LogDebug(" Debus mailID = " << mailId << " , Nth = " << nth ); - + SyncRequestIterator it = m_SyncRequests.begin(); for ( ; it != m_SyncRequests.end(); it++ ) { const Api::Messaging::IEmailPtr& mail = it->second.mail; - + LogDebug(" request mailID = " << mail->getUID() << " , Nth = " << (it->second.attachment)->getNth() ); if ( mail->getUID() == mailId && nth == (it->second.attachment)->getNth()) - { + { Api::Messaging::EventMessagingServiceReqReceiver* requestReceiver = mail->getRequestReceiver(); if ( mail && requestReceiver ) { Api::Messaging::EventMessagingServicePtr event = mail->getMessagingServiceEvent(); - + if (status == NOTI_DOWNLOAD_ATTACH_FINISH) { LogDebug(" Attachment Finish " ); @@ -444,7 +443,7 @@ void MailSync::OnEventReceived(const DBus::MessageEvent& event) email_attachment_data_t* attachment_data = NULL; int attachmentId = attachment->getAttachmentID(); LogDebug("Attachment ID = " << attachmentId); - + int err = email_get_attachment_data(attachmentId, &attachment_data); if (err == EMAIL_ERROR_NONE) { LogDebug("attachment Name : " << attachment_data->attachment_name); @@ -455,88 +454,86 @@ void MailSync::OnEventReceived(const DBus::MessageEvent& event) { LogDebug("fail to email_get_attachment_data - err : " << err); } - + } - + } - else - { + else + { event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException); LogDebug(" Attachment Failed " ); } requestReceiver->ManualAnswer(event); - m_SyncRequests.erase( handle ); - - } + m_SyncRequests.erase( handle ); - break; + } + break; } } } - else if ( status == NOTI_DOWNLOAD_ATTACH_START ) + else if ( status == NOTI_DOWNLOAD_ATTACH_START ) { LogDebug("DownLoading... attachment : size = " << syncNetworkStatus->getErrorCode()); return; } - SyncRequestIterator it = m_SyncRequests.find(handle); - if ( m_SyncRequests.end() != it) - { + SyncRequestIterator it = m_SyncRequests.find(handle); + if ( m_SyncRequests.end() != it) + { int syncType = it->second.syncType; LogDebug(" Sync ... handle : " << handle << " status : " << status << " SyncType: " << syncType); switch(syncType) { case MESSAGING_SERVICE_SYNC_TYPE_SYNC: - { + { LogDebug(" Sync Account"); const Api::Messaging::IMessagingServicePtr& messagingService = it->second.messagingService; Api::Messaging::EventMessagingServiceReqReceiver* requestReceiver = messagingService->getRequestReceiver(); - + if ( messagingService && requestReceiver) - { + { Api::Messaging::EventMessagingServicePtr event = messagingService->getMessagingServiceEvent(); if ( status == NOTI_DOWNLOAD_FINISH ) - { + { LogDebug("Sync Success"); - requestReceiver->ManualAnswer(event); - m_SyncRequests.erase( handle ); + requestReceiver->ManualAnswer(event); + m_SyncRequests.erase( handle ); } else if ( status == NOTI_DOWNLOAD_FAIL ) - { + { LogDebug("Sync Fail"); - event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException ); + event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException ); requestReceiver->ManualAnswer(event); m_SyncRequests.erase( handle ); - } + } } else { ThrowMsg(WrtDeviceApis::Commons::PlatformException, "request Receiver is NULL. "); } - break; } case MESSAGING_SERVICE_SYNC_TYPE_SYNC_FOLDER: - { + { LogDebug("Sync Folder"); const Api::Messaging::IMessagingServicePtr& messagingService = it->second.messagingService; Api::Messaging::EventMessagingServiceReqReceiver* requestReceiver = messagingService->getRequestReceiver(); - + if ( messagingService && requestReceiver) - { + { Api::Messaging::EventMessagingServicePtr event = messagingService->getMessagingServiceEvent(); if ( status == NOTI_DOWNLOAD_FINISH ) - { + { LogDebug("Sync Success"); - requestReceiver->ManualAnswer(event); - m_SyncRequests.erase( handle ); + requestReceiver->ManualAnswer(event); + m_SyncRequests.erase( handle ); } else if ( status == NOTI_DOWNLOAD_FAIL ) - { + { LogDebug("Sync Fail"); - event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException ); + event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException ); requestReceiver->ManualAnswer(event); m_SyncRequests.erase( handle ); } @@ -548,7 +545,7 @@ void MailSync::OnEventReceived(const DBus::MessageEvent& event) break; } case MESSAGING_SERVICE_SYNC_TYPE_DOWNLOAD_BODY: - { + { LogDebug(" DownLoad Body"); const Api::Messaging::IEmailPtr& mail = it->second.mail; // IEmailPtr Api::Messaging::EventMessagingServiceReqReceiver* requestReceiver = mail->getRequestReceiver(); @@ -556,6 +553,7 @@ void MailSync::OnEventReceived(const DBus::MessageEvent& event) Api::Messaging::EventMessagingServicePtr event = mail->getMessagingServiceEvent(); if ( status == NOTI_DOWNLOAD_BODY_FINISH ) { + event->m_message->readAllData(); requestReceiver->ManualAnswer(event); m_SyncRequests.erase( handle ); } @@ -564,21 +562,16 @@ void MailSync::OnEventReceived(const DBus::MessageEvent& event) event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException); requestReceiver->ManualAnswer(event); m_SyncRequests.erase( handle ); - } - } + } + } else { ThrowMsg(WrtDeviceApis::Commons::PlatformException, "request Receiver is NULL. "); } - break; } - } - - } - } int MailSync::downloadBodyInternal( const Api::Messaging::IEmailPtr& mail, int account_id) @@ -620,10 +613,10 @@ int MailSync::downloadAttachmentInternal(const Api::Messaging::IEmailPtr& mail, int mailId = mail->convertId(mail->getIdRef()); unsigned email_handle = 0; -// email_mail_data_t* result = NULL; + email_mail_data_t* result = NULL; int error; -// error = email_get_mail_data(mailId, &result); + error = email_get_mail_data(mailId, &result); if (EMAIL_ERROR_NONE != error) { ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Couldn't find message " << mailId << ". [" << error << "]"); @@ -661,14 +654,14 @@ int MailSync::downloadAttachmentInternal(const Api::Messaging::IEmailPtr& mail, { LogDebug("Insert downloadAttachment request"); LogDebug("handle : " << email_handle); - SyncRequestData data = SyncRequestData( email_handle, + SyncRequestData data = SyncRequestData( email_handle, MESSAGING_SERVICE_SYNC_TYPE_DOWNLOAD_ATTACHMENT, mail, attachment ); - m_SyncRequests.insert(std::make_pair(email_handle, data)); + m_SyncRequests.insert(std::make_pair(email_handle, data)); } -// if ( result ) -// if ( EMAIL_ERROR_NONE != email_free_mail_data( &result , 1) ) -// LogDebug("fail to email_free_mail_data - err "); + if ( result ) + if ( EMAIL_ERROR_NONE != email_free_mail_data( &result , 1) ) + LogDebug("fail to email_free_mail_data - err "); return email_handle; } -- 2.7.4