[geary/mjog/notfication-avatars: 5/6] Plugin.DesktopNotification: try harder to show contact details



commit ff02a13edcae9da7bae609f680f84707dc5b81a9
Author: Michael Gratton <mike vee net>
Date:   Fri Mar 13 08:03:54 2020 +1100

    Plugin.DesktopNotification: try harder to show contact details
    
    Show an individual's contact details even when there are multiple new
    messages.

 .../desktop-notifications.vala                     | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/client/plugin/desktop-notifications/desktop-notifications.vala 
b/src/client/plugin/desktop-notifications/desktop-notifications.vala
index 25f2f689..a37ec922 100644
--- a/src/client/plugin/desktop-notifications/desktop-notifications.vala
+++ b/src/client/plugin/desktop-notifications/desktop-notifications.vala
@@ -232,21 +232,21 @@ public class Plugin.DesktopNotifications :
             // present and it can be loaded, otherwise notify
             // generally
             bool notified = false;
-            if (this.email != null &&
-                added.size == 1) {
-                try {
-                    Email? message = Geary.Collection.first(
-                        yield this.email.get_email(added, this.cancellable)
-                    );
-                    if (message != null) {
-                        yield notify_specific_message(folder, total, message);
-                        notified = true;
-                    } else {
-                        warning("Could not load email for notification");
-                    }
-                } catch (GLib.Error error) {
-                    warning("Error loading email for notification: %s", error.message);
+            try {
+                Email? message = Geary.Collection.first(
+                    yield this.email.get_email(
+                        Geary.Collection.single(Geary.Collection.first(added)),
+                        this.cancellable
+                    )
+                );
+                if (message != null) {
+                    yield notify_specific_message(folder, total, message);
+                    notified = true;
+                } else {
+                    warning("Could not load email for notification");
                 }
+            } catch (GLib.Error error) {
+                warning("Error loading email for notification: %s", error.message);
             }
 
             if (!notified) {


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