summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-15 18:41:42 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-15 18:41:42 +0100
commitd40710eb005cde8c6962d6f5689bc63a4745b1c1 (patch)
tree349d956f114072764a992afe67aaa7c54038fc63 /examples
parent52047ca6d72957dd36c13e1cd93453a7c48e4b17 (diff)
downloadsink-d40710eb005cde8c6962d6f5689bc63a4745b1c1.tar.gz
sink-d40710eb005cde8c6962d6f5689bc63a4745b1c1.zip
Preparation to get useful notifications to Kube
Diffstat (limited to 'examples')
-rw-r--r--examples/mailtransportresource/mailtransportresource.cpp11
1 files changed, 11 insertions, 0 deletions
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:
81 } 81 }
82 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)) {
83 SinkWarning() << "Failed to send message: " << mail; 83 SinkWarning() << "Failed to send message: " << mail;
84 //Emit failure notification
85 Sink::Notification n;
86 n.type = Notification::Warning;
87 n.message = "Failed to send message.";
88 emit notify(n);
84 return KAsync::error("Failed to send the message."); 89 return KAsync::error("Failed to send the message.");
90 } else {
91 //Emit success notification
92 Sink::Notification n;
93 n.type = Notification::Info;
94 n.message = "Message successfully sent.";
95 emit notify(n);
85 } 96 }
86 } 97 }
87 syncStore().writeValue(mail.identifier(), "sent"); 98 syncStore().writeValue(mail.identifier(), "sent");