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

Use enum here

parent 03b1edfa
......@@ -49,8 +49,7 @@ QVector<DKIMCheckSignatureJob::CheckSignatureResult> DKIMAuthenticationStatusInf
const QVector<DKIMAuthenticationStatusInfo::AuthStatusInfo> lstInfo = mStatusInfo.listAuthStatusInfo();
for (const DKIMAuthenticationStatusInfo::AuthStatusInfo &info : lstInfo) {
DKIMCheckSignatureJob::CheckSignatureResult convertedResult;
const QString &method = info.method;
convertedResult.authenticationResult.methodStr = method;
convertedResult.authenticationResult.method = MessageViewer::DKIMUtil::convertAuthenticationMethodToString(info.method);
const QString &infoResult = info.result;
if (infoResult == QLatin1String("none")) {
convertedResult.status = DKIMCheckSignatureJob::DKIMStatus::EmailNotSigned;
......
......@@ -684,12 +684,12 @@ QDebug operator <<(QDebug d, const DKIMCheckSignatureJob::CheckSignatureResult &
QDebug operator <<(QDebug d, const DKIMCheckSignatureJob::CheckSignatureResult::AuthenticationResult &t)
{
d << "method " << t.methodStr;
d << "method " << t.method;
d << "errorStr " << t.errorStr;
return d;
}
bool DKIMCheckSignatureJob::CheckSignatureResult::AuthenticationResult::operator==(const DKIMCheckSignatureJob::CheckSignatureResult::AuthenticationResult &other) const
{
return errorStr == other.errorStr && methodStr == other.methodStr;
return errorStr == other.errorStr && method == other.method;
}
......@@ -104,10 +104,10 @@ public:
QString auid; //DKIM MAY optionally provide a single responsible Agent or User Identifier (AUID).
QString fromEmail;
//Authentication result values.
struct AuthenticationResult {
QString errorStr;
QString methodStr; // Use enum ?
AuthenticationMethod method = AuthenticationMethod::Unknown;
Q_REQUIRED_RESULT bool operator==(const AuthenticationResult &other) const;
};
AuthenticationResult authenticationResult;
......
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