diff options
Diffstat (limited to 'src/gnunet_chat_invitation.c')
-rw-r--r-- | src/gnunet_chat_invitation.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gnunet_chat_invitation.c b/src/gnunet_chat_invitation.c index 44f7787..9562daa 100644 --- a/src/gnunet_chat_invitation.c +++ b/src/gnunet_chat_invitation.c | |||
@@ -24,14 +24,24 @@ | |||
24 | 24 | ||
25 | #include "gnunet_chat_invitation.h" | 25 | #include "gnunet_chat_invitation.h" |
26 | 26 | ||
27 | void | 27 | struct GNUNET_CHAT_Invitation* |
28 | GNUNET_CHAT_invitation_accept (struct GNUNET_CHAT_Invitation *invitation) | 28 | invitation_create_from_message (struct GNUNET_CHAT_Context *context, |
29 | const struct GNUNET_MESSENGER_MessageInvite *message) | ||
29 | { | 30 | { |
30 | //TODO | 31 | struct GNUNET_CHAT_Invitation *invitation = GNUNET_new(struct GNUNET_CHAT_Invitation); |
32 | |||
33 | invitation->context = context; | ||
34 | |||
35 | GNUNET_memcpy(&(invitation->key), &(message->key), sizeof(invitation->key)); | ||
36 | invitation->door = GNUNET_PEER_intern(&(message->door)); | ||
37 | |||
38 | return invitation; | ||
31 | } | 39 | } |
32 | 40 | ||
33 | void | 41 | void |
34 | GNUNET_CHAT_invitation_decline (struct GNUNET_CHAT_Invitation *invitation) | 42 | invitation_destroy (struct GNUNET_CHAT_Invitation *invitation) |
35 | { | 43 | { |
36 | //TODO | 44 | GNUNET_PEER_decrement_rcs(&(invitation->door), 1); |
45 | |||
46 | GNUNET_free(invitation); | ||
37 | } | 47 | } |