Commit efb12fbe authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to update value

parent a62f6b8c
Pipeline #53400 canceled with stage
......@@ -199,6 +199,7 @@ void DKIMCheckSignatureJob::start()
downloadKey(mDkimInfo);
} else {
parseDKIMKeyRecord(keyValue, mDkimInfo.domain(), mDkimInfo.selector(), false);
MessageViewer::DKIMManagerKey::self()->updateLastUsed(mDkimInfo.domain(), mDkimInfo.selector());
}
} else {
downloadKey(mDkimInfo);
......
......@@ -40,6 +40,18 @@ QString DKIMManagerKey::keyValue(const QString &selector, const QString &domain)
return {};
}
void DKIMManagerKey::updateLastUsed(const QString &selector, const QString &domain)
{
for (const KeyInfo &keyInfo : qAsConst(mKeys)) {
if (keyInfo.selector == selector && keyInfo.domain == domain) {
KeyInfo newKey = keyInfo;
newKey.lastUsedDateTime = QDateTime::currentDateTime();
addKey(newKey);
return;
}
}
}
void DKIMManagerKey::addKey(const KeyInfo &key)
{
const QVector<KeyInfo> keys = mKeys;
......
......@@ -70,6 +70,8 @@ public:
void saveKeys();
Q_REQUIRED_RESULT QString keyValue(const QString &selector, const QString &domain);
void updateLastUsed(const QString &selector, const QString &domain);
private:
Q_REQUIRED_RESULT QStringList keyRecorderList(KSharedConfig::Ptr &config) const;
QVector<KeyInfo> mKeys;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment