[next] telepathy-glib: remove tp_channel_filter_require_channel_type() from API

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Tue Mar 18 06:31:51 PDT 2014


Module: telepathy-glib
Branch: next
Commit: 24ca19d9d0ca4ca8c163e77295ec7b4a4d7cab8c
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=24ca19d9d0ca4ca8c163e77295ec7b4a4d7cab8c

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Wed Mar 12 17:29:23 2014 +0100

remove tp_channel_filter_require_channel_type() from API

---

 .../telepathy-glib/telepathy-glib-sections.txt     |    1 -
 telepathy-glib/channel-filter.c                    |   44 ++++++++++----------
 telepathy-glib/channel-filter.h                    |    4 --
 tests/channel-filter.c                             |    8 ----
 tests/dbus/base-client.c                           |   13 +++---
 5 files changed, 28 insertions(+), 42 deletions(-)

diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index 7aaa224..68a9d11 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -6205,7 +6205,6 @@ tp_channel_filter_new_for_stream_tubes
 tp_channel_filter_new_for_text_chatrooms
 tp_channel_filter_new_for_text_chats
 <SUBSECTION>
-tp_channel_filter_require_channel_type
 tp_channel_filter_require_locally_requested
 <SUBSECTION>
 tp_channel_filter_require_no_target
diff --git a/telepathy-glib/channel-filter.c b/telepathy-glib/channel-filter.c
index 87ecb4e..bb2ce02 100644
--- a/telepathy-glib/channel-filter.c
+++ b/telepathy-glib/channel-filter.c
@@ -160,6 +160,28 @@ tp_channel_filter_new_for_all_types (void)
       NULL);
 }
 
