aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/gnunet-conversation-gtk_contacts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/gnunet-conversation-gtk_contacts.c')
-rw-r--r--src/conversation/gnunet-conversation-gtk_contacts.c59
1 files changed, 26 insertions, 33 deletions
diff --git a/src/conversation/gnunet-conversation-gtk_contacts.c b/src/conversation/gnunet-conversation-gtk_contacts.c
index 808306ff..821d5009 100644
--- a/src/conversation/gnunet-conversation-gtk_contacts.c
+++ b/src/conversation/gnunet-conversation-gtk_contacts.c
@@ -135,17 +135,17 @@ static struct GNUNET_IDENTITY_Handle *id;
135/** 135/**
136 * Handle to the namestore. 136 * Handle to the namestore.
137 */ 137 */
138struct GNUNET_NAMESTORE_Handle *ns; 138static struct GNUNET_NAMESTORE_Handle *ns;
139 139
140/** 140/**
141 * Private key for the our zone. 141 * Private key for the our zone.
142 */ 142 */
143struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey; 143static struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey;
144 144
145/** 145/**
146 * Public key of the zone we are currently editing. 146 * Public key of the zone we are currently editing.
147 */ 147 */
148struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; 148static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
149 149
150 150
151 151
@@ -153,7 +153,7 @@ struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
153/** 153/**
154 * Name of the records to add/list/remove. 154 * Name of the records to add/list/remove.
155 */ 155 */
156static char *name; 156 static char *name;
157 157
158/** 158/**
159 * Queue entry for the 'add' operation. 159 * Queue entry for the 'add' operation.
@@ -181,12 +181,15 @@ display_record (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
181 struct GNUNET_TIME_Relative rt; 181 struct GNUNET_TIME_Relative rt;
182 GtkTreeIter display_iter; 182 GtkTreeIter display_iter;
183 183
184
184 if (NULL == rname) 185 if (NULL == rname)
185 { 186 {
187
186 list_it = NULL; 188 list_it = NULL;
187 //test_finished (); 189 //test_finished ();
188 return; 190 return;
189 } 191 }
192
190 for (i = 0; i < rd_len; i++) 193 for (i = 0; i < rd_len; i++)
191 { 194 {
192 195
@@ -240,7 +243,10 @@ display_record (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
240 GNUNET_free (s); 243 GNUNET_free (s);
241 } 244 }
242// FPRINTF (stdout, "%s", "\n"); 245// FPRINTF (stdout, "%s", "\n");
246
243 GNUNET_NAMESTORE_zone_iterator_next (list_it); 247 GNUNET_NAMESTORE_zone_iterator_next (list_it);
248// GNUNET_NAMESTORE_zone_iteration_stop(list_it);
249
244} 250}
245 251
246 252
@@ -277,38 +283,12 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
277 283
278 } 284 }
279 285
280 /*
281 if (NULL == name)
282 return;
283 if (ego == contacts_ego)
284 {
285 //if (verbose)
286 LOG (_("Name of phonebook ego changed to `%s'\n"), name);
287 GNUNET_free (contacts_ego_name);
288 contacts_ego_name = GNUNET_strdup (name);
289 return;
290 }
291 if (0 != strcmp (name, contacts_ego_name))
292 return;
293 if (NULL == ego)
294 {
295 if (verbose)
296 LOG (_("Our phonebook ego `%s' was deleted!\n"), contacts_ego_name);
297 contacts_ego = NULL;
298 return;
299 }
300 */
301 contacts_ego = ego; 286 contacts_ego = ego;
302 287
303 288
304// zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id); 289// zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id);
305 ns = GNUNET_NAMESTORE_connect (cfg); 290 ns = GNUNET_NAMESTORE_connect (cfg);
306 291
307
308// list_it =
309// GNUNET_NAMESTORE_zone_iteration_start (ns, &zone_pkey, &display_record,
310// NULL);
311
312} 292}
313/** 293/**
314 * Continuation called to notify client about result of the 294 * Continuation called to notify client about result of the
@@ -372,7 +352,7 @@ del_continuation (void *cls, int32_t success, const char *emsg)
372 * @param name 352 * @param name
373 * @param address 353 * @param address
374 */ 354 */
375void 355static void
376add_contact (const gchar * name, const gchar * address) 356add_contact (const gchar * name, const gchar * address)
377{ 357{
378// memmove(&address+1,&address+51,1); 358// memmove(&address+1,&address+51,1);
@@ -667,17 +647,30 @@ GNUNET_CONVERSATION_GTK_CONTACTS_init ()
667extern void 647extern void
668GNUNET_CONVERSATION_GTK_CONTACTS_shutdown() 648GNUNET_CONVERSATION_GTK_CONTACTS_shutdown()
669{ 649{
670 GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey); 650
671 if (NULL != id) 651 if (NULL != id)
672 { 652 {
673 GNUNET_IDENTITY_disconnect (id); 653 GNUNET_IDENTITY_disconnect (id);
674 id = NULL; 654 id = NULL;
655 } else {
656 GNUNET_break(0);
657 }
658
659 if (NULL != list_it)
660 {
661 FPRINTF(stderr,"LIST_IT == NULL");
662// GNUNET_NAMESTORE_zone_iteration_stop(list_it);
675 } 663 }
676 if (NULL != ns) 664 if (NULL != ns)
677 { 665 {
678 GNUNET_NAMESTORE_disconnect (ns); 666 GNUNET_NAMESTORE_disconnect (ns);
679 ns = NULL; 667 ns = NULL;
668 } else {
669 GNUNET_break(0);
680 } 670 }
671
672 GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey);
673
681} 674}
682 675
683 676