aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>2008-12-13 02:54:54 +0800
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-08 01:37:02 +0800
commite2cb83179f1d899c733e9d4ae07e7c9ab619ef8d (patch)
treebf393e21c51a8fa8e962663550340ce8634ab7f3 /libempathy
parentdedfd1e8315b0af219293f9fd470525bed1b52c8 (diff)
downloadgsoc2013-empathy-e2cb83179f1d899c733e9d4ae07e7c9ab619ef8d.tar
gsoc2013-empathy-e2cb83179f1d899c733e9d4ae07e7c9ab619ef8d.tar.gz
gsoc2013-empathy-e2cb83179f1d899c733e9d4ae07e7c9ab619ef8d.tar.bz2
gsoc2013-empathy-e2cb83179f1d899c733e9d4ae07e7c9ab619ef8d.tar.lz
gsoc2013-empathy-e2cb83179f1d899c733e9d4ae07e7c9ab619ef8d.tar.xz
gsoc2013-empathy-e2cb83179f1d899c733e9d4ae07e7c9ab619ef8d.tar.zst
gsoc2013-empathy-e2cb83179f1d899c733e9d4ae07e7c9ab619ef8d.zip
Copy the hash table we receive
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-contact-factory.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index 3c43f5254..5c861a716 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -420,6 +420,15 @@ tp_contact_factory_capabilities_changed_cb (TpConnection *connection,
}
}
+static void
+update_location_for_each (gpointer key,
+ gpointer value,
+ gpointer user_data)
+{
+ GHashTable *location = (GHashTable*) user_data;
+ g_hash_table_insert (location, g_strdup(key), tp_g_value_slice_dup (value));
+}
+
static void
tp_contact_factory_location_updated_cb (TpProxy *proxy,
guint handle,
@@ -429,9 +438,16 @@ tp_contact_factory_location_updated_cb (TpProxy *proxy,
{
EmpathyTpContactFactory *tp_factory = EMPATHY_TP_CONTACT_FACTORY (weak_object);
EmpathyContact *contact;
+ GHashTable *new_location;
+
+ new_location = g_hash_table_new_full (g_str_hash, g_str_equal, NULL,
+ (GDestroyNotify) tp_g_value_slice_free);
+
+ // Copy keys
+ g_hash_table_foreach (location, update_location_for_each, new_location);
contact = tp_contact_factory_find_by_handle (tp_factory, handle);
- empathy_contact_set_location (contact, location);
+ empathy_contact_set_location (contact, new_location);
}
static void