Merge pull request #15617 from Atlante45/fix/logout-reset

BUGZ-320: Fix nodelist reset on logout/username change
This commit is contained in:
Shannon Romano 2019-05-22 17:31:41 -07:00 committed by GitHub
commit bc4a88beb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,10 +91,10 @@ NodeList::NodeList(char newOwnerType, int socketListenPort, int dtlsListenPort)
connect(accountManager.data(), &AccountManager::newKeypair, this, &NodeList::sendDomainServerCheckIn);
// clear out NodeList when login is finished and we know our new username
connect(accountManager.data(), SIGNAL(usernameChanged(QString)) , this, SLOT(reset()));
connect(accountManager.data(), &AccountManager::usernameChanged , this, [this]{ reset("Username changed"); });
// clear our NodeList when logout is requested
connect(accountManager.data(), SIGNAL(logoutComplete()) , this, SLOT(reset()));
connect(accountManager.data(), &AccountManager::logoutComplete , this, [this]{ reset("Logged out"); });
// anytime we get a new node we will want to attempt to punch to it
connect(this, &LimitedNodeList::nodeAdded, this, &NodeList::startNodeHolePunch);