aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-server-tls-handler.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-09-11 20:10:22 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-09-11 21:10:43 +0800
commit8fe7c7a2348dcfc1f7833eb84264e9437d5795e8 (patch)
treec9a3c1f8b710f760e70595e64a01a32792e5861a /libempathy/empathy-server-tls-handler.c
parent9a0c691c865b369438ef789638f33fd21aab0551 (diff)
downloadgsoc2013-empathy-8fe7c7a2348dcfc1f7833eb84264e9437d5795e8.tar
gsoc2013-empathy-8fe7c7a2348dcfc1f7833eb84264e9437d5795e8.tar.gz
gsoc2013-empathy-8fe7c7a2348dcfc1f7833eb84264e9437d5795e8.tar.bz2
gsoc2013-empathy-8fe7c7a2348dcfc1f7833eb84264e9437d5795e8.tar.lz
gsoc2013-empathy-8fe7c7a2348dcfc1f7833eb84264e9437d5795e8.tar.xz
gsoc2013-empathy-8fe7c7a2348dcfc1f7833eb84264e9437d5795e8.tar.zst
gsoc2013-empathy-8fe7c7a2348dcfc1f7833eb84264e9437d5795e8.zip
use tp_channel_dup_immutable_properties()
tp_channel_borrow_immutable_properties() has been deprecated.
Diffstat (limited to 'libempathy/empathy-server-tls-handler.c')
-rw-r--r--libempathy/empathy-server-tls-handler.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/libempathy/empathy-server-tls-handler.c b/libempathy/empathy-server-tls-handler.c
index dd3e7bb78..14ab1aba7 100644
--- a/libempathy/empathy-server-tls-handler.c
+++ b/libempathy/empathy-server-tls-handler.c
@@ -95,10 +95,8 @@ tls_handler_init_async (GAsyncInitable *initable,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GHashTable *properties;
+ GVariant *properties;
const gchar *cert_object_path;
- const gchar *hostname;
- const gchar * const *identities;
const gchar *bus_name;
GError *error = NULL;
GQuark features[] = { TP_TLS_CERTIFICATE_FEATURE_CORE, 0 };
@@ -114,42 +112,44 @@ tls_handler_init_async (GAsyncInitable *initable,
priv->async_init_res = g_simple_async_result_new (G_OBJECT (self),
callback, user_data, empathy_server_tls_handler_new_async);
- properties = tp_channel_borrow_immutable_properties (priv->channel);
+ properties = tp_channel_dup_immutable_properties (priv->channel);
- hostname = tp_asv_get_string (properties,
- TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_HOSTNAME);
- priv->hostname = g_strdup (hostname);
+ g_variant_lookup (properties,
+ TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_HOSTNAME,
+ "s", &priv->hostname);
- DEBUG ("Received hostname: %s", hostname);
+ DEBUG ("Received hostname: %s", priv->hostname);
- identities = tp_asv_get_strv (properties,
- TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_REFERENCE_IDENTITIES);
+ g_variant_lookup (properties,
+ TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_REFERENCE_IDENTITIES,
+ "^as", &priv->reference_identities);
/*
* If the channel doesn't implement the ReferenceIdentities parameter
* then fallback to the hostname.
*/
- if (identities == NULL)
+ if (priv->reference_identities == NULL)
{
- default_identities[0] = (gchar *) hostname;
+ default_identities[0] = (gchar *) priv->hostname;
default_identities[1] = NULL;
- identities = (const gchar **) default_identities;
+ priv->reference_identities = g_strdupv (default_identities);
}
else
{
#ifdef ENABLE_DEBUG
- gchar *output = g_strjoinv (", ", (gchar **) identities);
+ gchar *output = g_strjoinv (", ", (gchar **) priv->reference_identities);
DEBUG ("Received reference identities: %s", output);
g_free (output);
#endif /* ENABLE_DEBUG */
}
- priv->reference_identities = g_strdupv ((gchar **) identities);
-
- cert_object_path = tp_asv_get_object_path (properties,
- EMP_IFACE_CHANNEL_TYPE_SERVER_TLS_CONNECTION ".ServerCertificate");
+ g_variant_lookup (properties,
+ EMP_IFACE_CHANNEL_TYPE_SERVER_TLS_CONNECTION ".ServerCertificate",
+ "&s", &cert_object_path);
bus_name = tp_proxy_get_bus_name (TP_PROXY (priv->channel));
+ g_variant_unref (properties);
+
DEBUG ("Creating an TpTLSCertificate for path %s, bus name %s",
cert_object_path, bus_name);