From c7a00a4aba32984b4d3cc8fc5bb1039f4f6cc224 Mon Sep 17 00:00:00 2001 From: TingPing Date: Wed, 25 Sep 2013 17:16:47 -0400 Subject: Only show users country if its not unknown --- src/fe-gtk/menu.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/fe-gtk/menu.c') diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index 20daa398..feb80157 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -600,7 +600,7 @@ menu_create_nickinfo_menu (struct User *user, GtkWidget *submenu) { char buf[512]; char unknown[96]; - char *real, *fmt; + char *real, *fmt, *users_country; struct away_msg *away; gboolean missing = FALSE; GtkWidget *item; @@ -637,12 +637,14 @@ menu_create_nickinfo_menu (struct User *user, GtkWidget *submenu) G_CALLBACK (copy_to_clipboard_cb), user->account ? user->account : unknown); - snprintf (buf, sizeof (buf), fmt, _("Country:"), - user->hostname ? country(user->hostname) : unknown); - item = menu_quick_item (0, buf, submenu, XCMENU_MARKUP, 0, 0); - g_signal_connect (G_OBJECT (item), "activate", - G_CALLBACK (copy_to_clipboard_cb), - user->hostname ? country(user->hostname) : unknown); + users_country = country (user->hostname); + if (users_country) + { + snprintf (buf, sizeof (buf), fmt, _ ("Country:"), users_country); + item = menu_quick_item (0, buf, submenu, XCMENU_MARKUP, 0, 0); + g_signal_connect (G_OBJECT (item), "activate", + G_CALLBACK (copy_to_clipboard_cb), users_country); + } snprintf (buf, sizeof (buf), fmt, _("Server:"), user->servername ? user->servername : unknown); -- cgit 1.4.1