]> git.0d.be Git - empathy.git/commitdiff
Recognize Call channel capabilities
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Wed, 23 Feb 2011 11:12:07 +0000 (11:12 +0000)
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Thu, 9 Jun 2011 09:20:06 +0000 (10:20 +0100)
libempathy/empathy-contact.c

index 831be25fcb19a17f21503c9b51c3ccc584900b53..6cdb3b6d99f3279f07cdcbe462cc98dd28ce838a 100644 (file)
@@ -28,6 +28,7 @@
 #include <telepathy-glib/account-manager.h>
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/util.h>
+#include <telepathy-yell/telepathy-yell.h>
 
 #include <telepathy-logger/log-manager.h>
 
@@ -1750,6 +1751,29 @@ tp_caps_to_capabilities (TpCapabilities *caps)
                 TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, NULL))
             capabilities |= EMPATHY_CAPABILITIES_SMS;
         }
+      else if (!tp_strdiff (chan_type,
+        TPY_IFACE_CHANNEL_TYPE_CALL))
+        {
+          guint j;
+
+          if (tp_asv_get_boolean (fixed_prop,
+              TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL))
+            capabilities |= EMPATHY_CAPABILITIES_AUDIO;
+
+          if (tp_asv_get_boolean (fixed_prop,
+              TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL))
+            capabilities |= EMPATHY_CAPABILITIES_VIDEO;
+
+          for (j = 0; allowed_prop[j] != NULL; j++)
+            {
+              if (!tp_strdiff (allowed_prop[j],
+                    TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO))
+                capabilities |= EMPATHY_CAPABILITIES_AUDIO;
+              else if (!tp_strdiff (allowed_prop[j],
+                    TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO))
+                capabilities |= EMPATHY_CAPABILITIES_VIDEO;
+            }
+        }
     }
 
   return capabilities;