summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2012-04-12 07:35:06 (GMT)
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-04-12 07:38:43 (GMT)
commitd7f7b26aeb4d15bb9be8ad838118c564f7e68d3b (patch)
tree7af1fb669af8062a975fc9182875c36d93691d80
parentdc4db1e73d5fbc1e1419691c9347f9f1bc59e311 (diff)
downloadtelepathy-ssh-contact-d7f7b26aeb4d15bb9be8ad838118c564f7e68d3b.tar.gz
telepathy-ssh-contact-d7f7b26aeb4d15bb9be8ad838118c564f7e68d3b.tar.xz
Use tp_capabilities_supports_stream_tubes()
-rw-r--r--src/client-helpers.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/client-helpers.c b/src/client-helpers.c
index 6fa5df3..a4b08ff 100644
--- a/src/client-helpers.c
+++ b/src/client-helpers.c
@@ -296,34 +296,9 @@ _client_create_exec_args (GSocket *socket,
gboolean
_capabilities_has_stream_tube (TpCapabilities *caps)
{
- GPtrArray *classes;
- guint i;
-
if (caps == NULL)
return FALSE;
- classes = tp_capabilities_get_channel_classes (caps);
- for (i = 0; i < classes->len; i++)
- {
- GValueArray *arr = g_ptr_array_index (classes, i);
- GHashTable *fixed;
- const gchar *chan_type;
- const gchar *service;
- TpHandleType handle_type;
-
- fixed = g_value_get_boxed (g_value_array_get_nth (arr, 0));
- chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE);
- service = tp_asv_get_string (fixed,
- TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE);
- handle_type = tp_asv_get_uint32 (fixed,
- TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL);
-
- if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE) &&
- handle_type == TP_HANDLE_TYPE_CONTACT &&
- (!tp_capabilities_is_specific_to_contact (caps) ||
- !tp_strdiff (service, TUBE_SERVICE)))
- return TRUE;
- }
-
- return FALSE;
+ return tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT,
+ TUBE_SERVICE);
}