[empathy] update_geocode: don't search for position if we already have lat or lon



commit ee8b4ad4f89343de7e965a2414e1f746bd018b5a
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Apr 8 13:42:43 2010 +0200

    update_geocode: don't search for position if we already have lat or lon
    
    If contact publishes his position, it's fair to assume it publishes lat and
    lon.

 libempathy/empathy-contact.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index f6f0e25..4f55441 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -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)



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