diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-03-25 19:27:17 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-03-25 19:27:17 +0000 |
commit | a7c96a2961bc4f9642bd325f53b22ae348a13998 (patch) | |
tree | 64c96ffac2df7ed9fd2ccffef641e9e6eb1a135f | |
parent | e69c4493880f06332ba0621c5805cdedd5f2af49 (diff) |
empathy_chat_manager_init: use TpChannelFilter
-rw-r--r-- | src/empathy-chat-manager.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c index c2d160e6..f4b1c761 100644 --- a/src/empathy-chat-manager.c +++ b/src/empathy-chat-manager.c @@ -264,6 +264,7 @@ empathy_chat_manager_init (EmpathyChatManager *self) EmpathyChatManagerPriv *priv = GET_PRIV (self); TpAccountManager *am; GError *error = NULL; + TpChannelFilter *filter; priv->closed_queue = g_queue_new (); priv->messages = g_hash_table_new_full (g_str_hash, g_str_equal, @@ -279,20 +280,18 @@ empathy_chat_manager_init (EmpathyChatManager *self) g_object_unref (am); - tp_base_client_add_handler_filter (priv->handler, - g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", - TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, TP_ENTITY_TYPE_CONTACT)); + tp_base_client_take_handler_filter (priv->handler, + tp_channel_filter_new_for_text_chats ()); - tp_base_client_add_handler_filter (priv->handler, - g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", - TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, TP_ENTITY_TYPE_ROOM)); + tp_base_client_take_handler_filter (priv->handler, + tp_channel_filter_new_for_text_chatrooms ()); - tp_base_client_add_handler_filter (priv->handler, - g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", - TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, TP_ENTITY_TYPE_NONE)); + /* FIXME: we should have high-level API to match nameless chatrooms */ + filter = tp_channel_filter_new_for_all_types (); + tp_channel_filter_require_property (filter, TP_PROP_CHANNEL_CHANNEL_TYPE, + g_variant_new_string (TP_IFACE_CHANNEL_TYPE_TEXT)); + tp_channel_filter_require_no_target (filter); + tp_base_client_take_handler_filter (priv->handler, filter); if (!tp_base_client_register (priv->handler, &error)) { |