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-25 19:26:20 +0000
commitfcc7a651674d444a63e378f198e6bdb5542f361b (patch)
treec11180280462eababafde551c29a56a042fe01bc
parent7d7798d839e054b312e119d5295a0815d48a0a54 (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,