aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-03-17 13:48:53 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2022-03-17 13:48:53 +0100
commit3a89feb75936fb70c5852e8254d225ed7a20a0fb (patch)
tree10f32067f618fcafadedd4ede0a9229fee4622c3
parentf52675513361ac166800d2216969ab370c845318 (diff)
downloadmessenger-gtk-3a89feb75936fb70c5852e8254d225ed7a20a0fb.tar.gz
messenger-gtk-3a89feb75936fb70c5852e8254d225ed7a20a0fb.zip
Adjusted setting a custom name to renaming identity with your contact
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--src/ui/contact_info.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/ui/contact_info.c b/src/ui/contact_info.c
index 9952ab6..0bd7c58 100644
--- a/src/ui/contact_info.c
+++ b/src/ui/contact_info.c
@@ -44,14 +44,24 @@ handle_contact_edit_button_click(UNUSED GtkButton *button,
44 ) 44 )
45 ); 45 );
46 46
47 if ((!editable) || (!contact))
48 goto skip_change_name;
49
47 const gchar *name = gtk_entry_get_text(handle->contact_name_entry); 50 const gchar *name = gtk_entry_get_text(handle->contact_name_entry);
48 51
49 if ((editable) && (contact)) 52 if ((name) && (0 == g_utf8_strlen(name, 1)))
50 GNUNET_CHAT_contact_set_name( 53 name = NULL;
51 contact, 54
52 (name) && (g_utf8_strlen(name, 1))? name : NULL 55 if (GNUNET_CHAT_contact_is_owned(contact))
53 ); 56 if (GNUNET_YES != GNUNET_CHAT_set_name(contact, name))
57 gtk_entry_set_text(
58 handle->contact_name_entry,
59 GNUNET_CHAT_contact_get_name(contact)
60 );
61 else
62 GNUNET_CHAT_contact_set_name(contact, name);
54 63
64skip_change_name:
55 gtk_image_set_from_icon_name( 65 gtk_image_set_from_icon_name(
56 handle->contact_edit_symbol, 66 handle->contact_edit_symbol,
57 editable? 67 editable?