aboutsummaryrefslogtreecommitdiff
path: root/src/social/gnunet-service-social.c
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-05-05 11:33:40 +0000
committerGabor X Toth <*@tg-x.net>2016-05-05 11:33:40 +0000
commit78edac9543fa364868e9570080b46a153ec5fad4 (patch)
tree2d4bf8e2d41e4ab0c789ef6f0553f3c3a22d0f2c /src/social/gnunet-service-social.c
parent2b987c3684cbf1d15b9ed44bbce911653bd6f330 (diff)
downloadgnunet-78edac9543fa364868e9570080b46a153ec5fad4.tar.gz
gnunet-78edac9543fa364868e9570080b46a153ec5fad4.zip
social: app connected callback
Diffstat (limited to 'src/social/gnunet-service-social.c')
-rw-r--r--src/social/gnunet-service-social.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c
index 03a113d7e..e2d6544c1 100644
--- a/src/social/gnunet-service-social.c
+++ b/src/social/gnunet-service-social.c
@@ -432,7 +432,7 @@ place_entry_cleanup (void *cls,
432 void *value) 432 void *value)
433{ 433{
434 struct Place *plc = value; 434 struct Place *plc = value;
435 435
436 cleanup_place (plc); 436 cleanup_place (plc);
437 return GNUNET_YES; 437 return GNUNET_YES;
438} 438}
@@ -538,7 +538,7 @@ static void
538cleanup_place (void *cls) 538cleanup_place (void *cls)
539{ 539{
540 struct Place *plc = cls; 540 struct Place *plc = cls;
541 541
542 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 542 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
543 "%p Cleaning up place %s\n", 543 "%p Cleaning up place %s\n",
544 plc, GNUNET_h2s (&plc->pub_key_hash)); 544 plc, GNUNET_h2s (&plc->pub_key_hash));
@@ -1945,6 +1945,21 @@ app_notify_place (struct GNUNET_MessageHeader *msg,
1945 1945
1946 1946
1947void 1947void
1948app_notify_place_end (struct GNUNET_SERVER_Client *client)
1949{
1950 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1951 "%p Sending end of place list notification to client\n",
1952 client);
1953
1954 struct GNUNET_MessageHeader msg;
1955 msg.type = htons (GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE_END);
1956 msg.size = htons (sizeof (msg));
1957
1958 client_send_msg (client, &msg);
1959}
1960
1961
1962void
1948app_notify_ego (struct Ego *ego, struct GNUNET_SERVER_Client *client) 1963app_notify_ego (struct Ego *ego, struct GNUNET_SERVER_Client *client)
1949{ 1964{
1950 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1965 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1964,6 +1979,21 @@ app_notify_ego (struct Ego *ego, struct GNUNET_SERVER_Client *client)
1964} 1979}
1965 1980
1966 1981
1982void
1983app_notify_ego_end (struct GNUNET_SERVER_Client *client)
1984{
1985 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1986 "%p Sending end of ego list notification to client\n",
1987 client);
1988
1989 struct GNUNET_MessageHeader msg;
1990 msg.type = htons (GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO_END);
1991 msg.size = htons (sizeof (msg));
1992
1993 client_send_msg (client, &msg);
1994}
1995
1996
1967int 1997int
1968app_place_entry_notify (void *cls, const struct GNUNET_HashCode *key, void *value) 1998app_place_entry_notify (void *cls, const struct GNUNET_HashCode *key, void *value)
1969{ 1999{
@@ -2008,11 +2038,13 @@ client_recv_app_connect (void *cls, struct GNUNET_SERVER_Client *client,
2008 GNUNET_CRYPTO_hash (app_id, app_id_size, &app_id_hash); 2038 GNUNET_CRYPTO_hash (app_id, app_id_size, &app_id_hash);
2009 2039
2010 GNUNET_CONTAINER_multihashmap_iterate (egos, ego_entry, client); 2040 GNUNET_CONTAINER_multihashmap_iterate (egos, ego_entry, client);
2041 app_notify_ego_end (client);
2011 2042
2012 struct GNUNET_CONTAINER_MultiHashMap * 2043 struct GNUNET_CONTAINER_MultiHashMap *
2013 app_places = GNUNET_CONTAINER_multihashmap_get (apps_places, &app_id_hash); 2044 app_places = GNUNET_CONTAINER_multihashmap_get (apps_places, &app_id_hash);
2014 if (NULL != app_places) 2045 if (NULL != app_places)
2015 GNUNET_CONTAINER_multihashmap_iterate (app_places, app_place_entry_notify, client); 2046 GNUNET_CONTAINER_multihashmap_iterate (app_places, app_place_entry_notify, client);
2047 app_notify_place_end (client);
2016 2048
2017 struct ClientListItem *cli = GNUNET_new (struct ClientListItem); 2049 struct ClientListItem *cli = GNUNET_new (struct ClientListItem);
2018 cli->client = client; 2050 cli->client = client;