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

Use a struct for authentication result

parent c3de23bf
......@@ -80,12 +80,12 @@ QVector<DKIMCheckSignatureJob::CheckSignatureResult> DKIMAuthenticationStatusInf
|| infoResult == QLatin1String("permerror")) {
convertedResult.status = DKIMCheckSignatureJob::DKIMStatus::Invalid;
if (!info.reason.isEmpty()) {
convertedResult.errorStr = info.reason;
convertedResult.authenticationResult.errorStr = info.reason;
}
} else if (infoResult == QLatin1String("temperror")) {
convertedResult.status = DKIMCheckSignatureJob::DKIMStatus::Invalid;
if (!info.reason.isEmpty()) {
convertedResult.errorStr = info.reason;
convertedResult.authenticationResult.errorStr = info.reason;
}
} else {
qCWarning(MESSAGEVIEWER_DKIMCHECKER_LOG) << "Invalid result type " << infoResult;
......
......@@ -661,8 +661,7 @@ bool DKIMCheckSignatureJob::CheckSignatureResult::operator==(const DKIMCheckSign
&& fromEmail == other.fromEmail
&& auid == other.auid
&& sdid == other.sdid
&& errorStr == other.errorStr
&& methodStr == other.methodStr;
&& authenticationResult == other.authenticationResult;
}
bool DKIMCheckSignatureJob::CheckSignatureResult::operator!=(const DKIMCheckSignatureJob::CheckSignatureResult &other) const
......
......@@ -93,8 +93,15 @@ public:
QString sdid; //Signing Domain Identifier
QString auid; //DKIM MAY optionally provide a single responsible Agent or User Identifier (AUID).
QString fromEmail;
QString errorStr; //Use when we convert authentication result value
QString methodStr; //Use when we convert authentication method value : Use enum ?
struct AuthenticationResult {
QString errorStr; //Use when we convert authentication result value
QString methodStr; //Use when we convert authentication method value : Use enum ?
Q_REQUIRED_RESULT bool operator==(const AuthenticationResult &other) const {
return errorStr == other.errorStr && methodStr == other.methodStr;
}
};
AuthenticationResult authenticationResult;
};
explicit DKIMCheckSignatureJob(QObject *parent = nullptr);
......
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