From d40710eb005cde8c6962d6f5689bc63a4745b1c1 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 15 Mar 2017 18:41:42 +0100 Subject: Preparation to get useful notifications to Kube --- examples/mailtransportresource/mailtransportresource.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'examples') diff --git a/examples/mailtransportresource/mailtransportresource.cpp b/examples/mailtransportresource/mailtransportresource.cpp index fa7eba4..cd7f4a7 100644 --- a/examples/mailtransportresource/mailtransportresource.cpp +++ b/examples/mailtransportresource/mailtransportresource.cpp @@ -81,7 +81,18 @@ public: } if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), settings.password.toUtf8(), settings.cacert.toUtf8(), options)) { SinkWarning() << "Failed to send message: " << mail; + //Emit failure notification + Sink::Notification n; + n.type = Notification::Warning; + n.message = "Failed to send message."; + emit notify(n); return KAsync::error("Failed to send the message."); + } else { + //Emit success notification + Sink::Notification n; + n.type = Notification::Info; + n.message = "Message successfully sent."; + emit notify(n); } } syncStore().writeValue(mail.identifier(), "sent"); -- cgit v1.2.3