summaryrefslogtreecommitdiff
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 @@
#define GNUNET_UNUSED __attribute__ ((unused))
void
+task_handle_destruction (void *cls)
+{
+ GNUNET_assert(cls);
+
+ struct GNUNET_CHAT_Handle *handle = (struct GNUNET_CHAT_Handle*) cls;
+
+ handle->destruction = NULL;
+ handle_destroy(handle);
+}
+
+void
cb_account_creation (void *cls,
const struct GNUNET_IDENTITY_PrivateKey *key,
const char *emsg)
{
GNUNET_assert(cls);
- struct GNUNET_CHAT_Handle *handle = (struct GNUNET_CHAT_Handle*) cls;
+ struct GNUNET_CHAT_InternalAccounts *accounts = (
+ (struct GNUNET_CHAT_InternalAccounts*) cls
+ );
- handle->creation_op = NULL;
+ struct GNUNET_CHAT_Handle *handle = accounts->handle;
+
+ GNUNET_CONTAINER_DLL_remove(
+ handle->accounts_head,
+ handle->accounts_tail,
+ accounts
+ );
+
+ GNUNET_free(accounts);
if (emsg)
handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_WARNING, emsg);
@@ -42,6 +63,35 @@ cb_account_creation (void *cls,
}
void
+cb_account_deletion (void *cls,
+ const char *emsg)
+{
+ GNUNET_assert(cls);
+
+ struct GNUNET_CHAT_InternalAccounts *accounts = (
+ (struct GNUNET_CHAT_InternalAccounts*) cls
+ );
+
+ struct GNUNET_CHAT_Handle *handle = accounts->handle;
+
+ if (emsg)
+ {
+ handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_WARNING, emsg);
+ return;
+ }
+
+ GNUNET_CONTAINER_DLL_remove(
+ handle->accounts_head,
+ handle->accounts_tail,
+ accounts
+ );
+
+ GNUNET_free(accounts);
+
+ handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_REFRESH, NULL);
+}
+
+void
cb_lobby_lookup (void *cls,
uint32_t count,
const struct GNUNET_GNSRECORD_Data *data)