messagingapp/msgappfw/server/src/ccssession.cpp
changeset 52 12db4185673b
parent 44 36f374c67aa8
child 72 6f657153cbc5
equal deleted inserted replaced
44:36f374c67aa8 52:12db4185673b
   487         aMessage.ReadL(0, bufferPtr);
   487         aMessage.ReadL(0, bufferPtr);
   488 
   488 
   489         // Stream over the buffer
   489         // Stream over the buffer
   490         RDesReadStream stream(bufferPtr);
   490         RDesReadStream stream(bufferPtr);
   491         stream.PushL();
   491         stream.PushL();
   492 
   492         
       
   493         //Read known index and page size
       
   494         TInt knownIndex = stream.ReadInt32L();
       
   495         TInt pageSize  = stream.ReadInt32L();
       
   496         
   493         // get cache pointer
   497         // get cache pointer
   494         CCsConversationCache* cache = iServer->ConversationCacheInterface();
   498         CCsConversationCache* cache = iServer->ConversationCacheInterface();
   495 
   499 
   496         // read the Client Conversation consist of Entry Id
   500         // read the Client Conversation consist of Entry Id
   497         CCsClientConversation* ClientConversation =
   501         CCsClientConversation* ClientConversation =
   504         CleanupStack::PushL(ClientConversation);
   508         CleanupStack::PushL(ClientConversation);
   505         RPointerArray<CCsConversationEntry>* conversationEntryList=
   509         RPointerArray<CCsConversationEntry>* conversationEntryList=
   506                 new (ELeave) RPointerArray<CCsConversationEntry>(10);
   510                 new (ELeave) RPointerArray<CCsConversationEntry>(10);
   507         CleanupResetAndDestroyPushL(conversationEntryList);
   511         CleanupResetAndDestroyPushL(conversationEntryList);
   508 
   512 
   509         // get conversationlist for given ClientConversation 
   513         // get conversation entry  list for given ClientConversation 
   510         cache->GetConversationsL(ClientConversation, conversationEntryList);
   514         TInt totalCount(0);
       
   515         cache->GetConversationsL (ClientConversation,
       
   516                 conversationEntryList,
       
   517                 knownIndex,
       
   518                 pageSize,
       
   519                 totalCount);
   511 
   520 
   512         // create a new buffer for writing into stream
   521         // create a new buffer for writing into stream
   513         // write all list data into stream
   522         // write all list data into stream
   514         CBufFlat* buf = CBufFlat::NewL(KBigBuffer);
   523         CBufFlat* buf = CBufFlat::NewL(KBigBuffer);
   515         CleanupStack::PushL(buf);
   524         CleanupStack::PushL(buf);
   518         writeStream.PushL();
   527         writeStream.PushL();
   519 
   528 
   520         TInt ItemCount = conversationEntryList->Count();
   529         TInt ItemCount = conversationEntryList->Count();
   521         //write  recent conversation entry list
   530         //write  recent conversation entry list
   522         writeStream.WriteInt32L(ItemCount);
   531         writeStream.WriteInt32L(ItemCount);
   523 
   532         
       
   533         //Write total count in the stream to update UI
       
   534         writeStream.WriteInt32L(totalCount);
       
   535         
   524         // Write the conversation entry
   536         // Write the conversation entry
   525         for (TInt iloop = 0; iloop < ItemCount; iloop++)
   537         for (TInt iloop = 0; iloop < ItemCount; iloop++)
   526         {
   538         {
   527             CCsConversationEntry
   539             CCsConversationEntry
   528                     * entry =
   540                     * entry =