ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp
changeset 4 e7aa27f58ae1
parent 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
3:a4d6f1ea0416 4:e7aa27f58ae1
    17 
    17 
    18 
    18 
    19 #include "emailtrace.h"
    19 #include "emailtrace.h"
    20 #include "ipsplgheaders.h"
    20 #include "ipsplgheaders.h"
    21 
    21 
       
    22 #include <featmgr.h>
       
    23 #include <bldvariant.hrh> // for feature definitions
       
    24 
    22 // <cmail> const TInt KIpsSetUtilsCharAt = '@'; </cmail>
    25 // <cmail> const TInt KIpsSetUtilsCharAt = '@'; </cmail>
    23 const TInt KIpsSetUtilsCharLessThan = '<';
    26 const TInt KIpsSetUtilsCharLessThan = '<';
    24 const TInt KIpsSetUtilsCharMoreThan = '>';
    27 const TInt KIpsSetUtilsCharMoreThan = '>';
    25 const TInt KIpsSetUtilsCntrCharacters = 2;
    28 const TInt KIpsSetUtilsCntrCharacters = 2;
    26 
    29 
    46 //    
    49 //    
    47 CIpsPlgSmtpService::~CIpsPlgSmtpService() 
    50 CIpsPlgSmtpService::~CIpsPlgSmtpService() 
    48     {
    51     {
    49     FUNC_LOG;
    52     FUNC_LOG;
    50     delete iMsgMapper;
    53     delete iMsgMapper;
       
    54     
       
    55     if( iFeatureManagerInitialized )
       
    56     	{
       
    57     	FeatureManager::UnInitializeLib();  
       
    58     	}
    51     }    
    59     }    
    52 
    60 
    53 // ---------------------------------------------------------------------------
    61 // ---------------------------------------------------------------------------
    54 // CIpsPlgSmtpService::NewL
    62 // CIpsPlgSmtpService::NewL
    55 // ---------------------------------------------------------------------------
    63 // ---------------------------------------------------------------------------
    87 //
    95 //
    88 void CIpsPlgSmtpService::ConstructL()
    96 void CIpsPlgSmtpService::ConstructL()
    89     {
    97     {
    90     FUNC_LOG;
    98     FUNC_LOG;
    91     iMsgMapper = CIpsPlgMsgMapper::NewL( iSession, iPlugin );
    99     iMsgMapper = CIpsPlgMsgMapper::NewL( iSession, iPlugin );
       
   100     
       
   101     FeatureManager::InitializeLibL();
       
   102     iFeatureManagerInitialized = ETrue;
    92     }
   103     }
    93 
   104 
    94 // ---------------------------------------------------------------------------
   105 // ---------------------------------------------------------------------------
    95 // CIpsPlgSmtpService::CreateDisplayStringLC
   106 // CIpsPlgSmtpService::CreateDisplayStringLC
    96 // ---------------------------------------------------------------------------
   107 // ---------------------------------------------------------------------------
   521 CFSMailMessage* CIpsPlgSmtpService::CreateFSMessageAndSetFlagsL(
   532 CFSMailMessage* CIpsPlgSmtpService::CreateFSMessageAndSetFlagsL(
   522        TMsvId aMessageId, TMsvId aOriginalMsgId,TMsvId aMailboxId )
   533        TMsvId aMessageId, TMsvId aOriginalMsgId,TMsvId aMailboxId )
   523     {
   534     {
   524     FUNC_LOG;
   535     FUNC_LOG;
   525 
   536 
       
   537     
       
   538    
       
   539     // tp teleca change for korean specific email encoding
   526     // Default charset
   540     // Default charset
   527     TUid charset;
   541     TUid charset;
   528     charset.iUid = KCharacterSetIdentifierUtf8;
   542     charset.iUid = KCharacterSetIdentifierUtf8;
       
   543 
       
   544       // korea specific charset
       
   545       if ( FeatureManager::FeatureSupported( KFeatureIdKorean ))
       
   546       {
       
   547       
       
   548       //const TUid KCRUidEMailCharsets = {0x20018441};    // korea needs different default charset
       
   549           const TInt KoreanMib = 36; // magic number to read from cen rep would be better
       
   550             
       
   551 		  CCnvCharacterSetConverter* charConv = NULL;
       
   552 		  TRAPD( err, charConv = CCnvCharacterSetConverter::NewL() );
       
   553 		  if( err == KErrNone )
       
   554 			  {
       
   555 			  TUint characterSetId = KCharacterSetIdentifierUtf8;
       
   556 			  RFs fs;
       
   557 			  TInt err = fs.Connect();
       
   558 			  
       
   559 			  if( err == KErrNone )
       
   560 				  {
       
   561 				  TRAP( err, characterSetId = charConv->ConvertMibEnumOfCharacterSetToIdentifierL( KoreanMib, fs ));
       
   562 				   if( err == KErrNone )
       
   563 					   { // set korean specific charset
       
   564 					   charset = TUid::Uid( characterSetId );
       
   565 					   }
       
   566 				   fs.Close();
       
   567 				  }
       
   568 			  }
       
   569 
       
   570          delete charConv; 
       
   571      
       
   572       }
       
   573       // tp teleca change END
   529 
   574 
   530     // set in preparation flag, altought 
   575     // set in preparation flag, altought 
   531     // not known where this affects
   576     // not known where this affects
   532     TMsvId dummy;
   577     TMsvId dummy;
   533     TMsvEmailEntry newEmailMsg;
   578     TMsvEmailEntry newEmailMsg;