From 3a7b28fc0f3fc768aa2502d466351f235e3cad5d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 6 Jun 2014 08:43:31 +0000 Subject: handling API change from addressing #3431 --- src/conversation/gnunet-conversation-gtk_phone.c | 48 ++++++++++++++---------- src/fs/gnunet-fs-gtk_event-handler.c | 4 +- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/conversation/gnunet-conversation-gtk_phone.c b/src/conversation/gnunet-conversation-gtk_phone.c index 804dbbc3..79f18b41 100644 --- a/src/conversation/gnunet-conversation-gtk_phone.c +++ b/src/conversation/gnunet-conversation-gtk_phone.c @@ -31,6 +31,7 @@ #include "gnunet-conversation-gtk_import.h" #include "gnunet-conversation-gtk_log.h" #include "gnunet-conversation-gtk_phone.h" +#include "gnunet-conversation-gtk_zones.h" /** @@ -196,9 +197,14 @@ struct IncomingCall struct GNUNET_CONVERSATION_Caller *caller; /** - * String identifying the caller. + * Public key identifying the caller. */ - char *caller_id; + struct GNUNET_CRYPTO_EcdsaPublicKey caller_id; + + /** + * Caller ID as human-readable string. + */ + char *caller_id_str; /** * Location of this call in the list. @@ -416,7 +422,7 @@ destroy_in (struct IncomingCall *ic) GNUNET_CONVERSATION_caller_hang_up (ic->caller); ic->caller = NULL; } - GNUNET_free (ic->caller_id); + GNUNET_free (ic->caller_id_str); if (NULL != ic->rr) gtk_tree_row_reference_free (ic->rr); GNUNET_free (ic); @@ -851,13 +857,13 @@ set_incoming_call_state (struct IncomingCall *ic, * @param cls closure * @param code type of the event * @param caller handle for the caller - * @param caller_id name of the caller in GNS + * @param caller_id public key of the caller (in GNS) */ static void phone_event_handler (void *cls, enum GNUNET_CONVERSATION_PhoneEventCode code, struct GNUNET_CONVERSATION_Caller *caller, - const char *caller_id) + const struct GNUNET_CRYPTO_EcdsaPublicKey *caller_id) { GtkTreeIter iter; gboolean valid; @@ -871,12 +877,14 @@ phone_event_handler (void *cls, ic = GNUNET_new (struct IncomingCall); ic->caller = caller; ic->state = IN_STATE_RINGING; - ic->caller_id = GNUNET_strdup (caller_id); + ic->caller_id = *caller_id; + ic->caller_id_str = GNUNET_strdup (GNUNET_GNSRECORD_pkey_to_zkey (caller_id)); + // FIXME: initiate reverse lookup! ic->caller_num = caller_num_gen++; gtk_list_store_insert_with_values (active_liststore, &iter, -1, - GCG_PHONE_LS_REMOTE_USER_NAME, caller_id, + GCG_PHONE_LS_REMOTE_USER_NAME, ic->caller_id_str, GCG_PHONE_LS_INCOMING_CALL, ic, GCG_PHONE_LS_NUMBER, ic->caller_num, GCG_PHONE_LS_IN_CALL_STATE, ic->state, @@ -889,7 +897,7 @@ phone_event_handler (void *cls, path); gtk_tree_path_free (path); GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_CALL, - ic->caller_id, + ic->caller_id_str, ic->caller_num); break; case GNUNET_CONVERSATION_EC_PHONE_HUNG_UP: @@ -911,18 +919,18 @@ phone_event_handler (void *cls, { active_in = NULL; GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, - ic->caller_id, + ic->caller_id_str, ic->caller_num); } else { if (IN_STATE_RINGING == ic->state) GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_MISSED, - ic->caller_id, + ic->caller_id_str, ic->caller_num); else GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, - ic->caller_id, + ic->caller_id_str, ic->caller_num); } set_incoming_call_state (ic, @@ -963,7 +971,7 @@ caller_event_handler (void *cls, { case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_REMOTE, - ic->caller_id, + ic->caller_id_str, ic->caller_num); is = ic->state; switch (ic->state) @@ -992,7 +1000,7 @@ caller_event_handler (void *cls, break; case GNUNET_CONVERSATION_EC_CALLER_RESUME: GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_REMOTE, - ic->caller_id, + ic->caller_id_str, ic->caller_num); is = ic->state; switch (ic->state) @@ -1072,10 +1080,10 @@ gnunet_conversation_gtk_accept_button_clicked_cb (GtkButton *button, &caller_event_handler, ic, speaker, mic); GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_ACCEPTED, - ic->caller_id, + ic->caller_id_str, ic->caller_num); gtk_entry_set_text (address_entry, - ic->caller_id); + ic->caller_id_str); update_gui (); } @@ -1121,7 +1129,7 @@ gnunet_conversation_gtk_refuse_button_clicked_cb (GtkButton *button, GNUNET_break (in_ring_counter > 0); in_ring_counter--; GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_REJECTED, - ic->caller_id, + ic->caller_id_str, ic->caller_num); set_incoming_call_state (ic, IN_STATE_NONE); @@ -1198,10 +1206,10 @@ gnunet_conversation_gtk_resume_button_clicked_cb (GtkButton *button, GNUNET_CONVERSATION_caller_resume (ic->caller, speaker, mic); GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_LOCAL, - ic->caller_id, + ic->caller_id_str, ic->caller_num); gtk_entry_set_text (address_entry, - ic->caller_id); + ic->caller_id_str); update_gui (); return; } @@ -1285,7 +1293,7 @@ gnunet_conversation_gtk_suspend_button_clicked_cb (GtkButton *button, { /* incoming */ GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_LOCAL, - active_in->caller_id, + active_in->caller_id_str, active_in->caller_num); GNUNET_CONVERSATION_caller_suspend (active_in->caller); switch ((is = active_in->state)) @@ -1352,7 +1360,7 @@ gnunet_conversation_gtk_hangup_button_clicked_cb (GtkButton *button, { /* if selected call is incoming, hang it up */ GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, - active_in->caller_id, + active_in->caller_id_str, active_in->caller_num); set_incoming_call_state (active_in, IN_STATE_NONE); diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c index c94b9c66..38f3537d 100644 --- a/src/fs/gnunet-fs-gtk_event-handler.c +++ b/src/fs/gnunet-fs-gtk_event-handler.c @@ -2246,7 +2246,7 @@ see_if_there_are_any_uris (void *cls, * was part of a directory) * @param applicability_rank how relevant is the result * @return struct representing the search result (also stored in the tree - * model at 'iter') + * model) */ struct SearchResult * GNUNET_GTK_add_search_result (struct SearchTab *tab, @@ -2512,6 +2512,7 @@ process_search_result (struct SearchTab *tab, uri, meta, result, applicability_rank); update_search_label (tab); + GNUNET_break (NULL != sr); return sr; } @@ -3978,6 +3979,7 @@ GNUNET_GTK_fs_event_handler (void *cls, info->value.search.specifics.resume_result. availability_certainty, GNUNET_TIME_UNIT_ZERO); + GNUNET_break (NULL != ret); return ret; case GNUNET_FS_STATUS_SEARCH_SUSPEND: close_search_tab (info->value.search.cctx); -- cgit v1.2.3