imservices/instantmessagingcache/imcacheclient/src/cimcacheaccesseventhandler.cpp
changeset 1 b610b446cb01
parent 0 e6b17d312c8b
child 12 a152385bb39d
--- a/imservices/instantmessagingcache/imcacheclient/src/cimcacheaccesseventhandler.cpp	Thu Dec 17 08:54:49 2009 +0200
+++ b/imservices/instantmessagingcache/imcacheclient/src/cimcacheaccesseventhandler.cpp	Thu Jan 07 12:56:16 2010 +0200
@@ -133,8 +133,11 @@
 		}	
 
 	TRACE( T_LIT("CIMCacheAccessEventHandler::RunL() iContinueObserving iContinueObserving = %d") ,iContinueObserving);
+		// Comment: cancel operation is changes as synchronous. iContinueObserving from event
+	// can not really be trusted since complete code might be different if leave has occured 
+	// for example. Cancel is handled here as generic cancel.
 	// check need to continue observing to server
-	if( iContinueObserving )
+	if( iContinueObserving && KErrCancel != iStatus.Int() )
 		{
 		iRegistrar.RegisterObserverToServerL( iStatus ,EIMCacheObserveMessageAccessRegister );
 		SetActive();
@@ -148,6 +151,9 @@
 void CIMCacheAccessEventHandler::DoCancel()
 	{
 	TRACE( T_LIT("CIMCacheAccessEventHandler::DoCancel() ") );
+		// Comment: set to EFalse here since we can not trust other changes. See
+	// comments in RunL
+	iContinueObserving = EFalse;
 	if( IsActive() )
         {
         TRAP_IGNORE(iRegistrar.CancelRequestL( iStatus ,EIMCacheCancelRequest ));