]> git.0d.be Git - empathy.git/commitdiff
update_geocode: don't search for position if we already have lat or lon
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 8 Apr 2010 11:42:43 +0000 (13:42 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 8 Apr 2010 13:51:50 +0000 (15:51 +0200)
If contact publishes his position, it's fair to assume it publishes lat and
lon.

libempathy/empathy-contact.c

index f6f0e255dd895f8b417410e7bfb04fe1ce03f7f7..4f554419c9a24856d9bfcc1a064f98d43e6991cb 100644 (file)
@@ -1293,15 +1293,15 @@ update_geocode (EmpathyContact *contact)
   static GeoclueGeocode *geocode;
   gchar *str;
   GHashTable *address;
-  GValue* value;
   GHashTable *location;
 
   location = empathy_contact_get_location (contact);
   if (location == NULL)
     return;
 
-  value = g_hash_table_lookup (location, EMPATHY_LOCATION_LAT);
-  if (value != NULL)
+  /* No need to search for position if contact published it */
+  if (g_hash_table_lookup (location, EMPATHY_LOCATION_LAT) != NULL ||
+      g_hash_table_lookup (location, EMPATHY_LOCATION_LON) != NULL)
     return;
 
   if (geocode == NULL)