imservices/instantmessagingcache/imcacheserver/src/ccacheserveractivehelper.cpp
branchRCL_3
changeset 18 2ca0d29c17c4
parent 14 7797b2f86d2b
child 21 cfd5c2994f10
--- 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);