summaryrefslogtreecommitdiff
path: root/src/conn-olpc.c
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-09-30 16:03:59 +0200
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-09-30 16:22:15 +0200
commit728956252ce906348ff6d29d704dc87454ed70c7 (patch)
tree8c29addeb7ce12f6fe91963f5407c858dd68de61 /src/conn-olpc.c
parent581a9d75c148ab8fad3550c95b8cf012ab425690 (diff)
Check if we have already an OlpcActivity for that channel
Otherwise we were creating two activities for the same channel: one when the channel is created and the other when Sugar calls AddActivity.
Diffstat (limited to 'src/conn-olpc.c')
-rw-r--r--src/conn-olpc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index fb7805b2..386ebbdf 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -1012,7 +1012,14 @@ add_activity (GabbleConnection *self,
return FALSE;
}
- activity = add_activity_info (self, channel);
+ activity = g_hash_table_lookup (self->olpc_activities_info,
+ GUINT_TO_POINTER (channel));
+
+ if (activity == NULL)
+ {
+ activity = add_activity_info (self, channel);
+ }
+
g_object_ref (activity);
DEBUG ("ref: %s (%d) refcount: %d\n",