Commit 819c3e02 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Recipient: allow storing GPG key and crypto status per recipient

parent 06884f23
......@@ -34,13 +34,15 @@ class MessageComposer::RecipientPrivate
public:
RecipientPrivate(const QString &email, Recipient::Type type)
: mEmail(email),
mEncryptionAction(Kleo::Impossible),
mType(type)
{
}
QString mEmail;
QString mName;
Kleo::Action mEncryptionAction;
GpgME::Key mKey;
MessageComposer::Recipient::Type mType;
};
......@@ -134,3 +136,23 @@ QStringList Recipient::allTypeLabels()
types.append(typeLabel(Bcc));
return types;
}
GpgME::Key Recipient::key() const
{
return d->mKey;
}
void Recipient::setKey(const GpgME::Key &key)
{
d->mKey = key;
}
Kleo::Action MessageComposer::Recipient::encryptionAction() const
{
return d->mEncryptionAction;
}
void MessageComposer::Recipient::setEncryptionAction(const Kleo::Action action)
{
d->mEncryptionAction = action;
}
......@@ -29,6 +29,9 @@
#include <Libkdepim/MultiplyingLine>
#include <gpgme++/key.h>
#include <libkleo/enum.h>
#include <QString>
#include <QSharedPointer>
namespace MessageComposer
......@@ -65,6 +68,12 @@ public:
static QString typeLabel(Type type);
static QStringList allTypeLabels();
void setEncryptionAction(const Kleo::Action action);
Kleo::Action encryptionAction() const;
void setKey(const GpgME::Key &key);
GpgME::Key key() const;
private:
RecipientPrivate *const d;
};
......
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