imstutils/imconversationview/imcvuiengine/src/cimcvenginecchhandler.cpp
branchRCL_3
changeset 34 e7f34e614544
parent 29 9a48e301e94b
equal deleted inserted replaced
32:ffa4311257f6 34:e7f34e614544
    59 		
    59 		
    60 		if( service )
    60 		if( service )
    61 			{
    61 			{
    62 			service->SetObserver( *this );		
    62 			service->SetObserver( *this );		
    63 			}
    63 			}
    64 		}
    64 		}		
    65 	iPrevNwError = 0;
       
    66 		
    65 		
    67     }
    66     }
    68 
    67 
    69 // ---------------------------------------------------------------------------
    68 // ---------------------------------------------------------------------------
    70 // CIMCVEngineCchHandler::NewL
    69 // CIMCVEngineCchHandler::NewL
   279 				const TCCHSubserviceType aType,
   278 				const TCCHSubserviceType aType,
   280 				const TCchServiceStatus& aServiceStatus )
   279 				const TCchServiceStatus& aServiceStatus )
   281 	{
   280 	{
   282 	
   281 	
   283     IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ") );   
   282     IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ") );   
   284     IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL:TCCHSubserviceType=%d"),aType);
   283 
   285     IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL:aServiceStatus.Error()=%d"),aServiceStatus.Error());
       
   286 	if (aType == ECCHPresenceSub)
   284 	if (aType == ECCHPresenceSub)
   287 		{
   285 		{
   288 		/* SIP Adaptation -- sends error in Network Lost. This is added so that once we get it, we will unbindL and delete the context
   286 		/* SIP Adaptation -- sends error in Network Lost. This is added so that once we get it, we will unbindL and delete the context
   289 		 * This happens only in case of SIP as it does not send the event in IM Subservice.
   287 		 * This happens only in case of SIP as it does not send the event in IM Subservice.
   290 		 */
   288 		 */
   305 				//Nothing to be done			
   303 				//Nothing to be done			
   306 				break;	
   304 				break;	
   307 				}
   305 				}
   308 			case ECCHDisabled:
   306 			case ECCHDisabled:
   309 				{
   307 				{
   310 				IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL DISABLED"));
   308 				IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL DISABLED"));   
   311 				if(iPrevNwError != KCCHErrorNetworkLost)
   309 				iEngine.CloseAllOpenChatsL ();
   312 					{
       
   313 					iEngine.CloseAllOpenChatsL ();					
       
   314 					}
       
   315 				iEngine.ReleaseConnectionL();
   310 				iEngine.ReleaseConnectionL();
   316 				iEngine.DeleteContextL ();
   311 				iEngine.DeleteContextL ();
       
   312 
   317 				break;	
   313 				break;	
   318 				}
   314 				}
   319 			case ECCHConnecting:
   315 			case ECCHConnecting:
   320 				{
   316 				{
   321 				IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ECCHConnecting") );
       
   322 				iPrevNwError = aServiceStatus.Error();
       
   323 				notifyEvent = MIMCVEngineCCHObserver::EConnecting;
   317 				notifyEvent = MIMCVEngineCCHObserver::EConnecting;
   324 				break;	
   318 				break;	
   325 				}
   319 				}
   326 			case ECCHEnabled:
   320 			case ECCHEnabled:
   327 				{
   321 				{
   328 				IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ECCHEnabled") );
       
   329 				notifyEvent = MIMCVEngineCCHObserver::ELogin;
   322 				notifyEvent = MIMCVEngineCCHObserver::ELogin;
   330 				iEngine.CreateContextL();
   323 				iEngine.CreateContextL();
   331 				break;	
   324 				break;	
   332 				}
   325 				}
   333 			case ECCHDisconnecting:
   326 			case ECCHDisconnecting:
   334 				{
   327 				{
   335 				// If NetworkErrorLost error is received by CCH on this state, then do not close all chats
   328 				// If NetworkErrorLost error is received by CCH on this state, then do not close all chats
   336 				// as user would loose all the on-going conversation when the network connection is
   329 				// as user would loose all the on-going conversation when the network connection is
   337 				// restored.
   330 				// restored.				
   338 				IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ECCHDisconnecting") );				
   331 				if (aServiceStatus.Error () != KCCHErrorNetworkLost )
   339 //				if (aServiceStatus.Error () != KCCHErrorNetworkLost )
   332 				   {
   340 //				   {
   333 					iEngine.CloseAllOpenChatsL();
   341 //					iEngine.CloseAllOpenChatsL();
   334 					iEngine.ReleaseConnectionL ();
   342 //					iEngine.ReleaseConnectionL ();
   335 					iEngine.DeleteContextL ();
   343 //					iEngine.DeleteContextL ();
   336 				   }
   344 //				   }
       
   345 				notifyEvent = MIMCVEngineCCHObserver::EDisconnecting;
   337 				notifyEvent = MIMCVEngineCCHObserver::EDisconnecting;
   346 				break;	
   338 				break;	
   347 				}
   339 				}
   348 			default:
   340 			default:
   349 				{
   341 				{