diff options
Diffstat (limited to 'src/social/social_api.c')
-rw-r--r-- | src/social/social_api.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/social/social_api.c b/src/social/social_api.c index 76fd0f9f9..dfcf18883 100644 --- a/src/social/social_api.c +++ b/src/social/social_api.c | |||
@@ -640,8 +640,9 @@ host_recv_enter_ack (void *cls, | |||
640 | 640 | ||
641 | struct GNUNET_PSYC_CountersResultMessage * | 641 | struct GNUNET_PSYC_CountersResultMessage * |
642 | cres = (struct GNUNET_PSYC_CountersResultMessage *) msg; | 642 | cres = (struct GNUNET_PSYC_CountersResultMessage *) msg; |
643 | int32_t result = ntohl (cres->result_code) + INT32_MIN; | ||
643 | if (NULL != hst->enter_cb) | 644 | if (NULL != hst->enter_cb) |
644 | hst->enter_cb (hst->cb_cls, GNUNET_ntohll (cres->max_message_id)); | 645 | hst->enter_cb (hst->cb_cls, result, GNUNET_ntohll (cres->max_message_id)); |
645 | } | 646 | } |
646 | 647 | ||
647 | 648 | ||
@@ -704,9 +705,9 @@ guest_recv_enter_ack (void *cls, | |||
704 | 705 | ||
705 | struct GNUNET_PSYC_CountersResultMessage * | 706 | struct GNUNET_PSYC_CountersResultMessage * |
706 | cres = (struct GNUNET_PSYC_CountersResultMessage *) msg; | 707 | cres = (struct GNUNET_PSYC_CountersResultMessage *) msg; |
708 | int32_t result = ntohl (cres->result_code) + INT32_MIN; | ||
707 | if (NULL != gst->enter_cb) | 709 | if (NULL != gst->enter_cb) |
708 | gst->enter_cb (gst->cb_cls, ntohl (cres->result_code), | 710 | gst->enter_cb (gst->cb_cls, result, GNUNET_ntohll (cres->max_message_id)); |
709 | GNUNET_ntohll (cres->max_message_id)); | ||
710 | } | 711 | } |
711 | 712 | ||
712 | 713 | ||
@@ -734,7 +735,7 @@ static struct GNUNET_CLIENT_MANAGER_MessageHandler host_handlers[] = | |||
734 | { | 735 | { |
735 | { &host_recv_enter_ack, NULL, | 736 | { &host_recv_enter_ack, NULL, |
736 | GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK, | 737 | GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK, |
737 | sizeof (struct CountersResult), GNUNET_NO }, | 738 | sizeof (struct GNUNET_PSYC_CountersResultMessage), GNUNET_NO }, |
738 | 739 | ||
739 | { &host_recv_enter_request, NULL, | 740 | { &host_recv_enter_request, NULL, |
740 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, | 741 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, |
@@ -758,7 +759,7 @@ static struct GNUNET_CLIENT_MANAGER_MessageHandler guest_handlers[] = | |||
758 | { | 759 | { |
759 | { &guest_recv_enter_ack, NULL, | 760 | { &guest_recv_enter_ack, NULL, |
760 | GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_ACK, | 761 | GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_ACK, |
761 | sizeof (struct CountersResult), GNUNET_NO }, | 762 | sizeof (struct GNUNET_PSYC_CountersResultMessage), GNUNET_NO }, |
762 | 763 | ||
763 | { &host_recv_enter_request, NULL, | 764 | { &host_recv_enter_request, NULL, |
764 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, | 765 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, |
@@ -1598,18 +1599,22 @@ struct GNUNET_SOCIAL_WatchHandle; | |||
1598 | /** | 1599 | /** |
1599 | * Watch a place for changed objects. | 1600 | * Watch a place for changed objects. |
1600 | * | 1601 | * |
1601 | * @param place Place to watch. | 1602 | * @param place |
1602 | * @param object_filter Object prefix to match. | 1603 | * Place to watch. |
1603 | * @param state_cb Function to call when an object/state changes. | 1604 | * @param object_filter |
1604 | * @param state_cb_cls Closure for callback. | 1605 | * Object prefix to match. |
1606 | * @param state_var_cb | ||
1607 | * Function to call when an object/state var changes. | ||
1608 | * @param cls | ||
1609 | * Closure for callback. | ||
1605 | * | 1610 | * |
1606 | * @return Handle that can be used to cancel watching. | 1611 | * @return Handle that can be used to cancel watching. |
1607 | */ | 1612 | */ |
1608 | struct GNUNET_SOCIAL_WatchHandle * | 1613 | struct GNUNET_SOCIAL_WatchHandle * |
1609 | GNUNET_SOCIAL_place_watch (struct GNUNET_SOCIAL_Place *place, | 1614 | GNUNET_SOCIAL_place_watch (struct GNUNET_SOCIAL_Place *place, |
1610 | const char *object_filter, | 1615 | const char *object_filter, |
1611 | GNUNET_PSYC_StateCallback state_cb, | 1616 | GNUNET_PSYC_StateVarCallback state_var_cb, |
1612 | void *state_cb_cls) | 1617 | void *cls) |
1613 | { | 1618 | { |
1614 | return NULL; | 1619 | return NULL; |
1615 | } | 1620 | } |
@@ -1633,18 +1638,22 @@ struct GNUNET_SOCIAL_LookHandle; | |||
1633 | /** | 1638 | /** |
1634 | * Look at objects in the place with a matching name prefix. | 1639 | * Look at objects in the place with a matching name prefix. |
1635 | * | 1640 | * |
1636 | * @param place The place to look its objects at. | 1641 | * @param place |
1637 | * @param name_prefix Look at objects with names beginning with this value. | 1642 | * The place to look its objects at. |
1638 | * @param state_cb Function to call for each object found. | 1643 | * @param name_prefix |
1639 | * @param state_cb_cls Closure for callback function. | 1644 | * Look at objects with names beginning with this value. |
1645 | * @param state_var_cb | ||
1646 | * Function to call for each object found. | ||
1647 | * @param cls | ||
1648 | * Closure for callback function. | ||
1640 | * | 1649 | * |
1641 | * @return Handle that can be used to stop looking at objects. | 1650 | * @return Handle that can be used to stop looking at objects. |
1642 | */ | 1651 | */ |
1643 | struct GNUNET_SOCIAL_LookHandle * | 1652 | struct GNUNET_SOCIAL_LookHandle * |
1644 | GNUNET_SOCIAL_place_look (struct GNUNET_SOCIAL_Place *place, | 1653 | GNUNET_SOCIAL_place_look (struct GNUNET_SOCIAL_Place *place, |
1645 | const char *name_prefix, | 1654 | const char *name_prefix, |
1646 | GNUNET_PSYC_StateCallback state_cb, | 1655 | GNUNET_PSYC_StateVarCallback state_var_cb, |
1647 | void *state_cb_cls) | 1656 | void *cls) |
1648 | { | 1657 | { |
1649 | return NULL; | 1658 | return NULL; |
1650 | } | 1659 | } |