Commit 82ac00d4 authored by Matthias Clasen's avatar Matthias Clasen

Only use email portal version 2

We are sending fds now, which only version 2 understands.
parent 278a6d77
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment