[empathy/next: 65/79] empathy_call_factory_init: use TpChannelFilter high-level API



commit 1bec4a2a36f0f1be09f76ecfc00582598c48bb1c
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Tue Mar 25 19:08:09 2014 +0000

    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).

 src/empathy-call-factory.c |   42 ++++++++++++++++++++----------------------
 1 files changed, 20 insertions(+), 22 deletions(-)
---
diff --git a/src/empathy-call-factory.c b/src/empathy-call-factory.c
index fa5c1fc..88a0280 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]