forked from blue/squawk
qt6 build
This commit is contained in:
parent
a04693e39d
commit
d4cec645b5
35 changed files with 279 additions and 632 deletions
|
@ -22,9 +22,7 @@
|
|||
#include <QDir>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#ifdef WITH_SIMPLE_CRYPT
|
||||
#include "external/simpleCrypt/simplecrypt.h"
|
||||
#endif
|
||||
#include "utils/jammer.h"
|
||||
|
||||
Core::Squawk::Squawk(QObject* parent):
|
||||
QObject(parent),
|
||||
|
@ -87,18 +85,14 @@ void Core::Squawk::stop() {
|
|||
password = acc->getPassword();
|
||||
break;
|
||||
case Shared::AccountPassword::jammed:
|
||||
#ifdef WITH_SIMPLE_CRYPT2
|
||||
password = SimpleCrypt(passwordHash).encryptToString(acc->getPassword());
|
||||
#else
|
||||
qDebug() << "The password for account" << acc->getName() << "is set to be jammed, but Squawk was compiled without SimpleCrypt support";
|
||||
qDebug("Can not encode password, setting this account to always ask password mode");
|
||||
ap = Shared::AccountPassword::alwaysAsk;
|
||||
#endif
|
||||
password = Jammer::encrypt(acc->getPassword(), passwordHash);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
qDebug() << "Saving password for" << acc->getName() << password;
|
||||
|
||||
settings.setValue("name", acc->getName());
|
||||
settings.setValue("server", acc->getServer());
|
||||
settings.setValue("login", acc->getLogin());
|
||||
|
@ -708,16 +702,8 @@ void Core::Squawk::readSettings() {
|
|||
|
||||
QString name = settings.value("name").toString();
|
||||
QString password = settings.value("password", "").toString();
|
||||
if (passwordType == Shared::AccountPassword::jammed) {
|
||||
#ifdef WITH_SIMPLE_CRYPT
|
||||
SimpleCrypt crypto(passwordHash);
|
||||
password = crypto.decryptToString(password);
|
||||
#else
|
||||
qDebug() << "The password for account" << name << "is jammed, but Squawk was compiled without SimpleCrypt support";
|
||||
qDebug("Can not decode password, setting this account to always ask password mode");
|
||||
passwordType = Shared::AccountPassword::alwaysAsk;
|
||||
#endif
|
||||
}
|
||||
if (passwordType == Shared::AccountPassword::jammed)
|
||||
password = Jammer::decrypt(password, passwordHash);
|
||||
|
||||
addAccount(
|
||||
settings.value("login").toString(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue