Commit 3f0eaf4b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

BUG 442884: Fix DSN support

parent a2973cec
Pipeline #82500 passed with stage
in 7 minutes and 36 seconds
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(PIM_VERSION "5.18.40")
set(PIM_VERSION "5.18.41")
project(Akonadi-Mime VERSION ${PIM_VERSION})
# ECM setup
......
......@@ -18,19 +18,21 @@ using namespace Akonadi;
class AddressAttribute::Private
{
public:
bool mDSN = false;
QString mFrom;
QStringList mTo;
QStringList mCc;
QStringList mBcc;
};
AddressAttribute::AddressAttribute(const QString &from, const QStringList &to, const QStringList &cc, const QStringList &bcc)
AddressAttribute::AddressAttribute(const QString &from, const QStringList &to, const QStringList &cc, const QStringList &bcc, bool dsn)
: d(new Private)
{
d->mFrom = from;
d->mTo = to;
d->mCc = cc;
d->mBcc = bcc;
d->mDSN = dsn;
}
AddressAttribute::~AddressAttribute()
......@@ -40,7 +42,7 @@ AddressAttribute::~AddressAttribute()
AddressAttribute *AddressAttribute::clone() const
{
return new AddressAttribute(d->mFrom, d->mTo, d->mCc, d->mBcc);
return new AddressAttribute(d->mFrom, d->mTo, d->mCc, d->mBcc, d->mDSN);
}
QByteArray AddressAttribute::type() const
......@@ -58,6 +60,7 @@ QByteArray AddressAttribute::serialized() const
serializer << d->mTo;
serializer << d->mCc;
serializer << d->mBcc;
serializer << d->mDSN;
return serializedData;
}
......@@ -69,6 +72,9 @@ void AddressAttribute::deserialize(const QByteArray &data)
deserializer >> d->mTo;
deserializer >> d->mCc;
deserializer >> d->mBcc;
if (!deserializer.atEnd()) {
deserializer >> d->mDSN;
}
}
QString AddressAttribute::from() const
......@@ -111,6 +117,16 @@ void AddressAttribute::setBcc(const QStringList &bcc)
d->mBcc = bcc;
}
bool AddressAttribute::deliveryStatusNotification() const
{
return d->mDSN;
}
void AddressAttribute::setDeliveryStatusNotification(bool b)
{
d->mDSN = b;
}
// Register the attribute when the library is loaded.
namespace
{
......
......@@ -30,22 +30,23 @@ public:
explicit AddressAttribute(const QString &from = QString(),
const QStringList &to = QStringList(),
const QStringList &cc = QStringList(),
const QStringList &bcc = QStringList());
const QStringList &bcc = QStringList(),
bool dsn = false);
/**
Destroys the AddressAttribute.
*/
~AddressAttribute() override;
/* reimpl */
AddressAttribute *clone() const override;
QByteArray type() const override;
QByteArray serialized() const override;
Q_REQUIRED_RESULT AddressAttribute *clone() const override;
Q_REQUIRED_RESULT QByteArray type() const override;
Q_REQUIRED_RESULT QByteArray serialized() const override;
void deserialize(const QByteArray &data) override;
/**
Returns the address of the sender.
*/
QString from() const;
Q_REQUIRED_RESULT QString from() const;
/**
Sets the address of the sender.
......@@ -55,7 +56,7 @@ public:
/**
Returns the addresses of the "To:" receivers.
*/
QStringList to() const;
Q_REQUIRED_RESULT QStringList to() const;
/**
* Sets the addresses of the "To: "receivers."
......@@ -66,7 +67,7 @@ public:
/**
Returns the addresses of the "Cc:" receivers.
*/
QStringList cc() const;
Q_REQUIRED_RESULT QStringList cc() const;
/**
* Sets the addresses of the "Cc:" receivers."
......@@ -77,7 +78,7 @@ public:
/**
* Returns the addresses of the "Bcc:" receivers.
*/
QStringList bcc() const;
Q_REQUIRED_RESULT QStringList bcc() const;
/**
* Sets the addresses of the "Bcc:" receivers."
......@@ -85,6 +86,9 @@ public:
*/
void setBcc(const QStringList &bcc);
void setDeliveryStatusNotification(bool b);
Q_REQUIRED_RESULT bool deliveryStatusNotification() const;
private:
class Private;
Private *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