diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-06 08:43:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-06 08:43:31 +0000 |
commit | 3a7b28fc0f3fc768aa2502d466351f235e3cad5d (patch) | |
tree | cd3c13fd162be20f3da55b29fd39f0ee02a7491e | |
parent | 6b5e7e1a1136296bf8981baffebd8f4dbf90b79e (diff) | |
download | gnunet-gtk-3a7b28fc0f3fc768aa2502d466351f235e3cad5d.tar.gz gnunet-gtk-3a7b28fc0f3fc768aa2502d466351f235e3cad5d.zip |
handling API change from addressing #3431
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_phone.c | 48 | ||||
-rw-r--r-- | 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 @@ | |||
31 | #include "gnunet-conversation-gtk_import.h" | 31 | #include "gnunet-conversation-gtk_import.h" |
32 | #include "gnunet-conversation-gtk_log.h" | 32 | #include "gnunet-conversation-gtk_log.h" |
33 | #include "gnunet-conversation-gtk_phone.h" | 33 | #include "gnunet-conversation-gtk_phone.h" |
34 | #include "gnunet-conversation-gtk_zones.h" | ||
34 | 35 | ||
35 | 36 | ||
36 | /** | 37 | /** |
@@ -196,9 +197,14 @@ struct IncomingCall | |||
196 | struct GNUNET_CONVERSATION_Caller *caller; | 197 | struct GNUNET_CONVERSATION_Caller *caller; |
197 | 198 | ||
198 | /** | 199 | /** |
199 | * String identifying the caller. | 200 | * Public key identifying the caller. |
200 | */ | 201 | */ |
201 | char *caller_id; | 202 | struct GNUNET_CRYPTO_EcdsaPublicKey caller_id; |
203 | |||
204 | /** | ||
205 | * Caller ID as human-readable string. | ||
206 | */ | ||
207 | char *caller_id_str; | ||
202 | 208 | ||
203 | /** | 209 | /** |
204 | * Location of this call in the list. | 210 | * Location of this call in the list. |
@@ -416,7 +422,7 @@ destroy_in (struct IncomingCall *ic) | |||
416 | GNUNET_CONVERSATION_caller_hang_up (ic->caller); | 422 | GNUNET_CONVERSATION_caller_hang_up (ic->caller); |
417 | ic->caller = NULL; | 423 | ic->caller = NULL; |
418 | } | 424 | } |
419 | GNUNET_free (ic->caller_id); | 425 | GNUNET_free (ic->caller_id_str); |
420 | if (NULL != ic->rr) | 426 | if (NULL != ic->rr) |
421 | gtk_tree_row_reference_free (ic->rr); | 427 | gtk_tree_row_reference_free (ic->rr); |
422 | GNUNET_free (ic); | 428 | GNUNET_free (ic); |
@@ -851,13 +857,13 @@ set_incoming_call_state (struct IncomingCall *ic, | |||
851 | * @param cls closure | 857 | * @param cls closure |
852 | * @param code type of the event | 858 | * @param code type of the event |
853 | * @param caller handle for the caller | 859 | * @param caller handle for the caller |
854 | * @param caller_id name of the caller in GNS | 860 | * @param caller_id public key of the caller (in GNS) |
855 | */ | 861 | */ |
856 | static void | 862 | static void |
857 | phone_event_handler (void *cls, | 863 | phone_event_handler (void *cls, |
858 | enum GNUNET_CONVERSATION_PhoneEventCode code, | 864 | enum GNUNET_CONVERSATION_PhoneEventCode code, |
859 | struct GNUNET_CONVERSATION_Caller *caller, | 865 | struct GNUNET_CONVERSATION_Caller *caller, |
860 | const char *caller_id) | 866 | const struct GNUNET_CRYPTO_EcdsaPublicKey *caller_id) |
861 | { | 867 | { |
862 | GtkTreeIter iter; | 868 | GtkTreeIter iter; |
863 | gboolean valid; | 869 | gboolean valid; |
@@ -871,12 +877,14 @@ phone_event_handler (void *cls, | |||
871 | ic = GNUNET_new (struct IncomingCall); | 877 | ic = GNUNET_new (struct IncomingCall); |
872 | ic->caller = caller; | 878 | ic->caller = caller; |
873 | ic->state = IN_STATE_RINGING; | 879 | ic->state = IN_STATE_RINGING; |
874 | ic->caller_id = GNUNET_strdup (caller_id); | 880 | ic->caller_id = *caller_id; |
881 | ic->caller_id_str = GNUNET_strdup (GNUNET_GNSRECORD_pkey_to_zkey (caller_id)); | ||
882 | // FIXME: initiate reverse lookup! | ||
875 | ic->caller_num = caller_num_gen++; | 883 | ic->caller_num = caller_num_gen++; |
876 | gtk_list_store_insert_with_values (active_liststore, | 884 | gtk_list_store_insert_with_values (active_liststore, |
877 | &iter, | 885 | &iter, |
878 | -1, | 886 | -1, |
879 | GCG_PHONE_LS_REMOTE_USER_NAME, caller_id, | 887 | GCG_PHONE_LS_REMOTE_USER_NAME, ic->caller_id_str, |
880 | GCG_PHONE_LS_INCOMING_CALL, ic, | 888 | GCG_PHONE_LS_INCOMING_CALL, ic, |
881 | GCG_PHONE_LS_NUMBER, ic->caller_num, | 889 | GCG_PHONE_LS_NUMBER, ic->caller_num, |
882 | GCG_PHONE_LS_IN_CALL_STATE, ic->state, | 890 | GCG_PHONE_LS_IN_CALL_STATE, ic->state, |
@@ -889,7 +897,7 @@ phone_event_handler (void *cls, | |||
889 | path); | 897 | path); |
890 | gtk_tree_path_free (path); | 898 | gtk_tree_path_free (path); |
891 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_CALL, | 899 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_CALL, |
892 | ic->caller_id, | 900 | ic->caller_id_str, |
893 | ic->caller_num); | 901 | ic->caller_num); |
894 | break; | 902 | break; |
895 | case GNUNET_CONVERSATION_EC_PHONE_HUNG_UP: | 903 | case GNUNET_CONVERSATION_EC_PHONE_HUNG_UP: |
@@ -911,18 +919,18 @@ phone_event_handler (void *cls, | |||
911 | { | 919 | { |
912 | active_in = NULL; | 920 | active_in = NULL; |
913 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, | 921 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, |
914 | ic->caller_id, | 922 | ic->caller_id_str, |
915 | ic->caller_num); | 923 | ic->caller_num); |
916 | } | 924 | } |
917 | else | 925 | else |
918 | { | 926 | { |
919 | if (IN_STATE_RINGING == ic->state) | 927 | if (IN_STATE_RINGING == ic->state) |
920 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_MISSED, | 928 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_MISSED, |
921 | ic->caller_id, | 929 | ic->caller_id_str, |
922 | ic->caller_num); | 930 | ic->caller_num); |
923 | else | 931 | else |
924 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, | 932 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, |
925 | ic->caller_id, | 933 | ic->caller_id_str, |
926 | ic->caller_num); | 934 | ic->caller_num); |
927 | } | 935 | } |
928 | set_incoming_call_state (ic, | 936 | set_incoming_call_state (ic, |
@@ -963,7 +971,7 @@ caller_event_handler (void *cls, | |||
963 | { | 971 | { |
964 | case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: | 972 | case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: |
965 | GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_REMOTE, | 973 | GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_REMOTE, |
966 | ic->caller_id, | 974 | ic->caller_id_str, |
967 | ic->caller_num); | 975 | ic->caller_num); |
968 | is = ic->state; | 976 | is = ic->state; |
969 | switch (ic->state) | 977 | switch (ic->state) |
@@ -992,7 +1000,7 @@ caller_event_handler (void *cls, | |||
992 | break; | 1000 | break; |
993 | case GNUNET_CONVERSATION_EC_CALLER_RESUME: | 1001 | case GNUNET_CONVERSATION_EC_CALLER_RESUME: |
994 | GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_REMOTE, | 1002 | GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_REMOTE, |
995 | ic->caller_id, | 1003 | ic->caller_id_str, |
996 | ic->caller_num); | 1004 | ic->caller_num); |
997 | is = ic->state; | 1005 | is = ic->state; |
998 | switch (ic->state) | 1006 | switch (ic->state) |
@@ -1072,10 +1080,10 @@ gnunet_conversation_gtk_accept_button_clicked_cb (GtkButton *button, | |||
1072 | &caller_event_handler, ic, | 1080 | &caller_event_handler, ic, |
1073 | speaker, mic); | 1081 | speaker, mic); |
1074 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_ACCEPTED, | 1082 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_ACCEPTED, |
1075 | ic->caller_id, | 1083 | ic->caller_id_str, |
1076 | ic->caller_num); | 1084 | ic->caller_num); |
1077 | gtk_entry_set_text (address_entry, | 1085 | gtk_entry_set_text (address_entry, |
1078 | ic->caller_id); | 1086 | ic->caller_id_str); |
1079 | update_gui (); | 1087 | update_gui (); |
1080 | } | 1088 | } |
1081 | 1089 | ||
@@ -1121,7 +1129,7 @@ gnunet_conversation_gtk_refuse_button_clicked_cb (GtkButton *button, | |||
1121 | GNUNET_break (in_ring_counter > 0); | 1129 | GNUNET_break (in_ring_counter > 0); |
1122 | in_ring_counter--; | 1130 | in_ring_counter--; |
1123 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_REJECTED, | 1131 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_REJECTED, |
1124 | ic->caller_id, | 1132 | ic->caller_id_str, |
1125 | ic->caller_num); | 1133 | ic->caller_num); |
1126 | set_incoming_call_state (ic, | 1134 | set_incoming_call_state (ic, |
1127 | IN_STATE_NONE); | 1135 | IN_STATE_NONE); |
@@ -1198,10 +1206,10 @@ gnunet_conversation_gtk_resume_button_clicked_cb (GtkButton *button, | |||
1198 | GNUNET_CONVERSATION_caller_resume (ic->caller, | 1206 | GNUNET_CONVERSATION_caller_resume (ic->caller, |
1199 | speaker, mic); | 1207 | speaker, mic); |
1200 | GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_LOCAL, | 1208 | GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_LOCAL, |
1201 | ic->caller_id, | 1209 | ic->caller_id_str, |
1202 | ic->caller_num); | 1210 | ic->caller_num); |
1203 | gtk_entry_set_text (address_entry, | 1211 | gtk_entry_set_text (address_entry, |
1204 | ic->caller_id); | 1212 | ic->caller_id_str); |
1205 | update_gui (); | 1213 | update_gui (); |
1206 | return; | 1214 | return; |
1207 | } | 1215 | } |
@@ -1285,7 +1293,7 @@ gnunet_conversation_gtk_suspend_button_clicked_cb (GtkButton *button, | |||
1285 | { | 1293 | { |
1286 | /* incoming */ | 1294 | /* incoming */ |
1287 | GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_LOCAL, | 1295 | GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_LOCAL, |
1288 | active_in->caller_id, | 1296 | active_in->caller_id_str, |
1289 | active_in->caller_num); | 1297 | active_in->caller_num); |
1290 | GNUNET_CONVERSATION_caller_suspend (active_in->caller); | 1298 | GNUNET_CONVERSATION_caller_suspend (active_in->caller); |
1291 | switch ((is = active_in->state)) | 1299 | switch ((is = active_in->state)) |
@@ -1352,7 +1360,7 @@ gnunet_conversation_gtk_hangup_button_clicked_cb (GtkButton *button, | |||
1352 | { | 1360 | { |
1353 | /* if selected call is incoming, hang it up */ | 1361 | /* if selected call is incoming, hang it up */ |
1354 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, | 1362 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, |
1355 | active_in->caller_id, | 1363 | active_in->caller_id_str, |
1356 | active_in->caller_num); | 1364 | active_in->caller_num); |
1357 | set_incoming_call_state (active_in, | 1365 | set_incoming_call_state (active_in, |
1358 | IN_STATE_NONE); | 1366 | 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, | |||
2246 | * was part of a directory) | 2246 | * was part of a directory) |
2247 | * @param applicability_rank how relevant is the result | 2247 | * @param applicability_rank how relevant is the result |
2248 | * @return struct representing the search result (also stored in the tree | 2248 | * @return struct representing the search result (also stored in the tree |
2249 | * model at 'iter') | 2249 | * model) |
2250 | */ | 2250 | */ |
2251 | struct SearchResult * | 2251 | struct SearchResult * |
2252 | GNUNET_GTK_add_search_result (struct SearchTab *tab, | 2252 | GNUNET_GTK_add_search_result (struct SearchTab *tab, |
@@ -2512,6 +2512,7 @@ process_search_result (struct SearchTab *tab, | |||
2512 | uri, | 2512 | uri, |
2513 | meta, result, applicability_rank); | 2513 | meta, result, applicability_rank); |
2514 | update_search_label (tab); | 2514 | update_search_label (tab); |
2515 | GNUNET_break (NULL != sr); | ||
2515 | return sr; | 2516 | return sr; |
2516 | } | 2517 | } |
2517 | 2518 | ||
@@ -3978,6 +3979,7 @@ GNUNET_GTK_fs_event_handler (void *cls, | |||
3978 | info->value.search.specifics.resume_result. | 3979 | info->value.search.specifics.resume_result. |
3979 | availability_certainty, | 3980 | availability_certainty, |
3980 | GNUNET_TIME_UNIT_ZERO); | 3981 | GNUNET_TIME_UNIT_ZERO); |
3982 | GNUNET_break (NULL != ret); | ||
3981 | return ret; | 3983 | return ret; |
3982 | case GNUNET_FS_STATUS_SEARCH_SUSPEND: | 3984 | case GNUNET_FS_STATUS_SEARCH_SUSPEND: |
3983 | close_search_tab (info->value.search.cctx); | 3985 | close_search_tab (info->value.search.cctx); |