summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-25 18:11:11 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-27 10:32:14 +0000
commitebf9b7fe1423551d1bd04e8351fc9ccc035e9ce9 (patch)
tree9a725e508f80c523ff0a18ae53e0996f1712e180
parent4ba745b58a640dcff0a150c0c6d01d43a8ae6a20 (diff)
use new TpChannelFilter API
[We decided tp_channel_filter_new_for_file_transfers() should only match FTs to/from contacts, so don't redundantly call tp_channel_filter_require_target_is_contact() -smcv]
-rw-r--r--libempathy/empathy-chatroom-manager.c6
-rw-r--r--libempathy/empathy-ft-factory.c14
2 files changed, 9 insertions, 11 deletions
diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c
index 5df9600d..9add7fdb 100644
--- a/libempathy/empathy-chatroom-manager.c
+++ b/libempathy/empathy-chatroom-manager.c
@@ -588,10 +588,8 @@ empathy_chatroom_manager_constructor (GType type,
priv->observer = tp_simple_observer_new_with_am (priv->account_manager, TRUE,
"Empathy.ChatroomManager", TRUE, observe_channel_cb, self, NULL);
- tp_base_client_add_observer_filter (priv->observer, g_variant_new_parsed (
- "{ %s: <%s>, %s: <%u> }",
- TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT,
- TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_ROOM));
+ tp_base_client_take_observer_filter (priv->observer,
+ tp_channel_filter_new_for_text_chatrooms ());
if (!tp_base_client_register (priv->observer, &error))
{
diff --git a/libempathy/empathy-ft-factory.c b/libempathy/empathy-ft-factory.c
index ed5bfd5f..b661d00e 100644
--- a/libempathy/empathy-ft-factory.c
+++ b/libempathy/empathy-ft-factory.c
@@ -186,6 +186,7 @@ empathy_ft_factory_init (EmpathyFTFactory *self)
EmpathyFTFactoryPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_FT_FACTORY, EmpathyFTFactoryPriv);
TpAccountManager *am;
+ TpChannelFilter *filter;
self->priv = priv;
@@ -194,13 +195,12 @@ empathy_ft_factory_init (EmpathyFTFactory *self)
priv->handler = tp_simple_handler_new_with_am (am, FALSE, FALSE,
EMPATHY_FT_TP_BUS_NAME_SUFFIX, FALSE, handle_channel_cb, self, NULL);
- tp_base_client_add_handler_filter (priv->handler, g_variant_new_parsed (
- "{ %s: <%s>, %s: <%u>, %s: <%b> }",
- TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER1,
- TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_CONTACT,
- /* Only handle *incoming* channels as outgoing FT channels has to be
- * handled by the requester. */
- TP_PROP_CHANNEL_REQUESTED, FALSE));
+ filter = tp_channel_filter_new_for_file_transfers (NULL);
+ /* Only handle *incoming* channels as outgoing FT channels has to be
+ * handled by the requester. */
+ tp_channel_filter_require_locally_requested (filter, FALSE);
+
+ tp_base_client_take_handler_filter (priv->handler, filter);
g_object_unref (am);
}