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-25 19:26:19 +0000
commitc2df90d2bace0dc01ff33fd2cac5c2c3fb188bfe (patch)
treebae462a37a9b22f4ec6e18e32ee8fbc77aeb31a5
parentc88f8fa17ac2c36c88da57bd1eb25cf85211bae3 (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);
}