Merge pull request #53 from ymuv/v1.1

Add In-Reply-To field.
This commit is contained in:
Attila Tőkés 2017-06-01 20:10:33 +03:00 committed by GitHub
commit 7633337dd6
2 changed files with 13 additions and 0 deletions

View File

@ -106,6 +106,11 @@ void MimeMessage::addPart(MimePart *part)
}; };
} }
void MimeMessage::setInReplyTo(const QString& inReplyTo)
{
mInReplyTo = inReplyTo;
}
void MimeMessage::setHeaderEncoding(MimePart::Encoding hEnc) void MimeMessage::setHeaderEncoding(MimePart::Encoding hEnc)
{ {
this->hEncoding = hEnc; this->hEncoding = hEnc;
@ -252,6 +257,11 @@ QString MimeMessage::toString()
mime += "\r\n"; mime += "\r\n";
mime += "MIME-Version: 1.0\r\n"; mime += "MIME-Version: 1.0\r\n";
if (!mInReplyTo.isEmpty())
{
mime += "In-Reply-To: <" + mInReplyTo + ">\r\n";
mime += "References: <" + mInReplyTo + ">\r\n";
}
mime += QString("Date: %1\r\n").arg(QDateTime::currentDateTime().toString(Qt::RFC2822Date)); mime += QString("Date: %1\r\n").arg(QDateTime::currentDateTime().toString(Qt::RFC2822Date));
mime += content->toString(); mime += content->toString();

View File

@ -54,6 +54,8 @@ public:
void setSubject(const QString & subject); void setSubject(const QString & subject);
void addPart(MimePart* part); void addPart(MimePart* part);
void setInReplyTo(const QString& inReplyTo);
void setHeaderEncoding(MimePart::Encoding); void setHeaderEncoding(MimePart::Encoding);
const EmailAddress & getSender() const; const EmailAddress & getSender() const;
@ -79,6 +81,7 @@ protected:
EmailAddress* sender; EmailAddress* sender;
QList<EmailAddress*> recipientsTo, recipientsCc, recipientsBcc; QList<EmailAddress*> recipientsTo, recipientsCc, recipientsBcc;
QString subject; QString subject;
QString mInReplyTo;
MimePart *content; MimePart *content;
bool autoMimeContentCreated; bool autoMimeContentCreated;