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); } } }
void ConnectHandler::connectedEventHandlerThreadSafe(std::string imAccountId, EnumPresenceState::PresenceState initialPresenceState ) { if (_userProfile && !_freeze) { IMAccount * imAccount = _userProfile->getIMAccountManager().getIMAccount(imAccountId); if (imAccount) { imAccount->setConnected(true); imAccount->setPresenceState( initialPresenceState ); //VOXOX - JRT - 2009.09.10 //VOXOX - JRT - 2009.09.14 - We now set the initialPresence before we try to connect. ////TODO: VOXOX CHANGE by Rolando - 2009.05.22 - FIX this: check if each network associated supports invisible presence //if(_userProfile->mustLoginInvisible() && imAccount->getProtocol() != EnumIMProtocol::IMProtocolWengo && imAccount->getProtocol() != EnumIMProtocol::IMProtocolSIP) //{ // //VOXOX CHANGE by Rolando - 2009.05.22 - because user can login as invisible presence we have to change here the presence to be able to do change it // //TODO: Find a way to be able to change the presence to invisible before set connected the imaccount to "true" // //this is provocating that others users can realize that user logged in and later "logged off" // imAccount->setPresenceState(EnumPresenceState::PresenceStateInvisible); // _userProfile->setPresenceState(EnumPresenceState::PresenceStateInvisible, imAccountId);//VOXOX CHANGE by Rolando - 2009.05.15 //} EnumPresenceState::PresenceState presenceState = imAccount->getPresenceState();//VOXOX CHANGE by Rolando - 2009.07.15 EnumIMProtocol::IMProtocol imProtocol = imAccount->getProtocol();//VOXOX CHANGE by Rolando - 2009.07.15 _userProfile->updateIMAccount(*imAccount); _userProfile->requestSyncData(*imAccount); //VOXOX - JRT - 2009.08.03 OWSAFE_DELETE(imAccount); connectedEvent(*this, imAccountId);//VOXOX CHANGE by Rolando - 2009.05.15 //VOXOX CHANGE by Rolando - 2009.07.15 if( QtEnumIMProtocolMap::supportsPresence( imProtocol ) ) //VOXOX - JRT - 2009.08.28 - moved logic to QtEnumIMProtocol { _userProfile->setPresenceState(presenceState, imAccountId, false, String::null );//VOXOX CHANGE by Rolando - 2009.07.15 //VOXOX - JRT - 2009.09.14 } } } }