[empathy] map_view_update_contact_position: create marker if needed



commit 14819097275f60f97d9960dee3f031a11223ca47
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Mar 26 15:55:57 2010 +0100

    map_view_update_contact_position: create marker if needed

 src/empathy-map-view.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index cf89e2a..2481acc 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -87,6 +87,9 @@ contact_has_location (EmpathyContact *contact)
   return TRUE;
 }
 
+static ChamplainMarker * create_marker (EmpathyMapView *window,
+    EmpathyContact *contact);
+
 static void
 map_view_update_contact_position (EmpathyMapView *self,
     EmpathyContact *contact)
@@ -97,7 +100,13 @@ map_view_update_contact_position (EmpathyMapView *self,
   ChamplainMarker *marker;
 
   marker = g_hash_table_lookup (self->markers, contact);
-  g_assert (marker != NULL);
+  if (marker == NULL)
+    {
+      if (!contact_has_location (contact))
+        return;
+
+      marker = create_marker (self, contact);
+    }
 
   location = empathy_contact_get_location (contact);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]