From d8becef1a1e36c8527f4e9bd1dcda9149158ce51 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 11 Jan 2018 11:49:59 +0100 Subject: Create thread for conversationview --- tests/teststore.cpp | 11 +++++++++++ views/conversation/main.qml | 32 +++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/tests/teststore.cpp b/tests/teststore.cpp index aafd56aa..817101be 100644 --- a/tests/teststore.cpp +++ b/tests/teststore.cpp @@ -77,6 +77,17 @@ static void createMail(const QVariantMap &object, const QByteArray &folder = {}) {}, {}, {}); + if (object.contains("messageId")) { + msg->messageID(true)->from7BitString(object["messageId"].toByteArray()); + } + if (object.contains("inReplyTo")) { + msg->inReplyTo(true)->from7BitString(object["inReplyTo"].toByteArray()); + } + if (object.contains("date")) { + msg->date(true)->setDateTime(QDateTime::fromString(object["date"].toString(), Qt::ISODate)); + } + + msg->assemble(); auto mail = ApplicationDomainType::createEntity(object["resource"].toByteArray()); mail.setMimeMessage(msg->encodedContent(true)); diff --git a/views/conversation/main.qml b/views/conversation/main.qml index 10c25706..06b59b42 100644 --- a/views/conversation/main.qml +++ b/views/conversation/main.qml @@ -56,13 +56,39 @@ ApplicationWindow { name: "Folder 1", mails: [{ resource: "resource1", - subject: "subject", + messageId: "", + date: "2017-07-24T15:46:29", + subject: "subject1", body: "body", to: ["to@example.org"], cc: ["cc@example.org"], bcc: ["bcc@example.org"], - draft: true - }] + }, + { + resource: "resource1", + inReplyTo: "", + date: "2017-07-24T16:46:29", + subject: "subject2", + body: "body2", + to: ["to@example.org"], + }, + { + resource: "resource1", + inReplyTo: "", + date: "2017-07-24T17:46:29", + subject: "subject3", + body: "body3\n\n\n\nfoo\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThe End", + to: ["to@example.org"], + }, + { + resource: "resource1", + inReplyTo: "", + date: "2017-07-24T18:46:29", + subject: "subject4", + body: "body4", + to: ["to@example.org"], + }, + ] }], } TestStore.setup(initialState) -- cgit v1.2.3