diff options
author | Pierre-Luc Beaudoin <pierre-luc@pierlux.com> | 2008-12-11 06:27:42 +0800 |
---|---|---|
committer | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-06-01 23:35:29 +0800 |
commit | b89200b47a145f288a35a81625a73bb76a054599 (patch) | |
tree | 6098d9e4397cb1597ca544af048d71a79c0a21d1 /libempathy-gtk/empathy-location-manager.c | |
parent | 3db6c6d6152fbb5c3741e748ec0de66a40440784 (diff) | |
download | gsoc2013-empathy-b89200b47a145f288a35a81625a73bb76a054599.tar gsoc2013-empathy-b89200b47a145f288a35a81625a73bb76a054599.tar.gz gsoc2013-empathy-b89200b47a145f288a35a81625a73bb76a054599.tar.bz2 gsoc2013-empathy-b89200b47a145f288a35a81625a73bb76a054599.tar.lz gsoc2013-empathy-b89200b47a145f288a35a81625a73bb76a054599.tar.xz gsoc2013-empathy-b89200b47a145f288a35a81625a73bb76a054599.tar.zst gsoc2013-empathy-b89200b47a145f288a35a81625a73bb76a054599.zip |
Support address fields
Diffstat (limited to 'libempathy-gtk/empathy-location-manager.c')
-rw-r--r-- | libempathy-gtk/empathy-location-manager.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c index 7ad275dba..a30b4a97c 100644 --- a/libempathy-gtk/empathy-location-manager.c +++ b/libempathy-gtk/empathy-location-manager.c @@ -278,19 +278,43 @@ position_changed_cb (GeocluePosition *position, } } +static void +address_foreach_cb (gpointer key, + gpointer value, + gpointer location_manager) +{ + if (location_manager == NULL) + return; + + EmpathyLocationManagerPriv *priv; + priv = GET_PRIV (location_manager); + + GValue *new_value = tp_g_value_slice_new (G_TYPE_STRING); + g_value_set_string (new_value, value); + + g_hash_table_insert (priv->location, g_strdup (key), new_value); + DEBUG ("\t - %s: %s", (char*) key, (char*) value); +} static void address_changed_cb (GeoclueAddress *address, int timestamp, GHashTable *details, GeoclueAccuracy *accuracy, - gpointer user_data) + gpointer location_manager) { GeoclueAccuracyLevel level; geoclue_accuracy_get_details (accuracy, &level, NULL, NULL); - DEBUG ("New address (accuracy level %d):\n", level); - // XXX todo - publish_location_to_all_accounts (EMPATHY_LOCATION_MANAGER (user_data)); + EmpathyLocationManagerPriv *priv; + + DEBUG ("New address (accuracy level %d):", level); + + priv = GET_PRIV (location_manager); + g_hash_table_remove_all (priv->location); + + g_hash_table_foreach (details, address_foreach_cb, (gpointer)location_manager); + + publish_location_to_all_accounts (EMPATHY_LOCATION_MANAGER (location_manager)); } |