diff --git a/tgp-blist.c b/tgp-blist.c index c94cb43..02acf0d 100644 --- a/tgp-blist.c +++ b/tgp-blist.c @@ -25,7 +25,7 @@ #include const char *tgp_blist_peer_get_purple_name (struct tgl_state *TLS, tgl_peer_id_t id) { - const char *name = g_hash_table_lookup (tg_get_data (TLS)->id_to_tgl_peer, GINT_TO_POINTER(tgl_get_peer_id (id))); + const char *name = g_hash_table_lookup (tg_get_data (TLS)->id_to_purple_name, GINT_TO_POINTER(tgl_get_peer_id (id))); if (! name) { assert (0); return NULL; @@ -34,8 +34,8 @@ const char *tgp_blist_peer_get_purple_name (struct tgl_state *TLS, tgl_peer_id_t } void tgp_blist_peer_add_purple_name (struct tgl_state *TLS, tgl_peer_id_t id, const char *purple_name) { - assert (g_hash_table_lookup (tg_get_data (TLS)->id_to_tgl_peer, GINT_TO_POINTER(tgl_get_peer_id (id))) == NULL); - g_hash_table_insert (tg_get_data (TLS)->id_to_tgl_peer, GINT_TO_POINTER(tgl_get_peer_id (id)), + assert (g_hash_table_lookup (tg_get_data (TLS)->id_to_purple_name, GINT_TO_POINTER(tgl_get_peer_id (id))) == NULL); + g_hash_table_insert (tg_get_data (TLS)->id_to_purple_name, GINT_TO_POINTER(tgl_get_peer_id (id)), g_strdup (purple_name)); } diff --git a/tgp-structs.c b/tgp-structs.c index 343845a..9cc5a8d 100644 --- a/tgp-structs.c +++ b/tgp-structs.c @@ -101,7 +101,7 @@ connection_data *connection_data_init (struct tgl_state *TLS, PurpleConnection * conn->out_messages = g_queue_new (); conn->pending_reads = g_queue_new (); conn->pending_chat_info = g_hash_table_new (g_direct_hash, g_direct_equal); - conn->id_to_tgl_peer = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); + conn->id_to_purple_name = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); return conn; } @@ -115,7 +115,7 @@ void *connection_data_free (connection_data *conn) { tgp_g_queue_free_full (conn->out_messages, tgp_msg_sending_free); tgp_g_list_free_full (conn->used_images, used_image_free); g_hash_table_destroy (conn->pending_chat_info); - g_hash_table_destroy (conn->id_to_tgl_peer); + g_hash_table_destroy (conn->id_to_purple_name); tgprpl_xfer_free_all (conn); tgl_free_all (conn->TLS); g_free(conn->TLS->base_path); diff --git a/tgp-structs.h b/tgp-structs.h index 299c6bf..3945727 100644 --- a/tgp-structs.h +++ b/tgp-structs.h @@ -43,7 +43,7 @@ typedef struct { int password_retries; PurpleRoomlist *roomlist; GHashTable *pending_chat_info; - GHashTable *id_to_tgl_peer; + GHashTable *id_to_purple_name; } connection_data; typedef struct {