[empathy] use tp_capabilities_supports_sms()



commit 049ba20e4c1579faaf999089a4a97674e3816a50
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Apr 10 17:04:45 2012 +0200

    use tp_capabilities_supports_sms()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673846

 libempathy/empathy-contact.c |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)
---
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index b741210..97a49d1 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -1696,8 +1696,6 @@ static EmpathyCapabilities
 tp_caps_to_capabilities (TpCapabilities *caps)
 {
   EmpathyCapabilities capabilities = 0;
-  guint i;
-  GPtrArray *classes;
 
   if (tp_capabilities_supports_file_transfer (caps))
     capabilities |= EMPATHY_CAPABILITIES_FT;
@@ -1716,36 +1714,8 @@ tp_caps_to_capabilities (TpCapabilities *caps)
       capabilities |= EMPATHY_CAPABILITIES_AUDIO;
     }
 
-  classes = tp_capabilities_get_channel_classes (caps);
-
-  for (i = 0; i < classes->len; i++)
-    {
-      GValueArray *class_struct;
-      GHashTable *fixed_prop;
-      GStrv allowed_prop;
-      TpHandleType handle_type;
-      const gchar *chan_type;
-
-      class_struct = g_ptr_array_index (classes, i);
-      tp_value_array_unpack (class_struct, 2,
-          &fixed_prop,
-          &allowed_prop);
-
-      handle_type = tp_asv_get_uint32 (fixed_prop,
-          TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL);
-      if (handle_type != TP_HANDLE_TYPE_CONTACT)
-        continue;
-
-      chan_type = tp_asv_get_string (fixed_prop,
-          TP_PROP_CHANNEL_CHANNEL_TYPE);
-
-      if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_TEXT))
-        {
-          if (tp_asv_get_boolean (fixed_prop,
-                TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, NULL))
-            capabilities |= EMPATHY_CAPABILITIES_SMS;
-        }
-    }
+  if (tp_capabilities_supports_sms (caps))
+    capabilities |= EMPATHY_CAPABILITIES_SMS;
 
   return capabilities;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]