[recipes] Only use email portal version 2



commit 82ac00d4f0de810ff05c265ebd101899d5393472
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jul 11 20:15:24 2017 -0400

    Only use email portal version 2
    
    We are sending fds now, which only version 2 understands.

 src/gr-mail.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-mail.c b/src/gr-mail.c
index 2dce874..1aa47f6 100644
--- a/src/gr-mail.c
+++ b/src/gr-mail.c
@@ -121,8 +121,10 @@ static GDBusProxy *
 get_mail_portal_proxy (void)
 {
         static GDBusProxy *proxy = NULL;
+        g_autoptr(GVariant) prop = NULL;
+        guint32 version;
 
-        if (proxy == NULL)
+        if (proxy == NULL) {
                 proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
                                                        G_DBUS_PROXY_FLAGS_NONE,
                                                        NULL,
@@ -130,6 +132,12 @@ get_mail_portal_proxy (void)
                                                        "/org/freedesktop/portal/desktop",
                                                        "org.freedesktop.portal.Email",
                                                        NULL, NULL);
+        }
+
+        prop = g_dbus_proxy_get_cached_property (proxy, "version");
+        g_variant_get (prop, "u", &version);
+        if (version < 2)
+                return NULL;
 
         return proxy;
 }


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