messagingapp/msgappfw/server/src/ccsconversationcache.cpp
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 37 518b245aa84c
child 47 5b14749788d7
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
   422 {
   422 {
   423     //create clientconversation
   423     //create clientconversation
   424     CCsClientConversation* clientConversation = CCsClientConversation::NewL();
   424     CCsClientConversation* clientConversation = CCsClientConversation::NewL();
   425     CleanupStack::PushL(clientConversation);
   425     CleanupStack::PushL(clientConversation);
   426 
   426 
   427     clientConversation->SetFirstNameL(aConversation->GetFirstName());
   427     clientConversation->SetDisplayNameL(aConversation->GetDisplayName());
   428     clientConversation->SetLastNameL(aConversation->GetLastName());
       
   429     clientConversation->SetNickNameL(aConversation->GetNickName());
       
   430     clientConversation->SetConversationEntryId(aConversation->GetConversationId());
   428     clientConversation->SetConversationEntryId(aConversation->GetConversationId());
   431     clientConversation->SetConversationEntryL(aConversationEntry);
   429     clientConversation->SetConversationEntryL(aConversationEntry);
   432     clientConversation->SetContactId(aConversation->GetContactId());
   430     clientConversation->SetContactId(aConversation->GetContactId());
   433     clientConversation->SetUnreadMessageCount(aConversation->GetUnreadMessageCount());
   431     clientConversation->SetUnreadMessageCount(aConversation->GetUnreadMessageCount());
   434 
   432 
   638                 return conversation->GetConversationId();
   636                 return conversation->GetConversationId();
   639             }
   637             }
   640     }
   638     }
   641     return -1;
   639     return -1;
   642     }
   640     }
       
   641 
       
   642 // ----------------------------------------------------------------------------
       
   643 // CCsConversationCache::GetConversationFromMessageIdL
       
   644 // ---------------------------------------------------------------------------
       
   645 CCsClientConversation* CCsConversationCache::GetConversationFromMessageIdL(TInt aMessageId)
       
   646 {
       
   647     TInt conversationCount = iConversationList->Count();
       
   648 
       
   649     for ( TInt loop = 0; loop < conversationCount; loop++ )
       
   650     {
       
   651         CCsConversation* conversation =
       
   652             static_cast<CCsConversation*>((*iConversationList)[loop]);
       
   653 
       
   654         // Get the conversation entries
       
   655         RPointerArray<CCsConversationEntry> entryList;
       
   656         conversation->GetEntryListL(&entryList);
       
   657 
       
   658         for ( TInt loop1 = 0; loop1 < entryList.Count(); loop1++ )
       
   659         {
       
   660             TInt messageId = entryList[loop1]->EntryId();
       
   661             if ( messageId == aMessageId )
       
   662             {
       
   663                 CCsClientConversation *clientConv = CreateClientConvLC(conversation, entryList[loop1]);
       
   664                 CleanupStack::Pop();
       
   665                 return clientConv;
       
   666             }
       
   667         }
       
   668     }
       
   669     return NULL;
       
   670 }
       
   671 
   643 //end of file
   672 //end of file