social api: some missing bits
authorGabor X Toth <*@tg-x.net>
Wed, 27 Jan 2016 20:45:38 +0000 (20:45 +0000)
committerGabor X Toth <*@tg-x.net>
Wed, 27 Jan 2016 20:45:38 +0000 (20:45 +0000)
src/include/gnunet_social_service.h
src/social/social_api.c
src/social/test_social.c

index 26b335facd8c64327844ed143c479bfc0f1ff67e..b8b452dfab52a064f7d6ab72b3a59588cb2da0d9 100644 (file)
@@ -814,12 +814,15 @@ GNUNET_SOCIAL_host_leave (struct GNUNET_SOCIAL_Host *hst,
  *        #GNUNET_OK on success, or
  *        #GNUNET_SYSERR on error, e.g. could not connect to the service, or
  *        could not resolve GNS name.
+ * @param place_pub_key
+ *        Public key of place.
  * @param max_message_id
  *        Last message ID sent to the place.
  *        Or 0 if no messages have been sent to the place yet.
  */
 typedef void
 (*GNUNET_SOCIAL_GuestEnterCallback) (void *cls, int result,
+                                     const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
                                      uint64_t max_message_id);
 
 
@@ -1068,6 +1071,18 @@ GNUNET_SOCIAL_guest_get_place (struct GNUNET_SOCIAL_Guest *guest);
 struct GNUNET_SOCIAL_HistoryRequest;
 
 
+/**
+ * Get the public key of a place.
+ *
+ * @param plc
+ *        Place.
+ *
+ * @return Public key of the place.
+ */
+const struct GNUNET_CRYPTO_EddsaPublicKey *
+GNUNET_SOCIAL_place_get_pub_key (const struct GNUNET_SOCIAL_Place *plc);
+
+
 /**
  * Set message processing @a flags for a @a method_prefix.
  *
index bcd263d03f8e76b746e936c1878e69910a4cadf3..0eafc852a89e168fdb9b2ee278723e08be2fab48 100644 (file)
@@ -871,7 +871,8 @@ guest_recv_enter_ack (void *cls,
     cres = (struct GNUNET_PSYC_CountersResultMessage *) msg;
   int32_t result = ntohl (cres->result_code);
   if (NULL != gst->enter_cb)
-    gst->enter_cb (gst->cb_cls, result, GNUNET_ntohll (cres->max_message_id));
+    gst->enter_cb (gst->cb_cls, result, &gst->plc.pub_key,
+                   GNUNET_ntohll (cres->max_message_id));
 }
 
 
@@ -1962,7 +1963,7 @@ GNUNET_SOCIAL_guest_get_place (struct GNUNET_SOCIAL_Guest *gst)
  * @return Public key of the place.
  */
 const struct GNUNET_CRYPTO_EddsaPublicKey *
-GNUNET_SOCIAL_place_get_key (struct GNUNET_SOCIAL_Place *plc)
+GNUNET_SOCIAL_place_get_pub_key (const struct GNUNET_SOCIAL_Place *plc)
 {
   return &plc->pub_key;
 }
index 2e9b270b65a669509c2e025258bba35ea861e6e3..2606e7fe8bfca76bd9047a8415f6f86ad5e9dd96 100644 (file)
@@ -382,7 +382,9 @@ host_reconnected (void *cls, int result,
 
 
 static void
-guest_reconnected (void *cls, int result, uint64_t max_message_id)
+guest_reconnected (void *cls, int result,
+                   const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
+                   uint64_t max_message_id)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
               "Test #%u: Guest reconnected to place: %d\n",
@@ -1098,7 +1100,9 @@ host_answer_door (void *cls,
 
 
 static void
-guest_recv_local_enter (void *cls, int result, uint64_t max_message_id)
+guest_recv_local_enter (void *cls, int result,
+                        const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
+                        uint64_t max_message_id)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
               "Test #%u: Guest entered to local place: %d\n",