]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-sasl-mechanisms.c
Reorder header inclusions accordingly to the Telepathy coding style
[empathy.git] / libempathy / empathy-sasl-mechanisms.c
index b900fa5da0546afd3cb95dea65d20aa9780e23ee..a6829c4504adc508316fcd3fc30c0a8d6f7872f4 100644 (file)
  */
 
 #include "config.h"
+#include "empathy-sasl-mechanisms.h"
 
 #include <libsoup/soup.h>
-#include <string.h>
 
 #define DEBUG_FLAG EMPATHY_DEBUG_SASL
 #include "empathy-debug.h"
 #include "empathy-utils.h"
-#include "empathy-sasl-mechanisms.h"
 
 #define MECH_FACEBOOK "X-FACEBOOK-PLATFORM"
 #define MECH_WLM "X-MESSENGER-OAUTH2"
@@ -344,15 +343,22 @@ gboolean
 empathy_sasl_channel_supports_mechanism (TpChannel *channel,
     const gchar *mechanism)
 {
-  GHashTable *props;
-  const gchar * const *available_mechanisms;
+  GVariant *props;
+  GStrv available_mechanisms;
+  gboolean result;
+
+  props = tp_channel_dup_immutable_properties (channel);
 
-  props = tp_channel_borrow_immutable_properties (channel);
-  available_mechanisms = tp_asv_get_boxed (props,
+  g_variant_lookup (props,
       TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AVAILABLE_MECHANISMS,
-      G_TYPE_STRV);
+      "^as", &available_mechanisms);
 
-  return tp_strv_contains (available_mechanisms, mechanism);
+  result = tp_strv_contains ((const gchar * const *) available_mechanisms,
+      mechanism);
+
+  g_variant_unref (props);
+  g_strfreev (available_mechanisms);
+  return result;
 }
 
 EmpathySaslMechanism