summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-11-03 15:44:02 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-11-03 15:49:10 (GMT)
commit5f6a1d085e0be03f350812f1ce6e5699645e1e5e (patch)
tree6d14cff6b00824cac599941ead8e74b176f651bd
parent77f30c7471ce4f79e106cc91e8789c8c621fd1b7 (diff)
MailDispatcher: honor the new silent flag on SentBehaviourAttribute
-rw-r--r--CMakeLists.txt2
-rw-r--r--agents/maildispatcher/maildispatcheragent.cpp12
2 files changed, 12 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba8fab6..b641a87 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,7 @@ set(AKONADI_VERSION "5.3.42")
set(KCONTACTS_LIB_VERSION "5.3.40")
set(KCALENDARCORE_LIB_VERSION "5.3.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.3.40")
-set(KMAILTRANSPORT_LIB_VERSION "5.3.40")
+set(KMAILTRANSPORT_LIB_VERSION "5.3.42")
set(CALENDARUTILS_LIB_VERSION "5.3.40")
set(KIMAP_LIB_VERSION "5.3.41")
set(KMBOX_LIB_VERSION "5.3.40")
diff --git a/agents/maildispatcher/maildispatcheragent.cpp b/agents/maildispatcher/maildispatcheragent.cpp
index 65b17bb..7fa4e3e 100644
--- a/agents/maildispatcher/maildispatcheragent.cpp
+++ b/agents/maildispatcher/maildispatcheragent.cpp
@@ -31,6 +31,7 @@
#include <kdbusconnectionpool.h>
#include <itemfetchscope.h>
#include <mailtransport/sentactionattribute.h>
+#include <mailtransport/sentbehaviourattribute.h>
#include <knotifyconfigwidget.h>
#include "maildispatcher_debug.h"
@@ -60,6 +61,7 @@ public:
sendingInProgress(false),
sentAnything(false),
errorOccurred(false),
+ showSentNotifcation(true),
sentItemsSize(0),
sentActionHandler(Q_NULLPTR)
{
@@ -78,6 +80,7 @@ public:
bool sendingInProgress;
bool sentAnything;
bool errorOccurred;
+ bool showSentNotifcation;
qulonglong sentItemsSize;
SentActionHandler *sentActionHandler;
@@ -152,13 +155,14 @@ void MailDispatcherAgent::Private::dispatch()
Q_EMIT q->percent(100);
Q_EMIT q->status(AgentBase::Idle, i18n("Finished sending messages."));
- if (!errorOccurred) {
+ if (!errorOccurred && showSentNotifcation) {
KNotification *notify = new KNotification(QStringLiteral("emailsent"));
notify->setComponentName(QStringLiteral("akonadi_maildispatcher_agent"));
notify->setTitle(i18nc("Notification title when email was sent", "E-Mail Successfully Sent"));
notify->setText(i18nc("Notification when the email was sent", "Your E-Mail has been sent successfully."));
notify->sendEvent();
}
+ showSentNotifcation = true;
} else {
// Empty queue.
Q_EMIT q->status(AgentBase::Idle, i18n("No items in queue."));
@@ -339,6 +343,12 @@ void MailDispatcherAgent::Private::sendResult(KJob *job)
sentActionHandler->runAction(action);
}
}
+ const auto bhAttribute = sentItem.attribute<MailTransport::SentBehaviourAttribute>();
+ if (bhAttribute) {
+ showSentNotifcation = !bhAttribute->sendSilently();
+ } else {
+ showSentNotifcation = true;
+ }
}
// dispatch next message