imservices/instantmessagingcache/imcacheclient/src/cimcacheeventhandler.cpp
changeset 1 b610b446cb01
parent 0 e6b17d312c8b
child 12 a152385bb39d
equal deleted inserted replaced
0:e6b17d312c8b 1:b610b446cb01
   140 		    TRACE( T_LIT("CIMCacheEventHandler::RunL() default") );
   140 		    TRACE( T_LIT("CIMCacheEventHandler::RunL() default") );
   141 		    break;	
   141 		    break;	
   142 		    }
   142 		    }
   143 		}	
   143 		}	
   144 		
   144 		
       
   145 	// Comment: cancel operation is changes as synchronous. iContinueObserving from event
       
   146 	// can not really be trusted since complete code might be different if leave has occured 
       
   147 	// for example. Cancel is handled here as generic cancel.
   145 	TRACE( T_LIT("CIMCacheEventHandler::RunL() iContinueObserving iContinueObserving = %d") ,iContinueObserving);
   148 	TRACE( T_LIT("CIMCacheEventHandler::RunL() iContinueObserving iContinueObserving = %d") ,iContinueObserving);
   146 	// check need to continue observing to server
   149 	// check need to continue observing to server
   147 	if( iContinueObserving )
   150 	if( iContinueObserving && KErrCancel != iStatus.Int() )
   148 		{
   151 		{
   149 		iRegistrar.RegisterObserverToServerL( iStatus ,EIMCacheObserveMessageUpdateRegister );
   152 		iRegistrar.RegisterObserverToServerL( iStatus ,EIMCacheObserveMessageUpdateRegister );
   150 		SetActive();
   153 		SetActive();
   151 		}
   154 		}
   152 	TRACE( T_LIT("CIMCacheEventHandler::RunL() end") );
   155 	TRACE( T_LIT("CIMCacheEventHandler::RunL() end") );
   156 // -----------------------------------------------------------------------------
   159 // -----------------------------------------------------------------------------
   157 //	
   160 //	
   158 void CIMCacheEventHandler::DoCancel()
   161 void CIMCacheEventHandler::DoCancel()
   159 	{
   162 	{
   160 	TRACE( T_LIT("CIMCacheEventHandler::DoCancel() ") );
   163 	TRACE( T_LIT("CIMCacheEventHandler::DoCancel() ") );
       
   164 	// Comment: set to EFalse here since we can not trust other changes. See
       
   165 	// comments in RunL
       
   166 	iContinueObserving = EFalse;
   161 	if( IsActive() )
   167 	if( IsActive() )
   162         {
   168         {
   163         TRAP_IGNORE(iRegistrar.CancelRequestL( iStatus ,EIMCacheCancelRequest ));
   169         TRAP_IGNORE(iRegistrar.CancelRequestL( iStatus ,EIMCacheCancelRequest ));
   164         }
   170         }
   165 	}
   171 	}