libgnunetchat

library for GNUnet Messenger
Log | Files | Refs | README | LICENSE

commit b1bdff775febc37640781880b122e9cd3d64f533
parent f2ede88a78c637deb809a0a7cc4433df46a10031
Author: Jacki <jacki@thejackimonster.de>
Date:   Sat, 23 Mar 2024 15:43:05 +0100

Fix iterating through files

Signed-off-by: Jacki <jacki@thejackimonster.de>

Diffstat:
Msrc/gnunet_chat_lib.c | 10++++++++--
Msrc/gnunet_chat_lib_intern.c | 4++--
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c @@ -231,11 +231,17 @@ GNUNET_CHAT_set_name (struct GNUNET_CHAT_Handle *handle, return GNUNET_NO; char *low = util_get_lower(name); + int result; if (handle->current) - handle_rename_account(handle, handle->current->name, low); + result = handle_rename_account(handle, handle->current->name, low); + else + result = GNUNET_OK; + + if (GNUNET_OK != result) + return result; - int result = GNUNET_MESSENGER_set_name(handle->messenger, low); + result = GNUNET_MESSENGER_set_name(handle->messenger, low); GNUNET_free(low); return result; diff --git a/src/gnunet_chat_lib_intern.c b/src/gnunet_chat_lib_intern.c @@ -324,11 +324,11 @@ it_context_iterate_files (void *cls, it->context->messages, key ); - if (!message) + if ((!message) || (! message->msg)) return GNUNET_YES; struct GNUNET_CHAT_File *file = GNUNET_CONTAINER_multihashmap_get( - it->context->handle->files, &(message->hash) + it->context->handle->files, &(message->msg->body.file.hash) ); if (!file)