aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_handle_intern.c
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2021-12-16 00:58:44 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2021-12-16 00:58:44 +0100
commit98852b955cacf792adc9a02682e3d23b5e6ee979 (patch)
tree8b6b5f3825046a31c5d1739eae1945df37fd106e /src/gnunet_chat_handle_intern.c
parentbf0bb934cc4c62c4aefedaab205ba0035747bdd4 (diff)
downloadlibgnunetchat-98852b955cacf792adc9a02682e3d23b5e6ee979.tar.gz
libgnunetchat-98852b955cacf792adc9a02682e3d23b5e6ee979.zip
Added function to check if a contact is owned by the account
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/gnunet_chat_handle_intern.c')
-rw-r--r--src/gnunet_chat_handle_intern.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gnunet_chat_handle_intern.c b/src/gnunet_chat_handle_intern.c
index 9f69611..d804545 100644
--- a/src/gnunet_chat_handle_intern.c
+++ b/src/gnunet_chat_handle_intern.c
@@ -464,6 +464,13 @@ on_handle_message (void *cls,
464 struct GNUNET_ShortHashCode shorthash; 464 struct GNUNET_ShortHashCode shorthash;
465 util_shorthash_from_member(sender, &shorthash); 465 util_shorthash_from_member(sender, &shorthash);
466 466
467 struct GNUNET_CHAT_Contact *contact = GNUNET_CONTAINER_multishortmap_get(
468 handle->contacts, &shorthash
469 );
470
471 if (flags & GNUNET_MESSENGER_FLAG_SENT)
472 contact->is_owned = GNUNET_YES;
473
467 struct GNUNET_TIME_Absolute *time = GNUNET_CONTAINER_multishortmap_get( 474 struct GNUNET_TIME_Absolute *time = GNUNET_CONTAINER_multishortmap_get(
468 context->timestamps, &shorthash 475 context->timestamps, &shorthash
469 ); 476 );
@@ -501,10 +508,6 @@ on_handle_message (void *cls,
501 { 508 {
502 case GNUNET_MESSENGER_KIND_KEY: 509 case GNUNET_MESSENGER_KIND_KEY:
503 { 510 {
504 struct GNUNET_CHAT_Contact *contact = GNUNET_CONTAINER_multishortmap_get(
505 handle->contacts, &shorthash
506 );
507
508 contact_update_key(contact); 511 contact_update_key(contact);
509 break; 512 break;
510 } 513 }