aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-13 23:17:01 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-14 20:59:29 +0800
commitb61b45cfe0862f75d7d60708484a588bb54c9cae (patch)
tree2287ba32f473e693db7051f48d1af918ff95761f
parent5d54cdabd84b5425e36596426dec5025e09f7de5 (diff)
downloadgsoc2013-empathy-b61b45cfe0862f75d7d60708484a588bb54c9cae.tar
gsoc2013-empathy-b61b45cfe0862f75d7d60708484a588bb54c9cae.tar.gz
gsoc2013-empathy-b61b45cfe0862f75d7d60708484a588bb54c9cae.tar.bz2
gsoc2013-empathy-b61b45cfe0862f75d7d60708484a588bb54c9cae.tar.lz
gsoc2013-empathy-b61b45cfe0862f75d7d60708484a588bb54c9cae.tar.xz
gsoc2013-empathy-b61b45cfe0862f75d7d60708484a588bb54c9cae.tar.zst
gsoc2013-empathy-b61b45cfe0862f75d7d60708484a588bb54c9cae.zip
Use ContactCapabilities to get audio/video caps (#599163)
-rw-r--r--libempathy/empathy-tp-contact-factory.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index b8be403c6..ac5a7f2c4 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -755,11 +755,13 @@ update_contact_capabilities (EmpathyTpContactFactory *self,
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);
fixed_prop = g_value_get_boxed (g_value_array_get_nth (class_struct, 0));
+ allowed_prop = g_value_get_boxed (g_value_array_get_nth (class_struct, 1));
handle_type = tp_asv_get_uint32 (fixed_prop,
TP_IFACE_CHANNEL ".TargetHandleType", NULL);
@@ -772,8 +774,21 @@ update_contact_capabilities (EmpathyTpContactFactory *self,
if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER))
capabilities |= EMPATHY_CAPABILITIES_FT;
- if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE))
+ if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE)) {
capabilities |= EMPATHY_CAPABILITIES_STREAM_TUBE;
+ }
+ else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) {
+ guint j;
+
+ for (j = 0; allowed_prop[j] != NULL; j++) {
+ if (!tp_strdiff (allowed_prop[j],
+ TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio"))
+ capabilities |= EMPATHY_CAPABILITIES_AUDIO;
+ else if (!tp_strdiff (allowed_prop[j],
+ TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo"))
+ capabilities |= EMPATHY_CAPABILITIES_VIDEO;
+ }
+ }
}
DEBUG ("Changing capabilities for contact %s (%d) to %d",