+/*
+ * tp_channel_filter_require_channel_type:
+ * @self: a channel filter
+ * @channel_type: the desired value for #TpChannel:channel-type
+ *
+ * Narrow @self to require a particular channel type, given as a D-Bus
+ * interface name.
+ *
+ * It is an error to call this method if the channel filter has already
+ * been passed to a #TpBaseClient.
+ */
+static void
+tp_channel_filter_require_channel_type (TpChannelFilter *self,
+    const gchar *channel_type)
+{
+  g_return_if_fail (TP_IS_CHANNEL_FILTER (self));
+  g_return_if_fail (g_dbus_is_interface_name (channel_type));
+
+  g_variant_dict_insert (&self->priv->dict, TP_PROP_CHANNEL_CHANNEL_TYPE, "s",
+      channel_type);
+}
+
 /**
  * tp_channel_filter_new_for_text_chats:
  *
@@ -312,28 +334,6 @@ tp_channel_filter_new_for_calls (TpEntityType entity_type)
 }
 
 /**
- * tp_channel_filter_require_channel_type:
- * @self: a channel filter
- * @channel_type: the desired value for #TpChannel:channel-type
- *
- * Narrow @self to require a particular channel type, given as a D-Bus
- * interface name.
- *
- * It is an error to call this method if the channel filter has already
- * been passed to a #TpBaseClient.
- */
-void
-tp_channel_filter_require_channel_type (TpChannelFilter *self,
-    const gchar *channel_type)
-{
-  g_return_if_fail (TP_IS_CHANNEL_FILTER (self));
-  g_return_if_fail (g_dbus_is_interface_name (channel_type));
-
-  g_variant_dict_insert (&self->priv->dict, TP_PROP_CHANNEL_CHANNEL_TYPE, "s",
-      channel_type);
-}
-
-/**
  * tp_channel_filter_new_for_stream_tubes:
  * @service: (allow-none): the desired value of #TpStreamTubeChannel:service,
  *  or %NULL to match any service
diff --git a/telepathy-glib/channel-filter.h b/telepathy-glib/channel-filter.h
index deed593..ae467ac 100644
--- a/telepathy-glib/channel-filter.h
+++ b/telepathy-glib/channel-filter.h
@@ -92,10 +92,6 @@ void tp_channel_filter_require_locally_requested (TpChannelFilter *self,
     gboolean requested);
 
 _TP_AVAILABLE_IN_UNRELEASED
-void tp_channel_filter_require_channel_type (TpChannelFilter *self,
-    const gchar *channel_type);
-
-_TP_AVAILABLE_IN_UNRELEASED
 void tp_channel_filter_require_property (TpChannelFilter *self,
     const gchar *name,
     GVariant *value);
diff --git a/tests/channel-filter.c b/tests/channel-filter.c
index af7dd5f..3ca4b2d 100644
--- a/tests/channel-filter.c
+++ b/tests/channel-filter.c
@@ -156,14 +156,6 @@ test_basics (Fixture *f,
   g_clear_object (&f->filter);
 
   f->filter = tp_channel_filter_new_for_all_types ();
-  tp_channel_filter_require_channel_type (f->filter, "com.example.Bees");
-  asv = _tp_channel_filter_use (f->filter);
-  g_assert_cmpuint (tp_asv_size (asv), ==, 1);
-  g_assert_cmpstr (tp_asv_get_string (asv,
-        TP_PROP_CHANNEL_CHANNEL_TYPE), ==, "com.example.Bees");
-  g_clear_object (&f->filter);
-
-  f->filter = tp_channel_filter_new_for_all_types ();
   tp_channel_filter_require_locally_requested (f->filter, TRUE);
   asv = _tp_channel_filter_use (f->filter);
   g_assert_cmpuint (tp_asv_size (asv), ==, 1);
diff --git a/tests/dbus/base-client.c b/tests/dbus/base-client.c
index ede98ff..6b5b727 100644
--- a/tests/dbus/base-client.c
+++ b/tests/dbus/base-client.c
@@ -393,9 +393,11 @@ check_filters (GPtrArray *filters)
   g_assert_cmpuint (filters->len, ==, 2);
 
   filter = g_ptr_array_index (filters, 0);
-  g_assert_cmpuint (g_hash_table_size (filter), ==, 1);
+  g_assert_cmpuint (g_hash_table_size (filter), ==, 2);
   g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==,
       TP_IFACE_CHANNEL_TYPE_TEXT);
+  g_assert_cmpuint (tp_asv_get_uint32 (filter,
+        TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, NULL), ==, TP_ENTITY_TYPE_CONTACT);
 
   filter = g_ptr_array_index (filters, 1);
   g_assert_cmpuint (g_hash_table_size (filter), ==, 2);
@@ -472,8 +474,7 @@ test_observer (Test *test,
   TpChannel *chan;
   GHashTable *chan_props, *requests_satisfied;
 
-  filter = tp_channel_filter_new_for_all_types ();
-  tp_channel_filter_require_channel_type (filter, TP_IFACE_CHANNEL_TYPE_TEXT);
+  filter = tp_channel_filter_new_for_text_chats ();
   tp_base_client_add_observer_filter (test->base_client, filter);
   g_object_unref (filter);
 
@@ -612,8 +613,7 @@ test_approver (Test *test,
   GHashTable *chan_props;
   TpChannel *chan;
 
-  filter = tp_channel_filter_new_for_all_types ();
-  tp_channel_filter_require_channel_type (filter, TP_IFACE_CHANNEL_TYPE_TEXT);
+  filter = tp_channel_filter_new_for_text_chats ();
   tp_base_client_add_approver_filter (test->base_client, filter);
   g_object_unref (filter);
 
@@ -796,8 +796,7 @@ test_handler (Test *test,
   GList *chans;
   TpTestsSimpleClient *client_2;
 
-  filter = tp_channel_filter_new_for_all_types ();
-  tp_channel_filter_require_channel_type (filter, TP_IFACE_CHANNEL_TYPE_TEXT);
+  filter = tp_channel_filter_new_for_text_chats ();
   tp_base_client_add_handler_filter (test->base_client, filter);
   g_object_unref (filter);
 



More information about the telepathy-commits mailing list