aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-01-27 20:45:38 +0000
committerGabor X Toth <*@tg-x.net>2016-01-27 20:45:38 +0000
commitbc88a11b2a64ee389f1eb29eb30487fc5f22a475 (patch)
tree6b1943d4d2c7fa4e75e66564f6c99136418b49da /src
parentd4ffe9082fa632d5696611dc5977852cc6397bce (diff)
downloadgnunet-bc88a11b2a64ee389f1eb29eb30487fc5f22a475.tar.gz
gnunet-bc88a11b2a64ee389f1eb29eb30487fc5f22a475.zip
social api: some missing bits
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_social_service.h15
-rw-r--r--src/social/social_api.c5
-rw-r--r--src/social/test_social.c8
3 files changed, 24 insertions, 4 deletions
diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h
index 26b335fac..b8b452dfa 100644
--- a/src/include/gnunet_social_service.h
+++ b/src/include/gnunet_social_service.h
@@ -814,12 +814,15 @@ GNUNET_SOCIAL_host_leave (struct GNUNET_SOCIAL_Host *hst,
814 * #GNUNET_OK on success, or 814 * #GNUNET_OK on success, or
815 * #GNUNET_SYSERR on error, e.g. could not connect to the service, or 815 * #GNUNET_SYSERR on error, e.g. could not connect to the service, or
816 * could not resolve GNS name. 816 * could not resolve GNS name.
817 * @param place_pub_key
818 * Public key of place.
817 * @param max_message_id 819 * @param max_message_id
818 * Last message ID sent to the place. 820 * Last message ID sent to the place.
819 * Or 0 if no messages have been sent to the place yet. 821 * Or 0 if no messages have been sent to the place yet.
820 */ 822 */
821typedef void 823typedef void
822(*GNUNET_SOCIAL_GuestEnterCallback) (void *cls, int result, 824(*GNUNET_SOCIAL_GuestEnterCallback) (void *cls, int result,
825 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
823 uint64_t max_message_id); 826 uint64_t max_message_id);
824 827
825 828
@@ -1069,6 +1072,18 @@ struct GNUNET_SOCIAL_HistoryRequest;
1069 1072
1070 1073
1071/** 1074/**
1075 * Get the public key of a place.
1076 *
1077 * @param plc
1078 * Place.
1079 *
1080 * @return Public key of the place.
1081 */
1082const struct GNUNET_CRYPTO_EddsaPublicKey *
1083GNUNET_SOCIAL_place_get_pub_key (const struct GNUNET_SOCIAL_Place *plc);
1084
1085
1086/**
1072 * Set message processing @a flags for a @a method_prefix. 1087 * Set message processing @a flags for a @a method_prefix.
1073 * 1088 *
1074 * @param plc 1089 * @param plc
diff --git a/src/social/social_api.c b/src/social/social_api.c
index bcd263d03..0eafc852a 100644
--- a/src/social/social_api.c
+++ b/src/social/social_api.c
@@ -871,7 +871,8 @@ guest_recv_enter_ack (void *cls,
871 cres = (struct GNUNET_PSYC_CountersResultMessage *) msg; 871 cres = (struct GNUNET_PSYC_CountersResultMessage *) msg;
872 int32_t result = ntohl (cres->result_code); 872 int32_t result = ntohl (cres->result_code);
873 if (NULL != gst->enter_cb) 873 if (NULL != gst->enter_cb)
874 gst->enter_cb (gst->cb_cls, result, GNUNET_ntohll (cres->max_message_id)); 874 gst->enter_cb (gst->cb_cls, result, &gst->plc.pub_key,
875 GNUNET_ntohll (cres->max_message_id));
875} 876}
876 877
877 878
@@ -1962,7 +1963,7 @@ GNUNET_SOCIAL_guest_get_place (struct GNUNET_SOCIAL_Guest *gst)
1962 * @return Public key of the place. 1963 * @return Public key of the place.
1963 */ 1964 */
1964const struct GNUNET_CRYPTO_EddsaPublicKey * 1965const struct GNUNET_CRYPTO_EddsaPublicKey *
1965GNUNET_SOCIAL_place_get_key (struct GNUNET_SOCIAL_Place *plc) 1966GNUNET_SOCIAL_place_get_pub_key (const struct GNUNET_SOCIAL_Place *plc)
1966{ 1967{
1967 return &plc->pub_key; 1968 return &plc->pub_key;
1968} 1969}
diff --git a/src/social/test_social.c b/src/social/test_social.c
index 2e9b270b6..2606e7fe8 100644
--- a/src/social/test_social.c
+++ b/src/social/test_social.c
@@ -382,7 +382,9 @@ host_reconnected (void *cls, int result,
382 382
383 383
384static void 384static void
385guest_reconnected (void *cls, int result, uint64_t max_message_id) 385guest_reconnected (void *cls, int result,
386 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
387 uint64_t max_message_id)
386{ 388{
387 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 389 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
388 "Test #%u: Guest reconnected to place: %d\n", 390 "Test #%u: Guest reconnected to place: %d\n",
@@ -1098,7 +1100,9 @@ host_answer_door (void *cls,
1098 1100
1099 1101
1100static void 1102static void
1101guest_recv_local_enter (void *cls, int result, uint64_t max_message_id) 1103guest_recv_local_enter (void *cls, int result,
1104 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
1105 uint64_t max_message_id)
1102{ 1106{
1103 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1107 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1104 "Test #%u: Guest entered to local place: %d\n", 1108 "Test #%u: Guest entered to local place: %d\n",