GNOME Bugzilla – Bug 579813
Use capabilities from TpContact
Last modified: 2010-04-27 07:55:10 UTC
We should get contact capabilities from TpContact. Unfortunately that's not yet implemented in tp-glib so we have our own implementation for now. telepathy-glib bug: https://bugs.freedesktop.org/show_bug.cgi?id=21332
Note that fixing this bug will remove the tp_cli_connection_interface_capabilities_run_get_capabilities () in tp_contact_factory_add_contact which is one of the latest _run_ calls.
*** Bug 564409 has been marked as a duplicate of this bug. ***
We should use ContactCapability for that (bug #599163). Note that TpContact doesn't support it yet ( https://bugs.freedesktop.org/show_bug.cgi?id=21332 ).
We want to use ContactCapability for FT caps as well (bug #599164).
Created attachment 158886 [details] [review] http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/contact-caps-579813 configure.ac | 2 +- libempathy/empathy-contact.c | 82 ++++++++ libempathy/empathy-tp-contact-factory.c | 340 +------------------------------ 3 files changed, 84 insertions(+), 340 deletions(-)
We should wait that tp-glib 0.11.3 is actually released before merging this.
Review of attachment 158886 [details] [review]: I wonder if shimming this is the correct approach. Regardless... ::: libempathy/empathy-contact.c @@ +1416,3 @@ + 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)); Use tp_value_array_unpack() @@ +1419,3 @@ + + handle_type = tp_asv_get_uint32 (fixed_prop, + TP_IFACE_CHANNEL ".TargetHandleType", NULL); TP_PROP_CHANNEL_TARGET_HANDLE_TYPE @@ +1424,3 @@ + + chan_type = tp_asv_get_string (fixed_prop, + TP_IFACE_CHANNEL ".ChannelType"); TP_PROP_CHANNEL_CHANNEL_TYPE @@ +1439,3 @@ + guint j; + + for (j = 0; allowed_prop[j] != NULL; j++) { { should be on next line? @@ +1441,3 @@ + for (j = 0; allowed_prop[j] != NULL; j++) { + if (!tp_strdiff (allowed_prop[j], + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio")) TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO @@ +1444,3 @@ + capabilities |= EMPATHY_CAPABILITIES_AUDIO; + else if (!tp_strdiff (allowed_prop[j], + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo")) TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO
Review of attachment 158886 [details] [review]: ::: libempathy/empathy-contact.c @@ +1416,3 @@ + 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)); done. @@ +1419,3 @@ + + handle_type = tp_asv_get_uint32 (fixed_prop, + TP_IFACE_CHANNEL ".TargetHandleType", NULL); done. @@ +1424,3 @@ + + chan_type = tp_asv_get_string (fixed_prop, + TP_IFACE_CHANNEL ".ChannelType"); done @@ +1439,3 @@ + guint j; + + for (j = 0; allowed_prop[j] != NULL; j++) { indeed; fixed. @@ +1441,3 @@ + for (j = 0; allowed_prop[j] != NULL; j++) { + if (!tp_strdiff (allowed_prop[j], + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio")) done. @@ +1444,3 @@ + capabilities |= EMPATHY_CAPABILITIES_AUDIO; + else if (!tp_strdiff (allowed_prop[j], + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo")) done
Merged to master. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.