aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-03-10 14:14:17 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2022-03-10 14:14:17 +0100
commit59f4fc5b4ea2a5426446f9c81a1acaf104e71a8f (patch)
tree4a91f564586e6a90ea15390ae315465b8c1e6223
parentfba50c0338fb76feec7fee5a12e27fc57df1972b (diff)
downloadlibgnunetchat-59f4fc5b4ea2a5426446f9c81a1acaf104e71a8f.tar.gz
libgnunetchat-59f4fc5b4ea2a5426446f9c81a1acaf104e71a8f.zip
Override chat records if nick gets changed
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--src/gnunet_chat_context.c2
-rw-r--r--src/gnunet_chat_lib.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gnunet_chat_context.c b/src/gnunet_chat_context.c
index cf7046b..7b6e36d 100644
--- a/src/gnunet_chat_context.c
+++ b/src/gnunet_chat_context.c
@@ -351,6 +351,8 @@ context_write_records (struct GNUNET_CHAT_Context *context)
351 GNUNET_h2s(hash) 351 GNUNET_h2s(hash)
352 ); 352 );
353 353
354 printf("WRITE: %s -> %u (%s, %s)\n", label, count, nick, topic);
355
354 GNUNET_NAMESTORE_records_store( 356 GNUNET_NAMESTORE_records_store(
355 context->handle->namestore, 357 context->handle->namestore,
356 zone, 358 zone,
diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c
index 8c6a109..3dce0c5 100644
--- a/src/gnunet_chat_lib.c
+++ b/src/gnunet_chat_lib.c
@@ -396,6 +396,7 @@ GNUNET_CHAT_contact_set_name (struct GNUNET_CHAT_Contact *contact,
396 return; 396 return;
397 397
398 context_update_nick(contact->context, name); 398 context_update_nick(contact->context, name);
399 context_write_records(contact->context);
399} 400}
400 401
401 402
@@ -506,10 +507,11 @@ void
506GNUNET_CHAT_group_set_name (struct GNUNET_CHAT_Group *group, 507GNUNET_CHAT_group_set_name (struct GNUNET_CHAT_Group *group,
507 const char *name) 508 const char *name)
508{ 509{
509 if (!group) 510 if ((!group) || (!(group->context)))
510 return; 511 return;
511 512
512 util_set_name_field(name, &(group->context->nick)); 513 context_update_nick(group->context, name);
514 context_write_records(group->context);
513} 515}
514 516
515 517