diff options
-rw-r--r-- | common/synchronizer.cpp | 2 | ||||
-rw-r--r-- | examples/mailtransportresource/mailtransportresource.cpp | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index e004d64..900c6d5 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp | |||
@@ -341,7 +341,7 @@ KAsync::Job<void> Synchronizer::processRequest(const SyncRequest &request) | |||
341 | }).then<void>([this, request](const KAsync::Error &error) { | 341 | }).then<void>([this, request](const KAsync::Error &error) { |
342 | if (error) { | 342 | if (error) { |
343 | //Emit notification with error | 343 | //Emit notification with error |
344 | SinkWarningCtx(mLogCtx) << "Synchronization failed: " << error.errorMessage; | 344 | SinkWarningCtx(mLogCtx) << "Synchronization failed: " << error; |
345 | if (error.errorCode == ApplicationDomain::ConnectionError) { | 345 | if (error.errorCode == ApplicationDomain::ConnectionError) { |
346 | emitNotification(Notification::Status, ApplicationDomain::OfflineStatus, "Synchronization has ended.", request.requestId); | 346 | emitNotification(Notification::Status, ApplicationDomain::OfflineStatus, "Synchronization has ended.", request.requestId); |
347 | } else { | 347 | } else { |
diff --git a/examples/mailtransportresource/mailtransportresource.cpp b/examples/mailtransportresource/mailtransportresource.cpp index 673fae4..f215643 100644 --- a/examples/mailtransportresource/mailtransportresource.cpp +++ b/examples/mailtransportresource/mailtransportresource.cpp | |||
@@ -59,6 +59,7 @@ public: | |||
59 | SinkLog() << "Mail is already sent: " << mail.identifier(); | 59 | SinkLog() << "Mail is already sent: " << mail.identifier(); |
60 | return KAsync::null(); | 60 | return KAsync::null(); |
61 | } | 61 | } |
62 | emitNotification(Notification::Info, ApplicationDomain::SyncInProgress, "Sending message.", {}, {mail.identifier()}); | ||
62 | const auto data = mail.getMimeMessage(); | 63 | const auto data = mail.getMimeMessage(); |
63 | auto msg = KMime::Message::Ptr::create(); | 64 | auto msg = KMime::Message::Ptr::create(); |
64 | msg->setHead(KMime::CRLFtoLF(data)); | 65 | msg->setHead(KMime::CRLFtoLF(data)); |
@@ -80,10 +81,12 @@ public: | |||
80 | } | 81 | } |
81 | if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), settings.password.toUtf8(), settings.cacert.toUtf8(), options)) { | 82 | if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), settings.password.toUtf8(), settings.cacert.toUtf8(), options)) { |
82 | SinkWarning() << "Failed to send message: " << mail; | 83 | SinkWarning() << "Failed to send message: " << mail; |
83 | emitNotification(Notification::Warning, ApplicationDomain::TransmissionError, "Failed to send message."); | 84 | emitNotification(Notification::Warning, ApplicationDomain::SyncError, "Failed to send message.", {}, {mail.identifier()}); |
85 | emitNotification(Notification::Warning, ApplicationDomain::TransmissionError, "Failed to send message.", {}, {mail.identifier()}); | ||
84 | return KAsync::error("Failed to send the message."); | 86 | return KAsync::error("Failed to send the message."); |
85 | } else { | 87 | } else { |
86 | emitNotification(Notification::Info, ApplicationDomain::TransmissionSuccess, "Message successfully sent."); | 88 | emitNotification(Notification::Info, ApplicationDomain::SyncSuccess, "Message successfully sent.", {}, {mail.identifier()}); |
89 | emitNotification(Notification::Info, ApplicationDomain::TransmissionSuccess, "Message successfully sent.", {}, {mail.identifier()}); | ||
87 | } | 90 | } |
88 | } | 91 | } |
89 | syncStore().writeValue(mail.identifier(), "sent"); | 92 | syncStore().writeValue(mail.identifier(), "sent"); |