Prevent logging into the same account twice

Check if an account is already logged in before allow the login process to continue.

BUG:459603
This commit is contained in:
James Graham
2022-11-07 18:26:47 +00:00
parent 364ce45668
commit 5bd184b297
3 changed files with 23 additions and 1 deletions

View File

@@ -3,6 +3,12 @@
#include "login.h"
#ifdef QUOTIENT_07
#include <accountregistry.h>
#else
#include "neochataccountregistry.h"
#endif
#include <connection.h>
#include <qt_connection_util.h>
@@ -39,6 +45,12 @@ void Login::init()
return;
}
m_isLoggedIn = AccountRegistry::instance().isLoggedIn(m_matrixId);
Q_EMIT isLoggedInChanged();
if (m_isLoggedIn) {
return;
}
m_testing = true;
Q_EMIT testingChanged();
if (!m_connection) {
@@ -181,3 +193,8 @@ bool Login::isLoggingIn() const
{
return m_isLoggingIn;
}
bool Login::isLoggedIn() const
{
return m_isLoggedIn;
}