messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp
changeset 37 518b245aa84c
parent 25 84d9eb65b26f
child 41 25fe1fe642e3
--- a/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp	Mon May 03 12:29:07 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp	Fri Jun 25 15:47:40 2010 +0530
@@ -26,7 +26,7 @@
 #include "conversationmsgstorehandler.h"
 #include "draftsmodel.h"
 #include "MuiuOperationWait.h"
-#include "MsgBioUids.h"
+#include "msgbiouids.h"
 #include "UniEditorGenUtils.h"
 
 // SYSTEM INCLUDES
@@ -407,8 +407,11 @@
     mDraftsModel = draftsModel;
     iState = EReadDrafts;
     TCallBack callback = TCallBack(ProcessDraftMessages, (TAny*) this);
-    iIdle = CIdle::NewL(CActive::EPriorityStandard);
-    iIdle->Start(callback);
+    TRAPD(err, iIdle = CIdle::NewL(CActive::EPriorityStandard));
+    if(err == KErrNone)
+        {
+        iIdle->Start(callback);    
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -648,10 +651,10 @@
 }
 
 //---------------------------------------------------------------
-// ConversationMsgStoreHandler::setNotificationMessageId
+// ConversationMsgStoreHandler::setNotificationMessageIdL
 // @see header
 //---------------------------------------------------------------
-void ConversationMsgStoreHandler::setNotificationMessageId(int messageId)
+void ConversationMsgStoreHandler::setNotificationMessageIdL(int messageId)
 {
     // get MMS Notification client mtm & set the content to current entry
     if(iNotificationClient)
@@ -668,10 +671,10 @@
 }
 
 //---------------------------------------------------------------
-// ConversationMsgStoreHandler::NotificationMsgSize
+// ConversationMsgStoreHandler::NotificationMsgSizeL
 // @see header
 //---------------------------------------------------------------
-QString ConversationMsgStoreHandler::NotificationMsgSize()
+QString ConversationMsgStoreHandler::NotificationMsgSizeL()
 {
     // Size of message.
     TInt size = iNotificationClient->MessageTransferSize( );
@@ -841,7 +844,7 @@
     iNotificationClient->SwitchCurrentEntryL(aId);    */ 
     
     // set context to current entry
-    setNotificationMessageId(aId);
+    setNotificationMessageIdL(aId);
 
     TTime currentTime;
     currentTime.HomeTime( );
@@ -925,7 +928,7 @@
             {
             // Mark the entry as read
             entry.SetUnread( EFalse );
-            cEntry->ChangeL( entry );
+            TRAP_IGNORE(cEntry->ChangeL( entry ));
             }
         // extract message type
         extractMsgType(entry,msgType,msgSubType);
@@ -949,6 +952,9 @@
         {
         case KSenduiMtmSmsUidValue:            
             msgType = ConvergedMessage::Sms;
+            if (entry.iBioType == KMsgBioNokiaServiceSentMessage.iUid) {
+                msgSubType = ConvergedMessage::NokiaService;
+            }
             break;
         case KSenduiMtmBtUidValue:
             msgType = ConvergedMessage::BT;
@@ -979,12 +985,29 @@
             else if (entry.iBioType == KMsgBioUidVCalendar.iUid)
                 {
                 msgSubType = ConvergedMessage::VCal;
-                }        
+                }
+            else if (entry.iBioType == KMsgBioNokiaServiceSentMessage.iUid) {
+                msgSubType = ConvergedMessage::NokiaService;
+                }
             }
-            break;
-        default:
-            msgType = ConvergedMessage::None;       
-            break;
-        }
+        break;
+    default:
+        msgType = ConvergedMessage::None;
+        break;
     }
+}
+
+int ConversationMsgStoreHandler::getMsgSubType(int msgId)
+{
+    int msgType = ConvergedMessage::None;
+    int msgSubType = ConvergedMessage::None;
+    CMsvEntry* cEntry = NULL;
+    TRAPD(err, cEntry = iMsvSession->GetEntryL(msgId));
+    if (err == KErrNone) {
+        TMsvEntry entry = cEntry->Entry();
+        extractMsgType(entry, msgType, msgSubType);
+    }
+    return msgSubType;
+}
+
 // End of file