summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/common/hexchat.h1
-rw-r--r--src/common/modes.c6
-rw-r--r--src/common/proto-irc.c8
-rw-r--r--src/common/server.c1
-rw-r--r--src/common/util.c11
-rw-r--r--src/common/util.h1
-rw-r--r--src/fe-gtk/maingui.c6
-rw-r--r--src/fe-gtk/plugin-tray.c4
-rw-r--r--src/fe-gtk/setup.c26
-rw-r--r--src/fe-gtk/userlistgui.c4
10 files changed, 45 insertions, 23 deletions
diff --git a/src/common/hexchat.h b/src/common/hexchat.h
index e234c976..f734472d 100644
--- a/src/common/hexchat.h
+++ b/src/common/hexchat.h
@@ -572,7 +572,6 @@ typedef struct server
 	unsigned int have_namesx:1;		/* 005 tokens NAMESX and UHNAMES */
 	unsigned int have_uhnames:1;
 	unsigned int have_whox:1;		/* have undernet's WHOX features */
-	unsigned int have_capab:1;		/* supports CAPAB (005 tells us) */
 	unsigned int have_idmsg:1;		/* freenode's IDENTIFY-MSG */
 	unsigned int have_sasl:1;		/* SASL capability */
 	unsigned int have_except:1;	/* ban exemptions +e */
diff --git a/src/common/modes.c b/src/common/modes.c
index 7326b6fe..32b5a3fa 100644
--- a/src/common/modes.c
+++ b/src/common/modes.c
@@ -813,12 +813,6 @@ inbound_005 (server * serv, char *word[])
 		} else if (strcmp (word[w], "WHOX") == 0)
 		{
 			serv->have_whox = TRUE;
-		} else if (strcmp (word[w], "CAPAB") == 0)
-		{
-			serv->have_capab = TRUE;
-									/* 12345678901234567890 */
-			tcp_send_len (serv, "CAPAB IDENTIFY-MSG\r\n", 20);
-			/* now wait for numeric 290 */	
 		} else if (strcmp (word[w], "EXCEPTS") == 0)
 		{
 #ifndef WIN32
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index 13147016..790e3242 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -518,14 +518,6 @@ process_numeric (session * sess, int n,
 		}
 		goto def;
 
-	case 290:	/* CAPAB reply */
-		if (strstr (word_eol[1], "IDENTIFY-MSG"))
-		{
-			serv->have_idmsg = TRUE;
-			break;
-		}
-		goto def;
-
 	case 301:
 		inbound_away (serv, word[4],
 						(word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5]);
diff --git a/src/common/server.c b/src/common/server.c
index 8ad1d6ca..1ace2a48 100644
--- a/src/common/server.c
+++ b/src/common/server.c
@@ -1886,7 +1886,6 @@ server_set_defaults (server *serv)
 	serv->have_namesx = FALSE;
 	serv->have_uhnames = FALSE;
 	serv->have_whox = FALSE;
-	serv->have_capab = FALSE;
 	serv->have_idmsg = FALSE;
 	serv->have_sasl = FALSE;
 	serv->have_except = FALSE;
diff --git a/src/common/util.c b/src/common/util.c
index 2319f75e..0f04d9ca 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1877,6 +1877,17 @@ hextray_mode ()
 #endif
 }
 
+int
+unity_mode ()
+{
+#ifdef G_OS_UNIX
+	const char *env = g_getenv("XDG_CURRENT_DESKTOP");
+	if (env && strcmp (env, "Unity") == 0)
+		return 1;
+#endif
+	return 0;
+}
+
 /* Routine for listing subfolders of a given folder. ALWAYS free correctly after use, e.g.
 void display_list (GSList *list)
 {
diff --git a/src/common/util.h b/src/common/util.h
index 8114cbc7..601d9e50 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -60,6 +60,7 @@ void safe_strcpy (char *dest, const char *src, int bytes_left);
 void canonalize_key (char *key);
 int portable_mode ();
 int hextray_mode ();
+int unity_mode ();
 GSList *get_subdirs (const char *path);
 char *encode_sasl_pass (char *user, char *pass);
 
diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c
index 2d02c59d..d344c591 100644
--- a/src/fe-gtk/maingui.c
+++ b/src/fe-gtk/maingui.c
@@ -501,7 +501,7 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
 {
 	if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) &&
 		 (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) &&
-		 prefs.hex_gui_tray_minimize && !hextray_mode ())
+		 prefs.hex_gui_tray_minimize && !hextray_mode () && !unity_mode ())
 	{
 		tray_toggle_visibility (TRUE);
 		gtk_window_deiconify (wid);
@@ -1295,7 +1295,7 @@ mg_open_quit_dialog (gboolean minimize_button)
 	gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1),
 										GTK_BUTTONBOX_END);
 
-	if (minimize_button && !hextray_mode ())
+	if (minimize_button && !hextray_mode () && !unity_mode ())
 	{
 		button = gtk_button_new_with_mnemonic (_("_Minimize to Tray"));
 		gtk_widget_show (button);
@@ -3087,7 +3087,7 @@ mg_tabwindow_de_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)
 	GSList *list;
 	session *sess;
 
-	if (prefs.hex_gui_tray_close && !hextray_mode () && tray_toggle_visibility (FALSE))
+	if (prefs.hex_gui_tray_close && !hextray_mode () && !unity_mode () && tray_toggle_visibility (FALSE))
 		return TRUE;
 
 	/* check for remaining toplevel windows */
diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c
index 694e4c35..2d8553a3 100644
--- a/src/fe-gtk/plugin-tray.c
+++ b/src/fe-gtk/plugin-tray.c
@@ -837,7 +837,7 @@ tray_apply_setup (void)
 	}
 	else
 	{
-		if (prefs.hex_gui_tray && !hextray_mode ())
+		if (prefs.hex_gui_tray && !hextray_mode () && !unity_mode ())
 			tray_init ();
 	}
 }
@@ -869,7 +869,7 @@ tray_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name,
 
 	hexchat_hook_print (ph, "Focus Window", -1, tray_focus_cb, NULL);
 
-	if (prefs.hex_gui_tray && !hextray_mode ())
+	if (prefs.hex_gui_tray && !hextray_mode () && !unity_mode ())
 		tray_init ();
 
 	return 1;       /* return 1 for success */
diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c
index 33004a8f..ef9dd8cd 100644
--- a/src/fe-gtk/setup.c
+++ b/src/fe-gtk/setup.c
@@ -462,6 +462,28 @@ static const setting alert_settings[] =
 	{ST_END, 0, 0, 0, 0, 0}
 };
 
+static const setting alert_settings_unity[] =
+{
+	{ST_HEADER,	N_("Alerts"),0,0,0},
+
+	{ST_ALERTHEAD},
+	{ST_3OGGLE, N_("Show tray balloons on:"), 0, 0, (void *)balloonlist, 0},
+	{ST_3OGGLE, N_("Blink task bar on:"), 0, 0, (void *)taskbarlist, 0},
+	{ST_3OGGLE, N_("Make a beep sound on:"), 0, 0, (void *)beeplist, 0},
+
+	{ST_TOGGLE,	N_("Omit alerts when marked as being away"), P_OFFINTNL(hex_away_omit_alerts), 0, 0, 0},
+
+	{ST_HEADER,	N_("Highlighted Messages"),0,0,0},
+	{ST_LABEL,	N_("Highlighted messages are ones where your nickname is mentioned, but also:"), 0, 0, 0, 1},
+
+	{ST_ENTRY,	N_("Extra words to highlight:"), P_OFFSETNL(hex_irc_extra_hilight), 0, 0, sizeof prefs.hex_irc_extra_hilight},
+	{ST_ENTRY,	N_("Nick names not to highlight:"), P_OFFSETNL(hex_irc_no_hilight), 0, 0, sizeof prefs.hex_irc_no_hilight},
+	{ST_ENTRY,	N_("Nick names to always highlight:"), P_OFFSETNL(hex_irc_nick_hilight), 0, 0, sizeof prefs.hex_irc_nick_hilight},
+	{ST_LABEL,	N_("Separate multiple words with commas.\nWildcards are accepted.")},
+
+	{ST_END, 0, 0, 0, 0, 0}
+};
+
 static const setting alert_settings_hextray[] =
 {
 	{ST_HEADER,	N_("Alerts"),0,0,0},
@@ -1950,6 +1972,10 @@ setup_create_pages (GtkWidget *box)
 	{
 		setup_add_page (cata[8], book, setup_create_page (alert_settings_hextray));
 	}
+	else if (unity_mode ())
+	{
+		setup_add_page (cata[8], book, setup_create_page (alert_settings_unity));
+	}
 	else
 	{
 		setup_add_page (cata[8], book, setup_create_page (alert_settings));
diff --git a/src/fe-gtk/userlistgui.c b/src/fe-gtk/userlistgui.c
index a2a7e9ae..35728c8f 100644
--- a/src/fe-gtk/userlistgui.c
+++ b/src/fe-gtk/userlistgui.c
@@ -328,7 +328,7 @@ fe_userlist_rehash (session *sess, struct User *user)
 {
 	GtkTreeIter *iter;
 	int sel;
-	int nick_color = NULL;
+	int nick_color = 0;
 
 	iter = find_row (GTK_TREE_VIEW (sess->gui->user_tree),
 						  sess->res->user_model, user, &sel);
@@ -353,7 +353,7 @@ fe_userlist_insert (session *sess, struct User *newuser, int row, int sel)
 	GdkPixbuf *pix = get_user_icon (sess->server, newuser);
 	GtkTreeIter iter;
 	char *nick;
-	int nick_color = NULL;
+	int nick_color = 0;
 
 	if (prefs.hex_away_track && prefs.hex_away_size_max && newuser->away)
 		nick_color = COL_AWAY;