forked from blue/squawk
actual pasword reasking on failed authentication
This commit is contained in:
parent
ce686e121b
commit
8f949277f6
13 changed files with 347 additions and 28 deletions
|
@ -43,6 +43,7 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
|||
reconnectTimer(new QTimer),
|
||||
network(p_net),
|
||||
passwordType(Shared::AccountPassword::plain),
|
||||
lastError(Error::none),
|
||||
pepSupport(false),
|
||||
active(p_active),
|
||||
notReadyPassword(false),
|
||||
|
@ -183,6 +184,7 @@ void Core::Account::onClientStateChange(QXmppClient::State st)
|
|||
dm->requestItems(getServer());
|
||||
dm->requestInfo(getServer());
|
||||
}
|
||||
lastError = Error::none;
|
||||
emit connectionStateChanged(state);
|
||||
}
|
||||
} else {
|
||||
|
@ -415,6 +417,7 @@ void Core::Account::onClientError(QXmppClient::Error err)
|
|||
qDebug() << "Error";
|
||||
QString errorText;
|
||||
QString errorType;
|
||||
lastError = Error::other;
|
||||
switch (err) {
|
||||
case QXmppClient::SocketError:
|
||||
errorText = client.socketErrorString();
|
||||
|
@ -456,6 +459,7 @@ void Core::Account::onClientError(QXmppClient::Error err)
|
|||
break;
|
||||
case QXmppStanza::Error::NotAuthorized:
|
||||
errorText = "Authentication error";
|
||||
lastError = Error::authentication;
|
||||
break;
|
||||
#if (QXMPP_VERSION) < QT_VERSION_CHECK(1, 3, 0)
|
||||
case QXmppStanza::Error::PaymentRequired:
|
||||
|
@ -750,3 +754,6 @@ void Core::Account::renameContactRequest(const QString& jid, const QString& newN
|
|||
void Core::Account::invalidatePassword() {
|
||||
notReadyPassword = true;}
|
||||
|
||||
Core::Account::Error Core::Account::getLastError() const {
|
||||
return lastError;}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue