libgnunetchat

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

commit ec93d39f8b98bc5e0112c7207e329bdb1ebf3d51
parent e3ee2f9331df815a7144590a3dbe481bc0b8057c
Author: Jacki <jacki@thejackimonster.de>
Date:   Fri, 13 Jun 2025 17:57:04 +0200

Optimize automatic requests to not ask for known messages or empty ends

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

Diffstat:
Msrc/gnunet_chat_context.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gnunet_chat_context.c b/src/gnunet_chat_context.c @@ -193,6 +193,10 @@ context_request_message (struct GNUNET_CHAT_Context* context, { GNUNET_assert((context) && (hash)); + if ((GNUNET_is_zero(hash)) || + (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains(context->messages, hash))) + return; + if (GNUNET_OK != GNUNET_CONTAINER_multihashmap_put(context->requests, hash, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE)) return;