Revision: 201023 RCL_3 PDK_3.0.1
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 16:01:18 +0300
branchRCL_3
changeset 18 2ca0d29c17c4
parent 16 cfe5eb8bb9ca
child 20 eedf17a17c27
Revision: 201023 Kit: 2010125
imservices/instantmessagingcache/imcacheserver/src/ccacheserveractivehelper.cpp
imservices/instantmessagingcache/imcacheserver/src/cimcachesession.cpp
--- a/imservices/instantmessagingcache/imcacheserver/src/ccacheserveractivehelper.cpp	Wed Jun 09 10:02:05 2010 +0300
+++ b/imservices/instantmessagingcache/imcacheserver/src/ccacheserveractivehelper.cpp	Mon Jun 21 16:01:18 2010 +0300
@@ -226,21 +226,31 @@
 		}
 	// if there are no unread messages then reset the status pane indicator.
 	TInt unreadCount = 0;
+	TInt currentContactUnReadCount = 0;
     TInt headerCount = iHeaderArray.Count();
+    TInt id = 0;
     for( TInt i=0; i< headerCount; i++ )
         {
         // note in this case reciepient is own user id 
         MIMCacheMessageHeader* header = iHeaderArray[i];
         if( header->ServiceId() == sericeId )   
             {
-            unreadCount = unreadCount + header->UnreadMessageCount();   
+			if(buddyId->Compare(iHeaderArray[i]->BuddyId()) == 0)
+				{
+				currentContactUnReadCount = header->UnreadMessageCount();
+				}
+            if(header->UnreadMessageCount()) 
+               	{
+				id = i;
+            	}
+            
             }
         }
-    //BugFix:ESLM-83TF7K: Unread messages are not updated to universal indicator.
-//    if(!unreadCount)
-//        {
-        PublishMessageInfoL(*buddyId,sericeId);
-//        }
+    
+    if(!currentContactUnReadCount)
+        {
+		PublishMessageInfoL(iHeaderArray[id]->BuddyId(),sericeId);
+        }
     
 	CleanupStack::PopAndDestroy(buddyId);
 	
--- a/imservices/instantmessagingcache/imcacheserver/src/cimcachesession.cpp	Wed Jun 09 10:02:05 2010 +0300
+++ b/imservices/instantmessagingcache/imcacheserver/src/cimcachesession.cpp	Mon Jun 21 16:01:18 2010 +0300
@@ -241,7 +241,14 @@
 			if( iPacketsArray.Count() )
 				{
 				CIMCacheBufferArray* packet = iPacketsArray[ 0 ] ;
-				iObserverMessage.Complete( packet->OperationCode() );
+				if( packet->OperationCode() ==  EIMOperationFetchAll )
+					{
+					iObserverMessage.Complete( EIMOperationDataAvailable );
+					}
+				else
+					{
+					iObserverMessage.Complete( packet->OperationCode() );
+					}
 				iObserverActive = EFalse;
 				}
 			
@@ -278,7 +285,14 @@
 			 if( iPacketsArray.Count() )
 				{
 				CIMCacheBufferArray* packet = iPacketsArray[ 0 ] ;
-				iObserverMessage.Complete( packet->OperationCode() );
+				if( packet->OperationCode() ==  EIMOperationFetchAll )
+					{
+					iObserverMessage.Complete( EIMOperationUnreadChange );
+					}
+				else
+					{
+					iObserverMessage.Complete( packet->OperationCode() );
+					}
 				iObserverActive = EFalse;
 				}
 	     	break;