summaryrefslogtreecommitdiff
path: root/src/gnunet_chat_lobby.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_lobby.c')
-rw-r--r--src/gnunet_chat_lobby.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gnunet_chat_lobby.c b/src/gnunet_chat_lobby.c
index c6d0327..4887ad8 100644
--- a/src/gnunet_chat_lobby.c
+++ b/src/gnunet_chat_lobby.c
@@ -53,6 +53,26 @@ lobby_destroy (struct GNUNET_CHAT_Lobby *lobby)
{
GNUNET_assert(lobby);
+ if ((!(lobby->op)) && (!(lobby->query)))
+ goto skip_deletion;
+
+ if (lobby->context)
+ {
+ const struct GNUNET_HashCode *key = GNUNET_MESSENGER_room_get_key(
+ lobby->context->room
+ );
+
+ if (!key)
+ goto skip_deletion;
+
+ char *name;
+ util_lobby_name(key, &name);
+
+ handle_delete_account(lobby->handle, name);
+ GNUNET_free(name);
+ }
+
+skip_deletion:
if (lobby->op)
GNUNET_IDENTITY_cancel(lobby->op);