History

Don't display domain login status in title bar unless relevant

David Rowe committed 6 years ago

Commit 9bb5add1 parent c9c8e5f5 files · +105 −44Browse files

Showing the changes to libraries/networking/src/DomainHandler.cpp (1 of 5 files). Show all

Unified · Split

libraries/networking/src/DomainHandler.cpp+16−4
@@ -241,6 +241,8 @@ void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) { · 240 unmodified lines
241 }241 }
242 }242 }
243 243
244 DependencyManager::get<DomainAccountManager>()->setDomainURL(_domainURL);
245
244 emit domainURLChanged(_domainURL);246 emit domainURLChanged(_domainURL);
245 247
246 if (_sockAddr.getPort() != domainPort) {248 if (_sockAddr.getPort() != domainPort) {
@@ -584,18 +586,28 @@ void DomainHandler::processDomainServerConnectionDeniedPacket(QSharedPointer<Rec · 337 unmodified lines
584 accountManager->generateNewUserKeypair();586 accountManager->generateNewUserKeypair();
585 _connectionDenialsSinceKeypairRegen = 0;587 _connectionDenialsSinceKeypairRegen = 0;
586 }588 }
589
590 // Server with domain login will prompt for domain login, not metaverse, so reset domain values if asked for metaverse.
591 auto domainAccountManager = DependencyManager::get<DomainAccountManager>();
592 domainAccountManager->setAuthURL(QUrl());
593 domainAccountManager->setClientID(QString());
594
587 } else if (reasonSuggestsDomainLogin(reasonCode)) {595 } else if (reasonSuggestsDomainLogin(reasonCode)) {
588 qCWarning(networking) << "Make sure you are logged in to the domain.";596 qCWarning(networking) << "Make sure you are logged in to the domain.";
589 597
590 auto accountManager = DependencyManager::get<DomainAccountManager>();598 auto domainAccountManager = DependencyManager::get<DomainAccountManager>();
591 if (!extraInfo.isEmpty()) {599 if (!extraInfo.isEmpty()) {
592 auto extraInfoComponents = extraInfo.split("|");600 auto extraInfoComponents = extraInfo.split("|");
593 accountManager->setAuthURL(extraInfoComponents.value(0));601 domainAccountManager->setAuthURL(extraInfoComponents.value(0));
594 accountManager->setClientID(extraInfoComponents.value(1));602 domainAccountManager->setClientID(extraInfoComponents.value(1));
603 } else {
604 // Shouldn't occur, but just in case.
605 domainAccountManager->setAuthURL(QUrl());
606 domainAccountManager->setClientID(QString());
595 }607 }
596 608
597 if (!_hasCheckedForDomainAccessToken) {609 if (!_hasCheckedForDomainAccessToken) {
598 accountManager->checkAndSignalForAccessToken();610 domainAccountManager->checkAndSignalForAccessToken();
599 _hasCheckedForDomainAccessToken = true;611 _hasCheckedForDomainAccessToken = true;
600 }612 }
601 613