messagingapp/msgui/appengine/src/conversationsengine.cpp
changeset 44 36f374c67aa8
parent 43 35b64624a9e7
child 47 5b14749788d7
child 52 12db4185673b
--- a/messagingapp/msgui/appengine/src/conversationsengine.cpp	Wed Jun 23 18:09:17 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationsengine.cpp	Tue Jul 06 14:12:40 2010 +0300
@@ -16,6 +16,9 @@
  */
 #include "conversationsengine.h"
 
+#include <ccsconversationentry.h>
+#include <ccsclientconversation.h>
+
 #include "conversationsenginedefines.h"
 #include "convergedmessage.h"
 #include "conversationmsgstorehandler.h"
@@ -52,6 +55,12 @@
     d_ptr = new ConversationsEnginePrivate(mConversationMsgStoreHandler,
         mConversationsSummaryModel,
         mConversationsModel);
+    
+    connect (mConversationsModel,
+            SIGNAL(conversationViewEmpty()),
+            this,
+            SIGNAL(conversationViewEmpty())); 
+   
 }
 
 //---------------------------------------------------------------
@@ -212,7 +221,27 @@
     {
         displayName = indexList[0].data(DisplayName).toString();
         address = indexList[0].data(ConversationAddress).toString();
-    }         
+    }
+    else
+    {
+        int error;
+        CCsClientConversation* clientConv = NULL;
+        TRAP(error, clientConv = d_ptr->getConversationFromConversationIdL(conversationId));
+
+        HBufC *name = clientConv->GetDisplayName();
+        if (name && name->Length())
+        {
+            displayName = XQConversions::s60DescToQString(*name);
+        }
+
+        HBufC *addr = clientConv->GetConversationEntry()->Contact();
+        if (addr && addr->Length())
+        {
+            address = XQConversions::s60DescToQString(*addr);
+        }
+
+        delete clientConv;
+    }
 }
 
 //---------------------------------------------------------------
@@ -284,6 +313,35 @@
 }
 
 //---------------------------------------------------------------
+// ConversationsEngine::emitConversationListModelEntryDeleted
+// @see header
+//---------------------------------------------------------------
+void ConversationsEngine::emitConversationListModelEntryDeleted( int conversationId )
+{
+    emit conversationListEntryDeleted( conversationId );
+}
+
+//---------------------------------------------------------------
+// ConversationsEngine::emitOpenConversationViewIdUpdate
+// @see header
+//---------------------------------------------------------------
+void ConversationsEngine::emitOpenConversationViewIdUpdate(
+        int newConversationId)
+{
+    //also register for subscription now
+    d_ptr->registerAgainForConversationUpdatesL(newConversationId);   
+}
+
+//---------------------------------------------------------------
+// ConversationsEngine::disableRegisterationForCVEvents
+// @see header
+//---------------------------------------------------------------
+void ConversationsEngine::disableRegisterationForCVEvents()
+{
+    d_ptr->deRegisterCVUpdatesTemporary();
+}
+
+//---------------------------------------------------------------
 // ConversationsEngine::fetchMoreConversations
 // @see header
 //---------------------------------------------------------------