imservices/instantmessagingcache/imcacheserver/src/ccacheserveractivehelper.cpp
branchRCL_3
changeset 13 b6f2a363adf7
parent 12 e1ad3c803639
child 14 7797b2f86d2b
equal deleted inserted replaced
12:e1ad3c803639 13:b6f2a363adf7
   234         if( header->ServiceId() == sericeId )   
   234         if( header->ServiceId() == sericeId )   
   235             {
   235             {
   236             unreadCount = unreadCount + header->UnreadMessageCount();   
   236             unreadCount = unreadCount + header->UnreadMessageCount();   
   237             }
   237             }
   238         }
   238         }
   239     if(!unreadCount)
   239     //BugFix:ESLM-83TF7K: Unread messages are not updated to universal indicator.
   240         {
   240 //    if(!unreadCount)
       
   241 //        {
   241         PublishMessageInfoL(*buddyId,sericeId);
   242         PublishMessageInfoL(*buddyId,sericeId);
   242         }
   243 //        }
   243     
   244     
   244 	CleanupStack::PopAndDestroy(buddyId);
   245 	CleanupStack::PopAndDestroy(buddyId);
   245 	
   246 	
   246     TRACE( T_LIT( "CCacheServerActiveHelper::StartNewConversationL	end") );
   247     TRACE( T_LIT( "CCacheServerActiveHelper::StartNewConversationL	end") );
   247 	}
   248 	}
   451             }
   452             }
   452         // there are new messages received form only one party.
   453         // there are new messages received form only one party.
   453         // hence the buddyid is required as conversation view will be openend.
   454         // hence the buddyid is required as conversation view will be openend.
   454         if(KErrNone == headerIndex)
   455         if(KErrNone == headerIndex)
   455             {
   456             {
   456             PublishMessageInfoL(iHeaderArray[headerIndex]->BuddyId(), sericeId);
   457             PublishMessageInfoL(iHeaderArray[headerIndex]->BuddyId(), sericeId, ETrue);
   457             }
   458             }
   458         // new messages are recieved from multiple parties, hence no need of the sender id
   459         // new messages are recieved from multiple parties, hence no need of the sender id
   459         // as the service tab will be opened.
   460         // as the service tab will be opened.
   460         else
   461         else
   461             {
   462             {
   462             PublishMessageInfoL(KNullDesC(), sericeId);
   463             PublishMessageInfoL(KNullDesC(), sericeId,ETrue);
   463             }
   464             }
   464 		PackAndNotifyEventL( EIMOperationChatDeleted, sericeId, msgHeader, NULL ); 
   465 		PackAndNotifyEventL( EIMOperationChatDeleted, sericeId, msgHeader, NULL ); 
   465 		 
   466 		 
   466         delete msgHeader;
   467         delete msgHeader;
   467         iHeaderArray.Compress();  
   468         iHeaderArray.Compress();  
   499         }
   500         }
   500     if( needToNotify )
   501     if( needToNotify )
   501         {
   502         {
   502         // remove the universal indicator notification if there it was displayed,
   503         // remove the universal indicator notification if there it was displayed,
   503         // as when you logout all the ocnversations are removed.
   504         // as when you logout all the ocnversations are removed.
   504         PublishMessageInfoL(KNullDesC(), aServiceId);
   505         PublishMessageInfoL(KNullDesC(), aServiceId, ETrue);
   505         
   506         
   506         PackAndNotifyEventL( EIMOperationAllChatDeleted, aServiceId, NULL, NULL ); 
   507         PackAndNotifyEventL( EIMOperationAllChatDeleted, aServiceId, NULL, NULL ); 
   507         }
   508         }
   508     TRACE( T_LIT( "CCacheServerActiveHelper::CloseAllConversationL  End") );
   509     TRACE( T_LIT( "CCacheServerActiveHelper::CloseAllConversationL  End") );
   509     }
   510     }
   654 // -----------------------------------------------------------------------------
   655 // -----------------------------------------------------------------------------
   655 // CCacheServerActiveHelper::PublishMessageInfoL()
   656 // CCacheServerActiveHelper::PublishMessageInfoL()
   656 // name of history data
   657 // name of history data
   657 // -----------------------------------------------------------------------------
   658 // -----------------------------------------------------------------------------
   658 //
   659 //
   659 void  CCacheServerActiveHelper::PublishMessageInfoL(const TDesC& aSenderId,TInt aServiceId )
   660 void  CCacheServerActiveHelper::PublishMessageInfoL(const TDesC& aSenderId,TInt aServiceId, 
       
   661                                                     TBool aCloseConversation /*= EFalse*/ )
   660     {
   662     {
   661     // set/reset  the status pane indicator here
   663     // set/reset  the status pane indicator here
   662     // based on the unread count.
   664     // based on the unread count.
   663     // as we need to show the indicator only for the received messages
   665     // as we need to show the indicator only for the received messages
   664     TInt unreadCount = 0;
   666     TInt unreadCount = 0;
   684     // the next command handler. If none of the plugins leave, there will
   686     // the next command handler. If none of the plugins leave, there will
   685     // be only one TRAP used.
   687     // be only one TRAP used.
   686     for ( TInt index = 0; index < count; ++index )
   688     for ( TInt index = 0; index < count; ++index )
   687         {
   689         {
   688         //trap is required if one plugin leaves then it should continue with other plugins.
   690         //trap is required if one plugin leaves then it should continue with other plugins.
   689         TRAP_IGNORE(iPluginInfo[index]->Plugin().MessageInfoL(unreadCount,aServiceId,aSenderId,multipleSender));
   691         TRAP_IGNORE(iPluginInfo[index]->Plugin().MessageInfoL(unreadCount,aServiceId,aSenderId,multipleSender,aCloseConversation));
   690         }
   692         }
   691     }
   693     }
   692  // -----------------------------------------------------------------------------
   694  // -----------------------------------------------------------------------------
   693  // CCacheServerActiveHelper::LoadPluginL
   695  // CCacheServerActiveHelper::LoadPluginL
   694  // -----------------------------------------------------------------------------
   696  // -----------------------------------------------------------------------------