ipsservices/ipssosplugin/src/ipsplgsearch.cpp
changeset 23 2dc6caa42ec3
parent 18 578830873419
child 51 d845db10c0d4
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
   958 // ---------------------------------------------------------------------------
   958 // ---------------------------------------------------------------------------
   959 //
   959 //
   960 void CIpsPlgSearch::CollectMessagesL()
   960 void CIpsPlgSearch::CollectMessagesL()
   961     {
   961     {
   962     FUNC_LOG;
   962     FUNC_LOG;
       
   963     TMsvId mailboxId = iCurrentSearch.iMailbox.Id();
       
   964 	TMsvId serviceId;
       
   965 	TMsvEntry tEntry;
       
   966 	TMsvEntry mailboxServiceEntry;
       
   967 	
   963     // Lets make a huge list of message id's. 
   968     // Lets make a huge list of message id's. 
   964     iEmailMessages.Reset();    
   969     iEmailMessages.Reset();    
   965     
   970     
   966     const TInt folders = iCurrentSearch.iFolderIds.Count();
   971     const TInt folders = iCurrentSearch.iFolderIds.Count();
   967     for ( TInt folder = 0; folder < folders; folder++ )
   972     for ( TInt folder = 0; folder < folders; folder++ )
   968         {
   973         {
   969         iActiveEntry->SetEntryL( iCurrentSearch.iFolderIds[folder].Id() );        
   974         iActiveEntry->SetEntryL( iCurrentSearch.iFolderIds[folder].Id() );  
       
   975     	if( iActiveEntry->Entry().Parent() == KMsvLocalServiceIndexEntryIdValue )
       
   976     		{
       
   977     		User::LeaveIfError(
       
   978     			iMsvSession.GetEntry( mailboxId, serviceId, tEntry ) );
       
   979     		User::LeaveIfError(
       
   980     		    iMsvSession.GetEntry( tEntry.iRelatedId, serviceId, mailboxServiceEntry ) );
       
   981     		}
       
   982     	else
       
   983     		{
       
   984      		serviceId = mailboxId;
       
   985     		}
       
   986 
   970         const TInt msgs = iActiveEntry->Count();
   987         const TInt msgs = iActiveEntry->Count();
   971         for ( TInt msg = 0; msg < msgs; msg++ )
   988         for ( TInt msg = 0; msg < msgs; msg++ )
   972             {
   989             {
   973             const TMsvEntry& entry = ( *iActiveEntry )[msg];
   990             const TMsvEntry& entry = ( *iActiveEntry )[msg];
   974             if ( entry.iType == KUidMsvMessageEntry &&
   991             if ( entry.iType == KUidMsvMessageEntry &&
       
   992             	 entry.iServiceId == serviceId &&
   975                  ( entry.iMtm.iUid == KSenduiMtmSmtpUidValue ||
   993                  ( entry.iMtm.iUid == KSenduiMtmSmtpUidValue ||
   976                    entry.iMtm.iUid == iPlugin.MtmId().iUid ) )
   994                    entry.iMtm.iUid == iPlugin.MtmId().iUid ) )
   977                 {
   995                 {
   978                 iEmailMessages.AppendL( TMsgContainer( 
   996                 iEmailMessages.AppendL( TMsgContainer( 
   979                     entry.Id(), iCurrentSearch.iSortCriteria, iMsvSession ) );
   997                     entry.Id(), iCurrentSearch.iSortCriteria, iMsvSession ) );
   980                 }        
   998                 }        
   981             }
   999             }
   982         }    
  1000         }    
   983     }
  1001     }
       
  1002 
       
  1003 //Ask client if it wants to change the search prority (i.e. to enable search for contact)
       
  1004 void CIpsPlgSearch::ClientRequiredSearchPriority( TInt *apRequiredSearchPriority )
       
  1005 	{
       
  1006 	FUNC_LOG;
       
  1007 	if ( iObserver )
       
  1008 	  iObserver->ClientRequiredSearchPriority( apRequiredSearchPriority );
       
  1009 	}
       
  1010 
   984     
  1011     
   985 // End of File
  1012 // End of File
   986 
  1013