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
241241 }
242242 }
243243
244+ DependencyManager::get<DomainAccountManager>()->setDomainURL(_domainURL);
245+
244246 emit domainURLChanged(_domainURL);
245247
246248 if (_sockAddr.getPort() != domainPort) {
@@ -584,18 +586,28 @@ void DomainHandler::processDomainServerConnectionDeniedPacket(QSharedPointer<Rec · 337 unmodified lines
584586 accountManager->generateNewUserKeypair();
585587 _connectionDenialsSinceKeypairRegen = 0;
586588 }
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+
587595 } else if (reasonSuggestsDomainLogin(reasonCode)) {
588596 qCWarning(networking) << "Make sure you are logged in to the domain.";
589597
590− auto accountManager = DependencyManager::get<DomainAccountManager>();
598+ auto domainAccountManager = DependencyManager::get<DomainAccountManager>();
591599 if (!extraInfo.isEmpty()) {
592600 auto extraInfoComponents = extraInfo.split("|");
593− accountManager->setAuthURL(extraInfoComponents.value(0));
594− accountManager->setClientID(extraInfoComponents.value(1));
601+ domainAccountManager->setAuthURL(extraInfoComponents.value(0));
602+ domainAccountManager->setClientID(extraInfoComponents.value(1));
603+ } else {
604+ // Shouldn't occur, but just in case.
605+ domainAccountManager->setAuthURL(QUrl());
606+ domainAccountManager->setClientID(QString());
595607 }
596608
597609 if (!_hasCheckedForDomainAccessToken) {
598− accountManager->checkAndSignalForAccessToken();
610+ domainAccountManager->checkAndSignalForAccessToken();
599611 _hasCheckedForDomainAccessToken = true;
600612 }
601613