summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-05 14:02:29 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-05 14:18:24 +0200
commit35ff9454674f766d5d8f89286b1092b44868dda4 (patch)
treea18f70205882d6de9918e9019821dde7e1909ef2
parentcd3d4fce75d731ac98037dc3c87b566ffd1998e0 (diff)
observer: ignore channels that we are already observing
telepathy-idle announce twice channels we receive from the bouncer. That's a bug (fdo #28918) but as a result ObserveChannels() is called twice. We should ignore those rather than creating a second TplChannel which would destroy the one we just created.
-rw-r--r--telepathy-logger/observer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/telepathy-logger/observer.c b/telepathy-logger/observer.c
index 2833a3e..c229707 100644
--- a/telepathy-logger/observer.c
+++ b/telepathy-logger/observer.c
@@ -176,6 +176,12 @@ tpl_observer_observe_channels (TpBaseClient *client,
const gchar *path;
path = tp_proxy_get_object_path (channel);
+
+ /* Ignore channel if we are already observing it */
+ if (g_hash_table_lookup (self->priv->channels, path) != NULL ||
+ g_hash_table_lookup (self->priv->preparing_channels, path) != NULL)
+ continue;
+
/* d.bus.propertyName.str/gvalue hash */
prop_map = tp_channel_borrow_immutable_properties (channel);
chan_type = tp_channel_get_channel_type (channel);