aboutsummaryrefslogtreecommitdiff
path: root/lib/accountregistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/accountregistry.cpp')
-rw-r--r--lib/accountregistry.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/accountregistry.cpp b/lib/accountregistry.cpp
index f25369d6..2cab54a3 100644
--- a/lib/accountregistry.cpp
+++ b/lib/accountregistry.cpp
@@ -100,20 +100,29 @@ void AccountRegistry::invokeLogin()
AccountSettings account { accountId };
auto connection = new Connection(account.homeserver());
connect(connection, &Connection::connected, this,
- [connection] {
+ [connection, this, accountId] {
connection->loadState();
connection->setLazyLoading(true);
connection->syncLoop();
+
+ m_accountsLoading.removeAll(accountId);
+ emit accountsLoadingChanged();
});
connect(connection, &Connection::loginError, this,
- [this, connection](const QString& error,
+ [this, connection, accountId](const QString& error,
const QString& details) {
emit loginError(connection, error, details);
+
+ m_accountsLoading.removeAll(accountId);
+ emit accountsLoadingChanged();
});
connect(connection, &Connection::resolveError, this,
- [this, connection](const QString& error) {
+ [this, connection, accountId](const QString& error) {
emit resolveError(connection, error);
+
+ m_accountsLoading.removeAll(accountId);
+ emit accountsLoadingChanged();
});
connection->assumeIdentity(
account.userId(), accessTokenLoadingJob->binaryData(),