summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-25 19:08:09 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-27 10:32:14 +0000
commit1bec4a2a36f0f1be09f76ecfc00582598c48bb1c (patch)
tree3789d99f6758215171784b5261c62917332f0245
parent87836943378ddc37b6c8b6f1bfae4d8b836a6c65 (diff)
empathy_call_factory_init: use TpChannelFilter high-level API
For now, I'm leaving it functionally identical to the old code. The filters with InitialAudio and InitialVideo can almost certainly be deleted - that isn't how Call1 detects audio or video support (but it was how StreamedMedia worked).
-rw-r--r--src/empathy-call-factory.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/empathy-call-factory.c b/src/empathy-call-factory.c
index fa5c1fc4..88a0280e 100644
--- a/src/empathy-call-factory.c
+++ b/src/empathy-call-factory.c
@@ -63,28 +63,26 @@ static void
empathy_call_factory_init (EmpathyCallFactory *obj)
{
TpBaseClient *client = (TpBaseClient *) obj;
-
- tp_base_client_add_approver_filter (client,
- g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }",
- TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_CALL1,
- TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, TP_ENTITY_TYPE_CONTACT));
-
- tp_base_client_add_handler_filter (client,
- g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }",
- TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_CALL1,
- TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, TP_ENTITY_TYPE_CONTACT));
-
- tp_base_client_add_handler_filter (client,
- g_variant_new_parsed ("{ %s: <%s>, %s: <%u>, %s: <%b> }",
- TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_CALL1,
- TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, TP_ENTITY_TYPE_CONTACT,
- TP_PROP_CHANNEL_TYPE_CALL1_INITIAL_AUDIO, TRUE));
-
- tp_base_client_add_handler_filter (client,
- g_variant_new_parsed ("{ %s: <%s>, %s: <%u>, %s: <%b> }",
- TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_CALL1,
- TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, TP_ENTITY_TYPE_CONTACT,
- TP_PROP_CHANNEL_TYPE_CALL1_INITIAL_VIDEO, TRUE));
+ TpChannelFilter *filter;
+
+ tp_base_client_take_approver_filter (client,
+ tp_channel_filter_new_for_calls (TP_ENTITY_TYPE_CONTACT));
+
+ tp_base_client_take_handler_filter (client,
+ tp_channel_filter_new_for_calls (TP_ENTITY_TYPE_CONTACT));
+
+ /* FIXME: this is not how you advertise audio/video support in Call1 -
+ * hopefully we can get rid of it? */
+ filter = tp_channel_filter_new_for_calls (TP_ENTITY_TYPE_CONTACT);
+ tp_channel_filter_require_property (filter,
+ TP_PROP_CHANNEL_TYPE_CALL1_INITIAL_AUDIO,
+ g_variant_new_boolean (TRUE));
+ tp_base_client_take_handler_filter (client, filter);
+ filter = tp_channel_filter_new_for_calls (TP_ENTITY_TYPE_CONTACT);
+ tp_channel_filter_require_property (filter,
+ TP_PROP_CHANNEL_TYPE_CALL1_INITIAL_VIDEO,
+ g_variant_new_boolean (TRUE));
+ tp_base_client_take_handler_filter (client, filter);
tp_base_client_add_handler_capabilities_varargs (client,
TP_TOKEN_CHANNEL_TYPE_CALL1_AUDIO,