mobilemessaging/smsmtm/clientmtm/src/SMSCLNT.CPP
branchRCL_3
changeset 11 9a08a7b164a5
parent 0 72b543305e3a
child 21 c6838af47512
equal deleted inserted replaced
5:4697dfb2d7ad 11:9a08a7b164a5
   817 */
   817 */
   818 void CSmsClientMtm::LoadMessageL()
   818 void CSmsClientMtm::LoadMessageL()
   819 	{
   819 	{
   820 	__ASSERT_DEBUG(iMsvEntry,Panic(ESmscEntryNotSet));
   820 	__ASSERT_DEBUG(iMsvEntry,Panic(ESmscEntryNotSet));
   821 
   821 
   822 	RestoreServiceAndSettingsL();
       
   823 
       
   824 	ResetHeader();
       
   825 	Body().Reset();
       
   826 	CMsvStore* msvstore=iMsvEntry->ReadStoreL();
   822 	CMsvStore* msvstore=iMsvEntry->ReadStoreL();
   827 	CleanupStack::PushL(msvstore);
   823 	CleanupStack::PushL(msvstore);
   828 	switch (iMsvEntry->Entry().iType.iUid)
   824 	switch (iMsvEntry->Entry().iType.iUid)
   829 		{
   825 		{
   830 		case KUidMsvServiceEntryValue:
   826 		case KUidMsvServiceEntryValue:
   831 			{
   827 			{
   832 			CSmsAccount* account = CSmsAccount::NewLC();
   828 			RestoreServiceAndSettingsL();
   833 			// just v2
       
   834 			account->LoadSettingsL(*iServiceSettings);
       
   835 			CleanupStack::PopAndDestroy(account);    
       
   836 			break;
   829 			break;
   837 			}
   830 			}
   838 		case KUidMsvFolderEntryValue:
   831 		case KUidMsvFolderEntryValue:
   839 			{
   832 			{
   840 			break;
   833 			break;
   841 			}
   834 			}
   842 		case KUidMsvMessageEntryValue:
   835 		case KUidMsvMessageEntryValue:
   843 			{
   836 			{
       
   837 			ResetHeader();
       
   838 			Body().Reset();
       
   839 			
   844 			CSmsHeader* smsheader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
   840 			CSmsHeader* smsheader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
   845 			CleanupStack::PushL(smsheader);
   841 			CleanupStack::PushL(smsheader);
   846 			smsheader->RestoreL(*msvstore);
   842 			smsheader->RestoreL(*msvstore);
   847 			// the following part inserts the recipients from header also to the smsclient
   843 			// the following part inserts the recipients from header also to the smsclient
   848 			// the recipients are restored inside the csmsheader already
   844 			// the recipients are restored inside the csmsheader already
  1519  	// Fix for DEF061945: Need to initialise the iDate member of the new entry
  1515  	// Fix for DEF061945: Need to initialise the iDate member of the new entry
  1520  	entry.iDate.UniversalTime();
  1516  	entry.iDate.UniversalTime();
  1521  	// store entry in folder
  1517  	// store entry in folder
  1522  	iMsvEntry->CreateL(entry);
  1518  	iMsvEntry->CreateL(entry);
  1523  	SwitchCurrentEntryL(entry.Id());
  1519  	SwitchCurrentEntryL(entry.Id());
       
  1520  	// End of fix
       
  1521 
       
  1522 	delete iSmsHeader;
       
  1523 	iSmsHeader=NULL;
       
  1524 	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
       
  1525 	iSmsHeader->SetSmsSettingsL(*iServiceSettings);
       
  1526 
       
  1527 	// service centre was not being set 
       
  1528 	TInt defaultSC = iServiceSettings->DefaultServiceCenter();
       
  1529 	if(defaultSC > -1)
       
  1530 		{
       
  1531 		if (iServiceSettings->ServiceCenterCount() > defaultSC )
       
  1532 			{
       
  1533 			iSmsHeader->SetServiceCenterAddressL( iServiceSettings->GetServiceCenter(defaultSC).Address() );	
       
  1534 			}
       
  1535 		}
       
  1536  	}
       
  1537 
       
  1538 
       
  1539 
       
  1540 /** 
       
  1541 Creates a new outgoing SMS message entry as a child of the current context.
       
  1542 
       
  1543 Used by CSendAs::CreateMessageL to create an outgoing SMS message.
       
  1544 
       
  1545 @param	
       
  1546 The entry with the required fields set.
       
  1547 
       
  1548 */
       
  1549 EXPORT_C void CSmsClientMtm::CreateMessageL(TMsvEntry& aEntry)
       
  1550 	{
       
  1551 	RestoreServiceAndSettingsL();
       
  1552 
       
  1553  	aEntry.SetVisible(EFalse);
       
  1554  	aEntry.SetInPreparation(ETrue);
       
  1555  	aEntry.iDate.UniversalTime();
       
  1556  	
       
  1557  	// store entry in folder
       
  1558  	iMsvEntry->CreateL(aEntry);
       
  1559  	SwitchCurrentEntryL(aEntry.Id());
  1524  	// End of fix
  1560  	// End of fix
  1525 
  1561 
  1526 	delete iSmsHeader;
  1562 	delete iSmsHeader;
  1527 	iSmsHeader=NULL;
  1563 	iSmsHeader=NULL;
  1528 	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
  1564 	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());