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