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.c60
1 files changed, 21 insertions, 39 deletions
diff --git a/src/gnunet_chat_lib_intern.c b/src/gnunet_chat_lib_intern.c
index c4f570b..b9806a9 100644
--- a/src/gnunet_chat_lib_intern.c
+++ b/src/gnunet_chat_lib_intern.c
@@ -31,50 +31,32 @@ task_handle_destruction (void *cls)
31 31
32 struct GNUNET_CHAT_Handle *handle = (struct GNUNET_CHAT_Handle*) cls; 32 struct GNUNET_CHAT_Handle *handle = (struct GNUNET_CHAT_Handle*) cls;
33 33
34 handle->destruction = NULL; 34 struct GNUNET_CHAT_InternalAccounts *accounts = handle->accounts_head;
35 handle_destroy(handle); 35 while (accounts)
36} 36 {
37 37 if ((accounts->op) && (accounts->account))
38void 38 break;
39cb_account_creation (void *cls,
40 const struct GNUNET_IDENTITY_PrivateKey *key,
41 const char *emsg)
42{
43 GNUNET_assert(cls);
44
45 struct GNUNET_CHAT_InternalAccounts *accounts = (
46 (struct GNUNET_CHAT_InternalAccounts*) cls
47 );
48
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);
58
59 if (emsg)
60 handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_WARNING, emsg);
61 else if (key)
62 handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_REFRESH, NULL);
63}
64
65void
66cb_account_deletion (void *cls,
67 const char *emsg)
68{
69 GNUNET_assert(cls);
70 39
71 struct GNUNET_CHAT_Handle *handle = (struct GNUNET_CHAT_Handle*) cls; 40 accounts = accounts->next;
41 }
72 42
73 if (emsg) 43 if (accounts)
74 { 44 {
75 handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_WARNING, emsg); 45 handle->destruction = GNUNET_SCHEDULER_add_at_with_priority(
46 GNUNET_TIME_absolute_add(
47 GNUNET_TIME_absolute_get(),
48 GNUNET_TIME_relative_get_second_()
49 ),
50 GNUNET_SCHEDULER_PRIORITY_IDLE,
51 task_handle_destruction,
52 handle
53 );
54
76 return; 55 return;
77 } 56 }
57
58 handle->destruction = NULL;
59 handle_destroy(handle);
78} 60}
79 61
80void 62void