]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-server-tls-handler.c
Updated Oriya translation
[empathy.git] / libempathy / empathy-server-tls-handler.c
index dd3e7bb78f15711cd6785517496fdaa5cd8d352a..f5f60d649176c52fa74f3135f09b1153d43e399a 100644 (file)
  */
 
 #include "config.h"
-
 #include "empathy-server-tls-handler.h"
 
-#define DEBUG_FLAG EMPATHY_DEBUG_TLS
-#include "empathy-debug.h"
+#include <telepathy-glib/telepathy-glib-dbus.h>
+
 #include "empathy-utils.h"
 
-#include "extensions/extensions.h"
+#define DEBUG_FLAG EMPATHY_DEBUG_TLS
+#include "empathy-debug.h"
 
 static void async_initable_iface_init (GAsyncInitableIface *iface);
 
@@ -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,40 +112,40 @@ 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,
+      TP_IFACE_CHANNEL_TYPE_SERVER_TLS_CONNECTION ".ServerCertificate",
+      "&o", &cert_object_path);
   bus_name = tp_proxy_get_bus_name (TP_PROXY (priv->channel));
 
   DEBUG ("Creating an TpTLSCertificate for path %s, bus name %s",
@@ -156,6 +154,8 @@ tls_handler_init_async (GAsyncInitable *initable,
   priv->certificate = tp_tls_certificate_new (TP_PROXY (priv->channel),
       cert_object_path, &error);
 
+  g_variant_unref (properties);
+
   if (error != NULL)
     {
       DEBUG ("Unable to create the TpTLSCertificate: error %s",