After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 579813 - Use capabilities from TpContact
Use capabilities from TpContact
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
empathy-maint
: 564409 (view as bug list)
Depends on: 599163
Blocks:
 
 
Reported: 2009-04-22 09:54 UTC by Xavier Claessens
Modified: 2010-04-27 07:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/contact-caps-579813 (17.10 KB, patch)
2010-04-16 11:31 UTC, Guillaume Desmottes
reviewed Details | Review

Description Xavier Claessens 2009-04-22 09:54:17 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
Comment 1 Guillaume Desmottes 2009-04-28 12:28:04 UTC
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.
Comment 2 Xavier Claessens 2009-05-09 15:25:24 UTC
*** Bug 564409 has been marked as a duplicate of this bug. ***
Comment 3 Guillaume Desmottes 2009-10-21 10:43:25 UTC
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 ).
Comment 4 Guillaume Desmottes 2009-10-21 10:58:30 UTC
We want to use ContactCapability for FT caps as well (bug #599164).
Comment 5 Guillaume Desmottes 2010-04-16 11:31:06 UTC
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(-)
Comment 6 Guillaume Desmottes 2010-04-16 11:32:22 UTC
We should wait that tp-glib 0.11.3 is actually released before merging this.
Comment 7 Danielle Madeley 2010-04-21 07:39:09 UTC
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
Comment 8 Guillaume Desmottes 2010-04-21 08:37:33 UTC
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
Comment 9 Guillaume Desmottes 2010-04-27 07:55:10 UTC
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.