messagingapp/msgappfw/msghistory/src/msghistoryprivate.cpp
changeset 37 518b245aa84c
parent 25 84d9eb65b26f
child 48 4f501b74aeb1
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
    17 
    17 
    18 //SYSTEM INCLUDES
    18 //SYSTEM INCLUDES
    19 #include <ccsrequesthandler.h>
    19 #include <ccsrequesthandler.h>
    20 #include <ccsconversationentry.h>
    20 #include <ccsconversationentry.h>
    21 #include <ccsclientconversation.h>
    21 #include <ccsclientconversation.h>
    22 #include <s60qconversions.h>
    22 #include <xqconversions.h>
    23 
    23 
    24 //USER INCLUDES
    24 //USER INCLUDES
    25 #include "msghistoryprivate.h"
    25 #include "msghistoryprivate.h"
    26 #include "msghistoryimpl.h"
    26 #include "msghistoryimpl.h"
    27 #include <msgitem.h>
    27 #include <msgitem.h>
    99     TInt conversationId = -1;
    99     TInt conversationId = -1;
   100     TRAPD(err, 
   100     TRAPD(err, 
   101             conversationId = handler->GetConversationIdL(aContactId));
   101             conversationId = handler->GetConversationIdL(aContactId));
   102     CCsClientConversation* clientConversation = CCsClientConversation::NewL();
   102     CCsClientConversation* clientConversation = CCsClientConversation::NewL();
   103     clientConversation->SetConversationEntryId(conversationId);
   103     clientConversation->SetConversationEntryId(conversationId);
       
   104     // set the contact id, which will be used in case when the 
       
   105     // conversation entry id is -1.
       
   106     clientConversation->SetContactId(aContactId);
   104     //set dummy entry
   107     //set dummy entry
   105     CCsConversationEntry *entry = CCsConversationEntry::NewL();
   108     CCsConversationEntry *entry = CCsConversationEntry::NewL();
   106     clientConversation->SetConversationEntryL(entry);
   109     clientConversation->SetConversationEntryL(entry);
   107 
   110 
   108     handler->RequestConversationChangeEventL(this, clientConversation);
   111     handler->RequestConversationChangeEventL(this, clientConversation);
   123     TInt conversationId = -1;
   126     TInt conversationId = -1;
   124     TRAPD(err, 
   127     TRAPD(err, 
   125             conversationId = handler->GetConversationIdL(aContactId));
   128             conversationId = handler->GetConversationIdL(aContactId));
   126     CCsClientConversation* clientConversation = CCsClientConversation::NewL();
   129     CCsClientConversation* clientConversation = CCsClientConversation::NewL();
   127     clientConversation->SetConversationEntryId(conversationId);
   130     clientConversation->SetConversationEntryId(conversationId);
       
   131     // set the contact id, which will be used in case when the 
       
   132     // conversation entry id is -1.
       
   133     clientConversation->SetContactId(aContactId);
   128     //set dummy entry
   134     //set dummy entry
   129     CCsConversationEntry *entry = CCsConversationEntry::NewL();
   135     CCsConversationEntry *entry = CCsConversationEntry::NewL();
   130     clientConversation->SetConversationEntryL(entry);
   136     clientConversation->SetConversationEntryL(entry);
   131 
   137 
   132     handler->RemoveConversationChangeEventL(this, clientConversation);
   138     handler->RemoveConversationChangeEventL(this, clientConversation);
   228 
   234 
   229     // description
   235     // description
   230     HBufC* description = entry.Description();    
   236     HBufC* description = entry.Description();    
   231     if( description && description->Length())
   237     if( description && description->Length())
   232         {
   238         {
   233         item.setBody(S60QConversions::s60DescToQString(*description)); 
   239         item.setBody(XQConversions::s60DescToQString(*description)); 
   234         }
   240         }
   235 
   241 
   236     // time stamp 
   242     // time stamp 
   237     TTime unixEpoch(KUnixEpoch);
   243     TTime unixEpoch(KUnixEpoch);
   238     TTimeIntervalSeconds seconds;
   244     TTimeIntervalSeconds seconds;
   242 
   248 
   243     //contact details
   249     //contact details
   244     HBufC* contact = entry.Contact();
   250     HBufC* contact = entry.Contact();
   245     if( contact && contact->Length())
   251     if( contact && contact->Length())
   246         {
   252         {
   247         item.setPhoneNumber(S60QConversions::s60DescToQString(*contact));      
   253         item.setPhoneNumber(XQConversions::s60DescToQString(*contact));      
   248         }
   254         }
   249 
   255 
   250     //sending state
   256     //sending state
   251     item.setState((MsgItem::MsgState)entry.GetSendState());    
   257     item.setState((MsgItem::MsgState)entry.GetSendState());    
   252     
   258