messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp
changeset 27 e4592d119491
parent 25 84d9eb65b26f
child 47 5b14749788d7
equal deleted inserted replaced
25:84d9eb65b26f 27:e4592d119491
   405 void ConversationMsgStoreHandler::FetchDraftMessages(DraftsModel* draftsModel)
   405 void ConversationMsgStoreHandler::FetchDraftMessages(DraftsModel* draftsModel)
   406     {
   406     {
   407     mDraftsModel = draftsModel;
   407     mDraftsModel = draftsModel;
   408     iState = EReadDrafts;
   408     iState = EReadDrafts;
   409     TCallBack callback = TCallBack(ProcessDraftMessages, (TAny*) this);
   409     TCallBack callback = TCallBack(ProcessDraftMessages, (TAny*) this);
   410     iIdle = CIdle::NewL(CActive::EPriorityStandard);
   410     TRAPD(err, iIdle = CIdle::NewL(CActive::EPriorityStandard));
   411     iIdle->Start(callback);
   411     if(err == KErrNone)
       
   412         {
       
   413         iIdle->Start(callback);    
       
   414         }
   412     }
   415     }
   413 
   416 
   414 // -----------------------------------------------------------------------------
   417 // -----------------------------------------------------------------------------
   415 // ConversationMsgStoreHandler::ProcessDraftMessages
   418 // ConversationMsgStoreHandler::ProcessDraftMessages
   416 // CIdle callback 
   419 // CIdle callback 
   646         }
   649         }
   647     return false;
   650     return false;
   648 }
   651 }
   649 
   652 
   650 //---------------------------------------------------------------
   653 //---------------------------------------------------------------
   651 // ConversationMsgStoreHandler::setNotificationMessageId
   654 // ConversationMsgStoreHandler::setNotificationMessageIdL
   652 // @see header
   655 // @see header
   653 //---------------------------------------------------------------
   656 //---------------------------------------------------------------
   654 void ConversationMsgStoreHandler::setNotificationMessageId(int messageId)
   657 void ConversationMsgStoreHandler::setNotificationMessageIdL(int messageId)
   655 {
   658 {
   656     // get MMS Notification client mtm & set the content to current entry
   659     // get MMS Notification client mtm & set the content to current entry
   657     if(iNotificationClient)
   660     if(iNotificationClient)
   658     {
   661     {
   659         delete iNotificationClient;
   662         delete iNotificationClient;
   666     iNotificationClient->SwitchCurrentEntryL(messageId);
   669     iNotificationClient->SwitchCurrentEntryL(messageId);
   667     iNotificationClient->LoadMessageL();
   670     iNotificationClient->LoadMessageL();
   668 }
   671 }
   669 
   672 
   670 //---------------------------------------------------------------
   673 //---------------------------------------------------------------
   671 // ConversationMsgStoreHandler::NotificationMsgSize
   674 // ConversationMsgStoreHandler::NotificationMsgSizeL
   672 // @see header
   675 // @see header
   673 //---------------------------------------------------------------
   676 //---------------------------------------------------------------
   674 QString ConversationMsgStoreHandler::NotificationMsgSize()
   677 QString ConversationMsgStoreHandler::NotificationMsgSizeL()
   675 {
   678 {
   676     // Size of message.
   679     // Size of message.
   677     TInt size = iNotificationClient->MessageTransferSize( );
   680     TInt size = iNotificationClient->MessageTransferSize( );
   678     
   681     
   679     // read max receive size limit from settings
   682     // read max receive size limit from settings
   839         (iMtmReg->NewMtmL(KUidMsgMMSNotification));
   842         (iMtmReg->NewMtmL(KUidMsgMMSNotification));
   840     }
   843     }
   841     iNotificationClient->SwitchCurrentEntryL(aId);    */ 
   844     iNotificationClient->SwitchCurrentEntryL(aId);    */ 
   842     
   845     
   843     // set context to current entry
   846     // set context to current entry
   844     setNotificationMessageId(aId);
   847     setNotificationMessageIdL(aId);
   845 
   848 
   846     TTime currentTime;
   849     TTime currentTime;
   847     currentTime.HomeTime( );
   850     currentTime.HomeTime( );
   848     TTime expiryTime = iNotificationClient->ExpiryDate( );
   851     TTime expiryTime = iNotificationClient->ExpiryDate( );
   849     TLocale locale;
   852     TLocale locale;
   923         TMsvEntry entry = cEntry->Entry();
   926         TMsvEntry entry = cEntry->Entry();
   924         if ( entry.Unread() ) 
   927         if ( entry.Unread() ) 
   925             {
   928             {
   926             // Mark the entry as read
   929             // Mark the entry as read
   927             entry.SetUnread( EFalse );
   930             entry.SetUnread( EFalse );
   928             cEntry->ChangeL( entry );
   931             TRAP_IGNORE(cEntry->ChangeL( entry ));
   929             }
   932             }
   930         // extract message type
   933         // extract message type
   931         extractMsgType(entry,msgType,msgSubType);
   934         extractMsgType(entry,msgType,msgSubType);
   932         }
   935         }
   933     
   936