commit 59f4fc5b4ea2a5426446f9c81a1acaf104e71a8f
parent fba50c0338fb76feec7fee5a12e27fc57df1972b
Author: TheJackiMonster <thejackimonster@gmail.com>
Date: Thu, 10 Mar 2022 14:14:17 +0100
Override chat records if nick gets changed
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/gnunet_chat_context.c b/src/gnunet_chat_context.c
@@ -351,6 +351,8 @@ context_write_records (struct GNUNET_CHAT_Context *context)
GNUNET_h2s(hash)
);
+ printf("WRITE: %s -> %u (%s, %s)\n", label, count, nick, topic);
+
GNUNET_NAMESTORE_records_store(
context->handle->namestore,
zone,
diff --git 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,
return;
context_update_nick(contact->context, name);
+ context_write_records(contact->context);
}
@@ -506,10 +507,11 @@ void
GNUNET_CHAT_group_set_name (struct GNUNET_CHAT_Group *group,
const char *name)
{
- if (!group)
+ if ((!group) || (!(group->context)))
return;
- util_set_name_field(name, &(group->context->nick));
+ context_update_nick(group->context, name);
+ context_write_records(group->context);
}