summary refs log tree commit diff stats
path: root/src/fe-gtk
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-06-12 15:01:39 -0400
committerPatrick Griffis <tingping@tingping.se>2016-06-12 15:01:39 -0400
commitc12f33aa4c0871174c0a035e46fa2e3c75822dc4 (patch)
tree4a72af88ef4fd7beaeb1ab15967381de1e08f089 /src/fe-gtk
parenta031a24cfd374fde868eb1ad7ffb36a9bff637ea (diff)
servlistgui: Error if nicks left empty
Diffstat (limited to 'src/fe-gtk')
-rw-r--r--src/fe-gtk/servlistgui.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c
index b64cf78c..6ef455fd 100644
--- a/src/fe-gtk/servlistgui.c
+++ b/src/fe-gtk/servlistgui.c
@@ -1570,7 +1570,15 @@ servlist_nick_changed_cb (GtkEntry *entry, gpointer userdata)
 	const gchar *nick1 = gtk_entry_get_text (GTK_ENTRY (entry_nick1));
 	const gchar *nick2 = gtk_entry_get_text (GTK_ENTRY (entry_nick2));
 
-	if (!rfc_casecmp (nick1, nick2))
+	if (!nick1[0] || !nick2[0])
+	{
+		entry = GTK_ENTRY(!nick1[0] ? entry_nick1 : entry_nick2);
+		gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIALOG_ERROR);
+		gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_SECONDARY,
+		                                 _("You cannot have an empty nick name."));
+		gtk_widget_set_sensitive (connect_btn, FALSE);
+	}
+	else if (!rfc_casecmp (nick1, nick2))
 	{
 		gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIALOG_ERROR);
 		gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_SECONDARY,