Commit 5a364af7 authored by Sandro Knauß's avatar Sandro Knauß 🐝
Browse files

Adopt messagelib DraftCryptoState.

parent 3e10b397
Pipeline #83616 failed with stage
in 1 minute and 46 seconds
......@@ -7,6 +7,7 @@
#include "sendlaterjob.h"
#include <MessageComposer/AkonadiSender>
#include <MessageComposer/DraftStatus>
#include <MessageComposer/SendLaterInfo>
#include <MessageComposer/Util>
#include <MessageCore/StringUtil>
......@@ -112,7 +113,7 @@ void SendLaterJob::slotJobFinished(KJob *job)
void SendLaterJob::updateAndCleanMessageBeforeSending(const KMime::Message::Ptr &msg)
{
msg->date()->setDateTime(QDateTime::currentDateTime());
MessageComposer::Util::removeNotNecessaryHeaders(msg);
MessageComposer::removeDraftCryptoHeaders(msg);
msg->assemble();
}
......
......@@ -96,6 +96,7 @@
#include <MessageComposer/ComposerLineEdit>
#include <MessageComposer/ComposerViewInterface>
#include <MessageComposer/ConvertSnippetVariablesJob>
#include <MessageComposer/DraftStatus>
#include <MessageComposer/FollowUpReminderSelectDateDialog>
#include <MessageComposer/FollowupReminder>
#include <MessageComposer/FollowupReminderCreateJob>
......@@ -1812,14 +1813,17 @@ void KMComposerWin::setMessage(const KMime::Message::Ptr &newMsg,
addFaceHeaders(ident, mMsg);
// if these headers are present, the state of the message should be overruled
if (auto hdr = mMsg->headerByType("X-KMail-SignatureActionEnabled")) {
mLastSignActionState = (hdr->as7BitString(false).contains("true"));
MessageComposer::DraftSignatureState signState(mMsg);
if (signState.isDefined()) {
mLastSignActionState = signState.signState();
}
if (auto hdr = mMsg->headerByType("X-KMail-EncryptActionEnabled")) {
mLastEncryptActionState = (hdr->as7BitString(false).contains("true"));
MessageComposer::DraftEncryptionState encState(mMsg);
if (encState.isDefined()) {
mLastEncryptActionState = encState.encryptionState();
}
if (auto hdr = mMsg->headerByType("X-KMail-CryptoMessageFormat")) {
mCryptoModuleAction->setCurrentItem(format2cb(static_cast<Kleo::CryptoMessageFormat>(hdr->asUnicodeString().toInt())));
MessageComposer::DraftCryptoMessageFormatState formatState(mMsg);
if (formatState.isDefined()) {
mCryptoModuleAction->setCurrentItem(format2cb(formatState.cryptoMessageFormatState()));
}
mLastIdentityHasSigningKey = !ident.pgpSigningKey().isEmpty() || !ident.smimeSigningKey().isEmpty();
......
Supports Markdown
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