Update change log and spec for wrt-plugins-tizen_0.2.73
authorKisub Song <kisubs.song@samsung.com>
Tue, 28 Aug 2012 09:41:18 +0000 (18:41 +0900)
committerKisub Song <kisubs.song@samsung.com>
Tue, 28 Aug 2012 09:41:18 +0000 (18:41 +0900)
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
packaging/wrt-plugins-tizen.spec
src/platform/API/Download/OnDownloadStateChanged.h
src/platform/Tizen/Download/DownloadManager.cpp
src/platform/Tizen/Messaging/MailSync.cpp

index dc9c4cc..b7a836c 100644 (file)
@@ -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 <kisubs.song@samsung.com>  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
index e0f832d..31f4269 100755 (executable)
@@ -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
index e6d599d..3aab71c 100755 (executable)
@@ -36,6 +36,7 @@ class OnDownloadStateChanged : public WrtDeviceApis::Commons::ListenerEvent<OnDo
     OnDownloadStateChanged(){
         m_downloadId = -1;
         m_downloadState = "";
+        m_fileName = "";
         m_receivedSize = 0;
         m_totalSize = 0;
     }
index 261e2b5..f27aae6 100755 (executable)
@@ -78,7 +78,7 @@ static void on_url_download_paused(url_download_h download, void *user_data)
 
 static void on_url_download_completed(url_download_h download, const char * path, void *user_data)
 {
-    LogInfo("Download completed with handle: "<<download<<", path: "<<path);
+    LogInfo("Download completed with handle: "<<download);
 
     Try
     {
@@ -108,21 +108,24 @@ static void on_url_download_completed(url_download_h download, const char * path
             ThrowMsg(PlatformException, "Platform error while unsetting progress cb: "<<ret);
         }
 
-        std::string fullPath(path);
-        found = fullPath.find_last_of("/\\");
-        eventPtr->setFileName(fullPath.substr(found+1));
+        if( path ) {
+            std::string fullPath(path);
+            found = fullPath.find_last_of("/\\");
+            eventPtr->setFileName(fullPath.substr(found+1));
+            LogInfo("Full path: "<<path<<", file name: "<<eventPtr->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: "<<ret);
-        }*/
+        }
     }
     Catch (Exception)
     {
@@ -179,12 +182,12 @@ static void on_url_download_stopped(url_download_h download, url_download_error_
     }
 
     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) {
         LogWarning("Platform error while destroying download handle: "<<ret);
-    }*/
+    }
 }
 
 static void on_url_download_progress(url_download_h download, unsigned long long received, unsigned long long total, void *user_data)
index 8f84890..fa1b65f 100644 (file)
@@ -399,32 +399,31 @@ int MailSync::syncFolderInternal(const Api::Messaging::IMessagingServicePtr& mes
 // TODO Copied from former solution, refactor it.
 void MailSync::OnEventReceived(const DBus::MessageEvent& event)
 {
-    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();
+       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;
 }