aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/gnunet-conversation-gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/gnunet-conversation-gtk.c')
-rw-r--r--src/conversation/gnunet-conversation-gtk.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/conversation/gnunet-conversation-gtk.c b/src/conversation/gnunet-conversation-gtk.c
index 4dbc8ba0..9a2dd5a7 100644
--- a/src/conversation/gnunet-conversation-gtk.c
+++ b/src/conversation/gnunet-conversation-gtk.c
@@ -297,8 +297,9 @@ phone_event_handler (void *cls, enum GNUNET_CONVERSATION_PhoneEventCode code,
297 cl->caller_id = GNUNET_strdup (caller_id); 297 cl->caller_id = GNUNET_strdup (caller_id);
298 cl->caller_num = caller_num_gen++; 298 cl->caller_num = caller_num_gen++;
299 GNUNET_CONTAINER_DLL_insert (cl_head, cl_tail, cl); 299 GNUNET_CONTAINER_DLL_insert (cl_head, cl_tail, cl);
300 strncpy (&callerName, &caller_id, 50); 300 callerName = caller_id;
301 callerName[52] = '\0'; 301 //strncpy (&callerName, &caller_id, 50);
302 //callerName[52] = '\0';
302 quick_message ("der is een beller", caller_id); 303 quick_message ("der is een beller", caller_id);
303 304
304 break; 305 break;
@@ -485,7 +486,7 @@ do_call (const char *arg)
485 &call_event_handler, NULL); 486 &call_event_handler, NULL);
486 UPDATE_STATUS (_("We are calling `%s', his phone should be ringing."), 487 UPDATE_STATUS (_("We are calling `%s', his phone should be ringing."),
487 peer_name); 488 peer_name);
488 history_add (CH_ACCEPTED, peer_name); 489 history_add (CH_OUTGOING, peer_name);
489} 490}
490 491
491 492
@@ -849,14 +850,6 @@ display_record (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
849 //test_finished (); 850 //test_finished ();
850 return; 851 return;
851 } 852 }
852 if ((NULL != name) && (0 != strcmp (name, rname)))
853 {
854 GNUNET_NAMESTORE_zone_iterator_next (list_it);
855 return;
856 }
857 //FPRINTF (stdout,
858// "%s:\n",
859// rname);
860 for (i = 0; i < rd_len; i++) 853 for (i = 0; i < rd_len; i++)
861 { 854 {
862 855
@@ -983,7 +976,7 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
983{ 976{
984 struct GNUNET_CRYPTO_EcdsaPublicKey pk; 977 struct GNUNET_CRYPTO_EcdsaPublicKey pk;
985 char *s; 978 char *s;
986// GtkTreeIter iter; 979 GtkTreeIter iter;
987 980
988 if (NULL != ego) 981 if (NULL != ego)
989 { 982 {
@@ -1453,10 +1446,9 @@ add_contact (const gchar * name, const gchar * address)
1453 static size_t data_size; 1446 static size_t data_size;
1454 struct GNUNET_CRYPTO_EcdsaPublicKey pkey; 1447 struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
1455 1448
1456
1457 GNUNET_CRYPTO_ecdsa_public_key_from_string (address, strlen (address), &pkey); 1449 GNUNET_CRYPTO_ecdsa_public_key_from_string (address, strlen (address), &pkey);
1458 rde = &rd; 1450 rde = &rd;
1459 zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id); 1451 zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (currentAddressBookEgo);
1460 rd.data = &pkey; 1452 rd.data = &pkey;
1461 rd.data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey); 1453 rd.data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
1462 rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY; 1454 rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
@@ -1480,7 +1472,6 @@ add_contact (const gchar * name, const gchar * address)
1480 gtk_list_store_set (contacts_liststore, &iter, 1, "PKEY", 0, name, -1); 1472 gtk_list_store_set (contacts_liststore, &iter, 1, "PKEY", 0, name, -1);
1481 } 1473 }
1482} 1474}
1483
1484/* 1475/*
1485 * executed when clicked on add contact 1476 * executed when clicked on add contact
1486 * @param button 1477 * @param button
@@ -1498,6 +1489,7 @@ GNUNET_CONVERSATION_GTK_on_add_clicked (GtkButton * button,
1498 addressEntry = GTK_ENTRY (get_object ("GNUNET_GTK_conversation_addressAdd")); 1489 addressEntry = GTK_ENTRY (get_object ("GNUNET_GTK_conversation_addressAdd"));
1499 FPRINTF(stderr,"name %s \n", gtk_entry_get_text (nameEntry)); 1490 FPRINTF(stderr,"name %s \n", gtk_entry_get_text (nameEntry));
1500 FPRINTF(stderr,"addr %s \n", gtk_entry_get_text (addressEntry)); 1491 FPRINTF(stderr,"addr %s \n", gtk_entry_get_text (addressEntry));
1492
1501 add_contact (gtk_entry_get_text (nameEntry),gtk_entry_get_text(addressEntry)); 1493 add_contact (gtk_entry_get_text (nameEntry),gtk_entry_get_text(addressEntry));
1502} 1494}
1503 1495
@@ -1700,6 +1692,13 @@ GNUNET_contact_test ()
1700// GNUNET_NAMESTORE_zone_iterator_next(list_it); 1692// GNUNET_NAMESTORE_zone_iterator_next(list_it);
1701} 1693}
1702 1694
1695
1696GNUNET_IDENTITY_EgoCallback
1697setCurrentAddressbookEgo(void *cls, struct GNUNET_IDENTITY_Ego *ego)
1698{
1699 currentAddressBookEgo = ego;
1700}
1701
1703/** 1702/**
1704 * A different zone was selected in the zone toggle bar. Load the 1703 * A different zone was selected in the zone toggle bar. Load the
1705 * appropriate zone. 1704 * appropriate zone.
@@ -1728,6 +1727,11 @@ gnunet_conversation_gtk_contacts_zone_combobox_changed_cb (GtkComboBox *widget,
1728 temp_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (tempEgo); 1727 temp_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (tempEgo);
1729 gtk_list_store_clear(contacts_liststore); 1728 gtk_list_store_clear(contacts_liststore);
1730 1729
1730 GNUNET_IDENTITY_ego_lookup (cfg,
1731 tempName,
1732 setCurrentAddressbookEgo,
1733 NULL);
1734
1731 list_it = 1735 list_it =
1732 GNUNET_NAMESTORE_zone_iteration_start (ns, &temp_zone_pkey, &display_record, 1736 GNUNET_NAMESTORE_zone_iteration_start (ns, &temp_zone_pkey, &display_record,
1733 NULL); 1737 NULL);
@@ -1736,4 +1740,3 @@ gnunet_conversation_gtk_contacts_zone_combobox_changed_cb (GtkComboBox *widget,
1736 1740
1737} 1741}
1738 1742
1739