account removal bugfix, some testing

This commit is contained in:
Blue 2022-04-13 22:02:48 +03:00
parent f64e5c2df0
commit ce686e121b
Signed by: blue
GPG key ID: 9B203B252A63EE38
3 changed files with 17 additions and 6 deletions

View file

@ -139,8 +139,10 @@ void Core::Squawk::addAccount(
bool active,
Shared::AccountPassword passwordType)
{
QSettings settings;
if (amap.count(name) > 0) {
qDebug() << "An attempt to add account" << name << "but an account with such name already exist, ignoring";
return;
}
Account* acc = new Account(login, server, password, name, active, &network);
acc->setResource(resource);
acc->setPasswordType(passwordType);
@ -198,8 +200,10 @@ void Core::Squawk::addAccount(
switch (passwordType) {
case Shared::AccountPassword::alwaysAsk:
case Shared::AccountPassword::kwallet:
acc->invalidatePassword();
break;
if (password == "") {
acc->invalidatePassword();
break;
}
default:
break;
}