gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r33552 - in gnunet-gtk/src: conversation fs


From: gnunet
Subject: [GNUnet-SVN] r33552 - in gnunet-gtk/src: conversation fs
Date: Fri, 6 Jun 2014 10:43:31 +0200

Author: grothoff
Date: 2014-06-06 10:43:31 +0200 (Fri, 06 Jun 2014)
New Revision: 33552

Modified:
   gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c
   gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
Log:
handling API change from addressing #3431

Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c 2014-06-06 
08:43:16 UTC (rev 33551)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c 2014-06-06 
08:43:31 UTC (rev 33552)
@@ -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,11 +197,16 @@
   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.
    */
   GtkTreeRowReference *rr;
@@ -416,7 +422,7 @@
     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 @@
  * @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 @@
     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 @@
                                         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 @@
         {
           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 @@
   {
   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 @@
     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 @@
                                       &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_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_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 @@
   {
     /* 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 @@
   {
     /* 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);

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c     2014-06-06 08:43:16 UTC 
(rev 33551)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c     2014-06-06 08:43:31 UTC 
(rev 33552)
@@ -2246,7 +2246,7 @@
  *                        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 @@
                                     uri,
                                      meta, result, applicability_rank);
   update_search_label (tab);
+  GNUNET_break (NULL != sr);
   return sr;
 }
 
@@ -3978,6 +3979,7 @@
                          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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]