diff options
Diffstat (limited to 'src/gnunet_chat_handle_intern.c')
-rw-r--r-- | src/gnunet_chat_handle_intern.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gnunet_chat_handle_intern.c b/src/gnunet_chat_handle_intern.c index f9bc0fe..46243f8 100644 --- a/src/gnunet_chat_handle_intern.c +++ b/src/gnunet_chat_handle_intern.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "gnunet_chat_handle.h" | 29 | #include "gnunet_chat_handle.h" |
30 | #include "gnunet_chat_invitation.h" | 30 | #include "gnunet_chat_invitation.h" |
31 | #include "gnunet_chat_message.h" | 31 | #include "gnunet_chat_message.h" |
32 | #include "gnunet_chat_ticket.h" | ||
32 | #include "gnunet_chat_util.h" | 33 | #include "gnunet_chat_util.h" |
33 | 34 | ||
34 | #include <gnunet/gnunet_common.h> | 35 | #include <gnunet/gnunet_common.h> |
@@ -47,6 +48,7 @@ static const char gnunet_service_name_gns [] = "gns"; | |||
47 | static const char gnunet_service_name_identity [] = "identity"; | 48 | static const char gnunet_service_name_identity [] = "identity"; |
48 | static const char gnunet_service_name_messenger [] = "messenger"; | 49 | static const char gnunet_service_name_messenger [] = "messenger"; |
49 | static const char gnunet_service_name_namestore [] = "namestore"; | 50 | static const char gnunet_service_name_namestore [] = "namestore"; |
51 | static const char gnunet_service_name_reclaim [] = "reclaim"; | ||
50 | 52 | ||
51 | void | 53 | void |
52 | on_handle_shutdown(void *cls) | 54 | on_handle_shutdown(void *cls) |
@@ -97,6 +99,12 @@ on_handle_arm_connection(void *cls, | |||
97 | GNUNET_OS_INHERIT_STD_NONE, | 99 | GNUNET_OS_INHERIT_STD_NONE, |
98 | NULL, NULL | 100 | NULL, NULL |
99 | ); | 101 | ); |
102 | |||
103 | GNUNET_ARM_request_service_start( | ||
104 | chat->arm, gnunet_service_name_reclaim, | ||
105 | GNUNET_OS_INHERIT_STD_NONE, | ||
106 | NULL, NULL | ||
107 | ); | ||
100 | } else { | 108 | } else { |
101 | GNUNET_ARM_request_service_start( | 109 | GNUNET_ARM_request_service_start( |
102 | chat->arm, gnunet_service_name_arm, | 110 | chat->arm, gnunet_service_name_arm, |
@@ -919,6 +927,32 @@ on_handle_message (void *cls, | |||
919 | ); | 927 | ); |
920 | break; | 928 | break; |
921 | } | 929 | } |
930 | case GNUNET_MESSENGER_KIND_TICKET: | ||
931 | { | ||
932 | struct GNUNET_CHAT_InternalTickets *tickets = GNUNET_new( | ||
933 | struct GNUNET_CHAT_InternalTickets | ||
934 | ); | ||
935 | |||
936 | if (!tickets) | ||
937 | break; | ||
938 | |||
939 | tickets->ticket = ticket_create_from_message( | ||
940 | handle, sender, &(msg->body.ticket) | ||
941 | ); | ||
942 | |||
943 | if (!tickets->ticket) | ||
944 | { | ||
945 | GNUNET_free(tickets); | ||
946 | break; | ||
947 | } | ||
948 | |||
949 | GNUNET_CONTAINER_DLL_insert_tail( | ||
950 | contact->tickets_head, | ||
951 | contact->tickets_tail, | ||
952 | tickets | ||
953 | ); | ||
954 | break; | ||
955 | } | ||
922 | default: | 956 | default: |
923 | break; | 957 | break; |
924 | } | 958 | } |