summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-25 19:06:41 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-25 19:26:20 +0000
commitde320e9cde8ed8511c99f53c23eaf6df5c6d5325 (patch)
treeb5a41442dc799cbc1f4fd21f2a26b6bc0f09913a
parentce9981bad25d5ad7493fe2184ca3b540a75c2c34 (diff)
log_window_create_observer: use TpChannelFilter
-rw-r--r--libempathy-gtk/empathy-log-window.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index c1fecf9d..c0a9829b 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -1036,6 +1036,7 @@ static void
log_window_create_observer (EmpathyLogWindow *self)
{
TpAccountManager *am;
+ TpChannelFilter *filter;
am = tp_account_manager_dup ();
@@ -1045,12 +1046,18 @@ log_window_create_observer (EmpathyLogWindow *self)
self->priv->channels = g_hash_table_new_full (g_direct_hash, g_direct_equal,
g_object_unref, g_object_unref);
- tp_base_client_add_observer_filter (self->priv->observer,
- g_variant_new_parsed ("{ %s: <%s> }",
- TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT));
- tp_base_client_add_observer_filter (self->priv->observer,
- g_variant_new_parsed ("{ %s: <%s> }",
- TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_CALL1));
+ /* FIXME: either there should be an easier way to create channel filters for
+ * text and calls with an arbitrary entity type, or we should only watch
+ * for sensible entity types (NONE, CONTACT and ROOM) */
+ 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_base_client_take_observer_filter (self->priv->observer, filter);
+
+ 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_CALL1));
+ tp_base_client_take_observer_filter (self->priv->observer, filter);
tp_base_client_register (self->priv->observer, NULL);