aboutsummaryrefslogtreecommitdiff
path: root/src/ui/contact_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/contact_info.c')
-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?