ipsservices/ipssosplugin/src/ipsplgsearch.cpp
changeset 23 2dc6caa42ec3
parent 18 578830873419
child 51 d845db10c0d4
--- a/ipsservices/ipssosplugin/src/ipsplgsearch.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsearch.cpp	Fri May 14 15:41:10 2010 +0300
@@ -960,18 +960,36 @@
 void CIpsPlgSearch::CollectMessagesL()
     {
     FUNC_LOG;
+    TMsvId mailboxId = iCurrentSearch.iMailbox.Id();
+	TMsvId serviceId;
+	TMsvEntry tEntry;
+	TMsvEntry mailboxServiceEntry;
+	
     // Lets make a huge list of message id's. 
     iEmailMessages.Reset();    
     
     const TInt folders = iCurrentSearch.iFolderIds.Count();
     for ( TInt folder = 0; folder < folders; folder++ )
         {
-        iActiveEntry->SetEntryL( iCurrentSearch.iFolderIds[folder].Id() );        
+        iActiveEntry->SetEntryL( iCurrentSearch.iFolderIds[folder].Id() );  
+    	if( iActiveEntry->Entry().Parent() == KMsvLocalServiceIndexEntryIdValue )
+    		{
+    		User::LeaveIfError(
+    			iMsvSession.GetEntry( mailboxId, serviceId, tEntry ) );
+    		User::LeaveIfError(
+    		    iMsvSession.GetEntry( tEntry.iRelatedId, serviceId, mailboxServiceEntry ) );
+    		}
+    	else
+    		{
+     		serviceId = mailboxId;
+    		}
+
         const TInt msgs = iActiveEntry->Count();
         for ( TInt msg = 0; msg < msgs; msg++ )
             {
             const TMsvEntry& entry = ( *iActiveEntry )[msg];
             if ( entry.iType == KUidMsvMessageEntry &&
+            	 entry.iServiceId == serviceId &&
                  ( entry.iMtm.iUid == KSenduiMtmSmtpUidValue ||
                    entry.iMtm.iUid == iPlugin.MtmId().iUid ) )
                 {
@@ -981,6 +999,15 @@
             }
         }    
     }
+
+//Ask client if it wants to change the search prority (i.e. to enable search for contact)
+void CIpsPlgSearch::ClientRequiredSearchPriority( TInt *apRequiredSearchPriority )
+	{
+	FUNC_LOG;
+	if ( iObserver )
+	  iObserver->ClientRequiredSearchPriority( apRequiredSearchPriority );
+	}
+
     
 // End of File