diff options
Diffstat (limited to 'framework/src')
-rw-r--r-- | framework/src/domain/mime/partmodel.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/framework/src/domain/mime/partmodel.cpp b/framework/src/domain/mime/partmodel.cpp index c363da33..4c53906d 100644 --- a/framework/src/domain/mime/partmodel.cpp +++ b/framework/src/domain/mime/partmodel.cpp | |||
@@ -94,6 +94,7 @@ QHash<int, QByteArray> PartModel::roleNames() const | |||
94 | roles[IsErrorRole] = "error"; | 94 | roles[IsErrorRole] = "error"; |
95 | roles[SenderRole] = "sender"; | 95 | roles[SenderRole] = "sender"; |
96 | roles[SignatureDetails] = "signatureDetails"; | 96 | roles[SignatureDetails] = "signatureDetails"; |
97 | roles[EncryptionDetails] = "encryptionDetails"; | ||
97 | roles[DateRole] = "date"; | 98 | roles[DateRole] = "date"; |
98 | return roles; | 99 | return roles; |
99 | } | 100 | } |
@@ -139,6 +140,18 @@ static QString addCss(const QString &s) | |||
139 | return header + s + QStringLiteral("</body></html>"); | 140 | return header + s + QStringLiteral("</body></html>"); |
140 | } | 141 | } |
141 | 142 | ||
143 | SignatureInfo *encryptionInfo(MimeTreeParser::MessagePart *messagePart) | ||
144 | { | ||
145 | auto signatureInfo = new SignatureInfo; | ||
146 | const auto encryptions = messagePart->encryptions(); | ||
147 | if (encryptions.size() > 1) { | ||
148 | qWarning() << "Can't deal with more than one encryption"; | ||
149 | } | ||
150 | for (const auto &p : encryptions) { | ||
151 | signatureInfo->keyId = p->partMetaData()->keyId; | ||
152 | } | ||
153 | return signatureInfo; | ||
154 | }; | ||
142 | 155 | ||
143 | SignatureInfo *signatureInfo(MimeTreeParser::MessagePart *messagePart) | 156 | SignatureInfo *signatureInfo(MimeTreeParser::MessagePart *messagePart) |
144 | { | 157 | { |
@@ -266,6 +279,8 @@ QVariant PartModel::data(const QModelIndex &index, int role) const | |||
266 | } | 279 | } |
267 | case SignatureDetails: | 280 | case SignatureDetails: |
268 | return QVariant::fromValue(signatureInfo(messagePart)); | 281 | return QVariant::fromValue(signatureInfo(messagePart)); |
282 | case EncryptionDetails: | ||
283 | return QVariant::fromValue(encryptionInfo(messagePart)); | ||
269 | case ErrorType: | 284 | case ErrorType: |
270 | return messagePart->error(); | 285 | return messagePart->error(); |
271 | case ErrorString: { | 286 | case ErrorString: { |