Exemplo n.º 1
0
void ConnectHandler::disconnectedEventHandlerThreadSafe(std::string imAccountId, bool connectionError, std::string reason, bool fatal)	//VOXOX - JRT - 2009.07.13 
{
	if (_userProfile && !_freeze)	//VOXOX - JRT - 2009.07.11 - potential crash fix.
	{
		IMAccount * imAccount = _userProfile->getIMAccountManager().getIMAccount(imAccountId);
		if (imAccount) 
		{
			LOG_INFO( "Disconnect Reason: " + reason + ", " + imAccountId );

			imAccount->setConnected(false);

			//Some reasons indicate we should not automatically retry.	//VOXOX - JRT - 2009.07.05 
//			bool retry = QtEnumIMProtocolMap::shouldRetryConnect( imAccount->getQtProtocol(), reason );
			imAccount->setAutoReconnect( !fatal );

			_userProfile->updateIMAccount(*imAccount);
			OWSAFE_DELETE(imAccount);
			disconnectedEvent(*this, imAccountId, connectionError, reason);
		}
	}
}
Exemplo n.º 2
0
void PhApiIMConnect::disconnectedEventHandler(PhApiWrapper & sender, bool connectionError, const std::string & reason) {
	disconnectedEvent(*this, connectionError, reason, false );//VOXOX - JRT - 2009.07.13 - TODO: Do we need 'fatal' parameter for this?
}