aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_lib_intern.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_lib_intern.c')
-rw-r--r--src/gnunet_chat_lib_intern.c54
1 files changed, 52 insertions, 2 deletions
diff --git a/src/gnunet_chat_lib_intern.c b/src/gnunet_chat_lib_intern.c
index 444f3c0..a430fe5 100644
--- a/src/gnunet_chat_lib_intern.c
+++ b/src/gnunet_chat_lib_intern.c
@@ -25,15 +25,36 @@
25#define GNUNET_UNUSED __attribute__ ((unused)) 25#define GNUNET_UNUSED __attribute__ ((unused))
26 26
27void 27void
28task_handle_destruction (void *cls)
29{
30 GNUNET_assert(cls);
31
32 struct GNUNET_CHAT_Handle *handle = (struct GNUNET_CHAT_Handle*) cls;
33
34 handle->destruction = NULL;
35 handle_destroy(handle);
36}
37
38void
28cb_account_creation (void *cls, 39cb_account_creation (void *cls,
29 const struct GNUNET_IDENTITY_PrivateKey *key, 40 const struct GNUNET_IDENTITY_PrivateKey *key,
30 const char *emsg) 41 const char *emsg)
31{ 42{
32 GNUNET_assert(cls); 43 GNUNET_assert(cls);
33 44
34 struct GNUNET_CHAT_Handle *handle = (struct GNUNET_CHAT_Handle*) cls; 45 struct GNUNET_CHAT_InternalAccounts *accounts = (
46 (struct GNUNET_CHAT_InternalAccounts*) cls
47 );
35 48
36 handle->creation_op = NULL; 49 struct GNUNET_CHAT_Handle *handle = accounts->handle;
50
51 GNUNET_CONTAINER_DLL_remove(
52 handle->accounts_head,
53 handle->accounts_tail,
54 accounts
55 );
56
57 GNUNET_free(accounts);
37 58
38 if (emsg) 59 if (emsg)
39 handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_WARNING, emsg); 60 handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_WARNING, emsg);
@@ -42,6 +63,35 @@ cb_account_creation (void *cls,
42} 63}
43 64
44void 65void
66cb_account_deletion (void *cls,
67 const char *emsg)
68{
69 GNUNET_assert(cls);
70
71 struct GNUNET_CHAT_InternalAccounts *accounts = (
72 (struct GNUNET_CHAT_InternalAccounts*) cls
73 );
74
75 struct GNUNET_CHAT_Handle *handle = accounts->handle;
76
77 if (emsg)
78 {
79 handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_WARNING, emsg);
80 return;
81 }
82
83 GNUNET_CONTAINER_DLL_remove(
84 handle->accounts_head,
85 handle->accounts_tail,
86 accounts
87 );
88
89 GNUNET_free(accounts);
90
91 handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_REFRESH, NULL);
92}
93
94void
45cb_lobby_lookup (void *cls, 95cb_lobby_lookup (void *cls,
46 uint32_t count, 96 uint32_t count,
47 const struct GNUNET_GNSRECORD_Data *data) 97 const struct GNUNET_GNSRECORD_Data *data)