]> git.0d.be Git - empathy.git/commitdiff
event-manager: use empathy_sasl_channel_supports_mechanism()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 11 Sep 2012 12:03:58 +0000 (14:03 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 11 Sep 2012 13:10:43 +0000 (15:10 +0200)
There is no point re-implementing it.

src/empathy-event-manager.c

index c4d2e09a9b30bc89387b00ccad21476202c3ac9f..7e34f4ce6b0851f82d6d128576a3dde135039e15 100644 (file)
@@ -34,6 +34,7 @@
 #include <libempathy/empathy-tp-chat.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy/empathy-gsettings.h>
+#include <libempathy/empathy-sasl-mechanisms.h>
 
 #include <extensions/extensions.h>
 
@@ -966,15 +967,7 @@ approve_sasl_channel (EmpathyEventManager *self,
     TpAddDispatchOperationContext *context,
     TpChannel *channel)
 {
-  GHashTable *props;
-  const gchar * const *available_mechanisms;
-
-  props = tp_channel_borrow_immutable_properties (channel);
-  available_mechanisms = tp_asv_get_boxed (props,
-      TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AVAILABLE_MECHANISMS,
-      G_TYPE_STRV);
-
-  if (tp_strv_contains (available_mechanisms, "X-TELEPATHY-PASSWORD"))
+  if (empathy_sasl_channel_supports_mechanism (channel, "X-TELEPATHY-PASSWORD"))
     {
       event_manager_add (approval->manager, account, NULL,
           EMPATHY_EVENT_TYPE_AUTH,