[geary/mjog/598-sent-email-sound: 4/6] Geary.Smtp.ClientService: Pass a Geary.Email to sent-mail signal



commit 2e623a5b78fe5f0032c8a38ed72a91f122aa3344
Author: Michael Gratton <mike vee net>
Date:   Sat Mar 21 16:56:28 2020 +1100

    Geary.Smtp.ClientService: Pass a Geary.Email to sent-mail signal
    
    Pass and email object to sent-mail so that we have access to one when
    notifying plugings of mail being sent and not need to convert/impement
    the RFC833 message to a Plugin.Email object.

 src/client/application/application-controller.vala | 2 +-
 src/engine/smtp/smtp-client-service.vala           | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/client/application/application-controller.vala 
b/src/client/application/application-controller.vala
index 2be8537e..fd682c24 100644
--- a/src/client/application/application-controller.vala
+++ b/src/client/application/application-controller.vala
@@ -1456,7 +1456,7 @@ internal class Application.Controller : Geary.BaseObject {
     }
 
     private void on_sent(Geary.Smtp.ClientService service,
-                         Geary.RFC822.Message sent) {
+                         Geary.Email sent) {
         /// Translators: The label for an in-app notification. The
         /// string substitution is a list of recipients of the email.
         string message = _(
diff --git a/src/engine/smtp/smtp-client-service.vala b/src/engine/smtp/smtp-client-service.vala
index 70893b38..d3e022f6 100644
--- a/src/engine/smtp/smtp-client-service.vala
+++ b/src/engine/smtp/smtp-client-service.vala
@@ -42,7 +42,7 @@ public class Geary.Smtp.ClientService : Geary.ClientService {
     private Cancellable? queue_cancellable = null;
 
     /** Emitted when the manager has sent an email. */
-    public signal void email_sent(Geary.RFC822.Message rfc822);
+    public signal void email_sent(Geary.Email email);
 
     /** Emitted when an error occurred sending an email. */
     public signal void report_problem(Geary.ProblemReport problem);
@@ -252,6 +252,7 @@ public class Geary.Smtp.ClientService : Geary.ClientService {
             debug("Outbox postie: Sending \"%s\" (ID:%s)...",
                   email_subject(message), email.id.to_string());
             yield send_email_internal(message, cancellable);
+            email_sent(email);
 
             // Mark as sent, so if there's a problem pushing up to
             // Sent, we don't retry sending. Don't pass the
@@ -353,8 +354,6 @@ public class Geary.Smtp.ClientService : Geary.ClientService {
 
         if (smtp_err != null)
             throw smtp_err;
-
-        email_sent(rfc822);
     }
 
     private async void save_sent_mail(Geary.Email message,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]