summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--plugins/mpcinfo/mpcInfo.c2
-rw-r--r--share/misc/hexchat.desktop7
-rw-r--r--src/common/dbus/example.c2
-rw-r--r--src/common/modes.c6
-rw-r--r--src/common/proto-irc.c11
-rw-r--r--src/common/server.c7
-rw-r--r--src/common/servlist.c41
-rw-r--r--src/common/servlist.h1
-rw-r--r--src/common/textevents.in4
-rw-r--r--src/fe-gtk/chanlist.c4
-rw-r--r--src/fe-gtk/search.c5
-rw-r--r--src/fe-gtk/servlistgui.c84
12 files changed, 148 insertions, 26 deletions
diff --git a/plugins/mpcinfo/mpcInfo.c b/plugins/mpcinfo/mpcInfo.c
index 72a3ca07..4ab16642 100644
--- a/plugins/mpcinfo/mpcInfo.c
+++ b/plugins/mpcinfo/mpcInfo.c
@@ -135,7 +135,7 @@ int hexchat_plugin_init(hexchat_plugin *plugin_handle, char **plugin_name, char
 
 	themeInit();
 	loadThemes();
-	hexchat_printf(ph, "%s %s plugin loaded\n",*plugin_name, VERSION);
+	hexchat_printf(ph, "%s plugin loaded\n", *plugin_name);
 
 	return 1;
 }
diff --git a/share/misc/hexchat.desktop b/share/misc/hexchat.desktop
index 051686a6..ce573af1 100644
--- a/share/misc/hexchat.desktop
+++ b/share/misc/hexchat.desktop
@@ -7,6 +7,7 @@ GenericName[es]=Aplicación de IRC
 GenericName[fi]=IRC-sovellus
 GenericName[fr]=Client IRC
 GenericName[hu]=IRC-kliens
+GenericName[it]=Cliente IRC
 GenericName[lt]=IRC klientas
 GenericName[nb]=IRC-klient
 GenericName[pl]=Klient IRC
@@ -16,9 +17,9 @@ GenericName[sv]=IRC-klient
 GenericName[ro]=Client de IRC
 GenericName[zh_TW]=HexChat 聊天程式
 Comment=Chat with other people using Internet Relay Chat
-Comment[fr]=Discuttez avec des gens sur l'Internet Relay Chat
-Comment[de]=Chaten mit Leute auf dem Internet Relay Chat
-Comment[it]=Chiachierare con gente sul Internet Relay Chat
+Comment[fr]=Discutez avec tout le monde sur l'Internet Relay Chat
+Comment[de]=Sich über Internet Relay Chat mit andern Leuten unterhalten
+Comment[it]=Chiacchierare con la gente sull'Internet Relay Chat
 Comment[nb]=Snakk med mennesker på Internet Relay Chat
 Exec=hexchat
 Icon=hexchat
diff --git a/src/common/dbus/example.c b/src/common/dbus/example.c
index b78bb004..ee1833d3 100644
--- a/src/common/dbus/example.c
+++ b/src/common/dbus/example.c
@@ -102,7 +102,9 @@ main (int argc, char **argv)
 	gchar *path;
 	GError *error = NULL;
 
+#if ! GLIB_CHECK_VERSION (2, 36, 0)
 	g_type_init ();
+#endif
 
 	connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
 	if (connection == NULL) {
diff --git a/src/common/modes.c b/src/common/modes.c
index 38e57e4c..f8b25fcd 100644
--- a/src/common/modes.c
+++ b/src/common/modes.c
@@ -816,12 +816,6 @@ inbound_005 (server * serv, char *word[])
 				fe_set_channel (serv->server_session);
 			}
 
-			/* use /NICKSERV */
-			if (g_ascii_strcasecmp (word[w] + 8, "UniBG") == 0)
-				serv->nickservtype = 3;
-			else if (g_ascii_strcasecmp (word[w] + 8, "QuakeNet") == 0)
-				serv->nickservtype = 4;
-
 		} else if (strncmp (word[w], "CASEMAPPING=", 12) == 0)
 		{
 			if (strcmp (word[w] + 12, "ascii") == 0)	/* bahamut */
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index 27c3cb8e..984f7f20 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -80,14 +80,21 @@ irc_nickserv (server *serv, char *cmd, char *arg1, char *arg2, char *arg3)
 		break;
 	case 4:
 		/* why couldn't QuakeNet implement one of the existing ones? */
-		tcp_sendf (serv, "AUTH %s%s%s\r\n", cmd, arg1, arg2, arg3);
+		tcp_sendf (serv, "AUTH %s %s\r\n", arg1, arg2);
 	}
 }
 
 static void
 irc_ns_identify (server *serv, char *pass)
 {
-	irc_nickserv (serv, "IDENTIFY", pass, "", "");
+	if (serv->nickservtype == 4)	/* QuakeNet needs to do everything in its own ways... */
+	{
+		irc_nickserv (serv, "", serv->nick, pass, "");
+	}
+	else
+	{
+		irc_nickserv (serv, "IDENTIFY", pass, "", "");
+	}
 }
 
 static void
diff --git a/src/common/server.c b/src/common/server.c
index 2427ac6d..1f4f626e 100644
--- a/src/common/server.c
+++ b/src/common/server.c
@@ -1762,7 +1762,11 @@ server_connect (server *serv, char *hostname, int port, int no_login)
 										serv, 0, (DWORD *)&pid));
 #else
 #ifdef LOOKUPD
-	rand();	/* CL: net_resolve calls rand() when LOOKUPD is set, so prepare a different seed for each child. This method giver a bigger variation in seed values than calling srand(time(0)) in the child itself. */
+	/* CL: net_resolve calls rand() when LOOKUPD is set, so prepare a different
+	 * seed for each child. This method gives a bigger variation in seed values
+	 * than calling srand(time(0)) in the child itself.
+	 */
+	rand();
 #endif
 	switch (pid = fork ())
 	{
@@ -1877,7 +1881,6 @@ server_set_defaults (server *serv)
 	serv->nick_modes = strdup ("ohv");
 
 	serv->nickcount = 1;
-	serv->nickservtype = 0;
 	serv->end_of_motd = FALSE;
 	serv->is_away = FALSE;
 	serv->supports_watch = FALSE;
diff --git a/src/common/servlist.c b/src/common/servlist.c
index a87cc719..365b3c17 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -43,6 +43,7 @@ struct defaultserver
 	char *host;
 	char *channel;
 	char *charset;
+	int nsmode;		/* default NickServ type */
 };
 
 static const struct defaultserver def[] =
@@ -166,7 +167,7 @@ static const struct defaultserver def[] =
 	{0,			"irc.criten.net"},
 	{0,			"irc.eu.criten.net"},
 
-	{"DALnet",	0},
+	{"DALnet", 0, 0, 0, 2},
 	{0,			"irc.dal.net"},
 	{0,			"irc.eu.dal.net"},
 
@@ -262,7 +263,7 @@ static const struct defaultserver def[] =
 /*	{0,			"sprynet.us.galaxynet.org"},
 	{0,			"atlanta.ga.us.galaxynet.org"},*/
 
-	{"GameSurge",	0},
+	{"GameSurge", 0, 0, 0, 2},
 	{0,			"irc.gamesurge.net"},
 	
 /*	{"GamesNET",	0},
@@ -433,7 +434,7 @@ static const struct defaultserver def[] =
 	{0,			"nfsi.ptnet.org"},
 	{0,			"fctunl.ptnet.org"},
 
-	{"QuakeNet",	0},
+	{"QuakeNet", 0, 0, 0, 5},
 	{0,			"irc.quakenet.org"},
 	{0,			"irc.se.quakenet.org"},
 	{0,			"irc.dk.quakenet.org"},
@@ -467,7 +468,7 @@ static const struct defaultserver def[] =
 	{"Rizon", 0},
 	{0,			"irc.rizon.net"},
 
-	{"RusNet", 0, 0, "KOI8-R (Cyrillic)"},
+	{"RusNet", 0, 0, "KOI8-R (Cyrillic)", 2},
 	{0,			"irc.tomsk.net"},
 	{0,			"irc.rinet.ru"},
 	{0,			"irc.run.net"},
@@ -552,7 +553,7 @@ static const struct defaultserver def[] =
 	{0,			"us.undernet.org"},
 	{0,			"eu.undernet.org"},
 
-	{"UniBG",		0},
+	{"UniBG", 0, 0, 0, 4},
 	{0,			"irc.lirex.com"},
 	{0,			"irc.naturella.com"},
 	{0,			"irc.spnet.net"},
@@ -625,6 +626,15 @@ servlist_connect (session *sess, ircnet *net, gboolean join)
 		}
 	}
 
+	if (net->nstype >= 1)	/* once again, make sure gtk_combo_box_get_active() is not bugging us, just in case */
+	{
+		serv->nickservtype = net->nstype - 1;	/* ircnet->nstype starts at 1, server->nickservtype starts at 0! */
+	}
+	else
+	{
+		serv->nickservtype = 1;					/* use /NickServ by default */
+	}
+
 	serv->password[0] = 0;
 	serv->sasluser[0] = 0;
 	serv->saslpassword[0] = 0;
@@ -1027,6 +1037,10 @@ servlist_load_defaults (void)
 				free (net->encoding);
 				net->encoding = strdup (def[i].charset);
 			}
+			if (def[i].nsmode)
+			{
+				net->nstype = def[i].nsmode;
+			}
 			if (g_str_hash (def[i].network) == def_hash)
 			{
 				prefs.hex_gui_slist_select = j;
@@ -1128,6 +1142,9 @@ servlist_load (void)
 			case 'B':
 				net->nickserv = strdup (buf + 2);
 				break;
+			case 'T':
+				net->nstype = atoi (buf + 2);
+				break;
 			}
 		}
 		if (buf[0] == 'N')
@@ -1241,6 +1258,20 @@ servlist_save (void)
 			fprintf (fp, "J=%s\n", net->autojoin);
 		if (net->nickserv)
 			fprintf (fp, "B=%s\n", net->nickserv);
+		if (net->nstype)
+		{
+			if (net->nstype == -1)		/* gtk_combo_box_get_active() returns -1 for invalid indices */
+			{
+				net->nstype = 0; 		/* avoid further crashes for the current session */
+				buf = g_strdup_printf (_("Warning: invalid NickServ type. Falling back to default type for network %s."), net->name);
+				fe_message (buf, FE_MSG_WARN);
+				g_free (buf);
+			}
+			else						/* the selection was fine, save it */
+			{
+				fprintf (fp, "T=%d\n", net->nstype);
+			}
+		}
 		if (net->encoding && g_ascii_strcasecmp (net->encoding, "System") &&
 			 g_ascii_strcasecmp (net->encoding, "System default"))
 		{
diff --git a/src/common/servlist.h b/src/common/servlist.h
index 5ed3c4d6..b652f463 100644
--- a/src/common/servlist.h
+++ b/src/common/servlist.h
@@ -37,6 +37,7 @@ typedef struct ircnet
 	char *autojoin;
 	char *command;
 	char *nickserv;
+	int nstype;
 	char *comment;
 	char *encoding;
 	GSList *servlist;
diff --git a/src/common/textevents.in b/src/common/textevents.in
index 2c12cf01..3b0b676a 100644
--- a/src/common/textevents.in
+++ b/src/common/textevents.in
@@ -103,7 +103,7 @@ pevt_chanhop_help
 Channel INVITE
 XP_TE_CHANINVITE
 pevt_chaninvite_help
-%C22*%O$t%C26$1%C sets invite on %C18$2%O
+%C22*%O$t%C26$1%C sets invite exempt on %C18$2%O
 2
 
 Channel List
@@ -163,7 +163,7 @@ pevt_chanrmexempt_help
 Channel Remove Invite
 XP_TE_CHANRMINVITE
 pevt_chanrminvite_help
-%C22*%O$t%C26$1%O removes invite on %C18$2%O
+%C22*%O$t%C26$1%O removes invite exempt on %C18$2%O
 2
 
 Channel Remove Keyword
diff --git a/src/fe-gtk/chanlist.c b/src/fe-gtk/chanlist.c
index 47b9f1db..00c55b5f 100644
--- a/src/fe-gtk/chanlist.c
+++ b/src/fe-gtk/chanlist.c
@@ -532,6 +532,7 @@ chanlist_minusers (GtkSpinButton *wid, server *serv)
 {
 	serv->gui->chanlist_minusers = gtk_spin_button_get_value_as_int (wid);
 	prefs.hex_gui_chanlist_minusers = serv->gui->chanlist_minusers;
+	save_config();
 
 	if (serv->gui->chanlist_minusers < serv->gui->chanlist_minusers_downloaded)
 	{
@@ -553,6 +554,7 @@ chanlist_maxusers (GtkSpinButton *wid, server *serv)
 {
 	serv->gui->chanlist_maxusers = gtk_spin_button_get_value_as_int (wid);
 	prefs.hex_gui_chanlist_maxusers = serv->gui->chanlist_maxusers;
+	save_config();
 }
 
 static void
@@ -725,6 +727,7 @@ chanlist_opengui (server *serv, int do_refresh)
 		if (prefs.hex_gui_chanlist_minusers < 1 || prefs.hex_gui_chanlist_minusers > 999999)
 		{
 			prefs.hex_gui_chanlist_minusers = 5;
+			save_config();
 		}
 
 		serv->gui->chanlist_minusers = prefs.hex_gui_chanlist_minusers;
@@ -735,6 +738,7 @@ chanlist_opengui (server *serv, int do_refresh)
 		if (prefs.hex_gui_chanlist_maxusers < 1 || prefs.hex_gui_chanlist_maxusers > 999999)
 		{
 			prefs.hex_gui_chanlist_maxusers = 9999;
+			save_config();
 		}
 
 		serv->gui->chanlist_maxusers = prefs.hex_gui_chanlist_maxusers;
diff --git a/src/fe-gtk/search.c b/src/fe-gtk/search.c
index 49c30a14..44cbf3a0 100644
--- a/src/fe-gtk/search.c
+++ b/src/fe-gtk/search.c
@@ -26,6 +26,7 @@
 #include "../common/fe.h"
 #include "../common/util.h"
 #include "../common/hexchatc.h"
+#include "../common/cfgfiles.h"
 #include "gtkutil.h"
 #include "xtext.h"
 #include "maingui.h"
@@ -111,24 +112,28 @@ static void
 search_caseign_cb (GtkToggleButton * but, session * sess)
 {
 	prefs.hex_text_search_case_match = (but->active)? 1: 0;
+	save_config();
 }
 
 static void
 search_dirbwd_cb (GtkToggleButton * but, session * sess)
 {
 	prefs.hex_text_search_backward = (but->active)? 1: 0;
+	save_config();
 }
 
 static void
 search_regexp_cb (GtkToggleButton * but, session * sess)
 {
 	prefs.hex_text_search_regexp = (but->active)? 1: 0;
+	save_config();
 }
 
 static void
 search_highlight_cb (GtkToggleButton * but, session * sess)
 {
 	prefs.hex_text_search_highlight_all = (but->active)? 1: 0;
+	save_config();
 	search_search (sess, NULL);
 }
 
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c
index 13df2b15..8d480dc4 100644
--- a/src/fe-gtk/servlistgui.c
+++ b/src/fe-gtk/servlistgui.c
@@ -103,6 +103,24 @@ static const char *pages[]=
 	NULL
 };
 
+static const char *nstypes[]=
+{
+	/* This list is the same as in irc_nickserv(), except starting at 1, because
+	 * the 1st row is not used. We can't use index 0 coz then "if (nstype)" would
+	 * not be evaluated, it would give the same result as NULL (i.e. unset) nstype.
+	 * For unset nstype we have a "Default" entry in place of this placeholder, so
+	 * indices will be correct anyway.
+	 */
+	"PLACEHOLDER",			/* nstype = 0 */
+	"/msg NickServ",		/* nstype = 1, nickservtype = 0 */
+	"/NickServ",			/* nstype = 2, nickservtype = 1 */
+	"/NS",					/* ... */
+	"/msg NS",
+	"/auth",
+	NULL
+	/* This also means that we need to shift these values for irc_nickserv()! */
+};
+
 static void
 servlist_select_and_show (GtkTreeView *treeview, GtkTreeIter *iter,
 								  GtkListStore *store)
@@ -656,6 +674,7 @@ servlist_savegui (void)
 		sp[0] = 0;	/* spaces will break the login */
 	/* strcpy (prefs.hex_irc_real_name, GTK_ENTRY (entry_greal)->text); */
 	servlist_save ();
+	save_config (); /* For nicks stored in hexchat.conf */
 
 	return 0;
 }
@@ -1309,6 +1328,21 @@ servlist_combo_cb (GtkEntry *entry, gpointer userdata)
 	}
 }
 
+static void
+servlist_nscombo_cb (GtkEntry *entry, gpointer userdata)
+{
+	if (!selected_net)
+	{
+		return;
+	}
+
+	if (!ignore_changed)
+	{
+		selected_net->nstype = gtk_combo_box_get_active (GTK_COMBO_BOX (entry));
+	}
+}
+
+
 static GtkWidget *
 servlist_create_charsetcombo (void)
 {
@@ -1329,6 +1363,28 @@ servlist_create_charsetcombo (void)
 	return cb;
 }
 
+static GtkWidget *
+servlist_create_nstypecombo (void)
+{
+	GtkWidget *cb;
+	int i;
+
+	cb = gtk_combo_box_entry_new_text ();
+	gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "Default");
+
+	i = 1;		/* start with the 2nd row, leave the placeholder 0th element alone */
+
+	while (nstypes[i])
+	{
+		gtk_combo_box_append_text (GTK_COMBO_BOX (cb), (char *)nstypes[i]);
+		i++;
+	}
+
+	g_signal_connect (G_OBJECT (GTK_BIN (cb)), "changed", G_CALLBACK (servlist_nscombo_cb), NULL);
+
+	return cb;
+}
+
 static void
 no_servlist (GtkWidget * igad, gpointer serv)
 {
@@ -1374,7 +1430,9 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
 	GtkWidget *label16;
 	GtkWidget *label21;
 	GtkWidget *label34;
+	GtkWidget *label_nstype;
 	GtkWidget *comboboxentry_charset;
+	GtkWidget *comboboxentry_nstypes;
 	GtkWidget *hbox1;
 	GtkWidget *scrolledwindow2;
 	GtkWidget *treeview_servers;
@@ -1482,26 +1540,42 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
 					_("Extra command to execute after connecting. If you need more than one, set this to LOAD -e <filename>, where <filename> is a text-file full of commands to execute."));
 
 	edit_entry_nickserv =
-		servlist_create_entry (table3, _("Nickserv password:"), 17,
+		servlist_create_entry (table3, _("NickServ password:"), 17,
 									  net->nickserv, 0,
 					_("If your nickname requires a password, enter it here. Not all IRC networks support this."));
 	gtk_entry_set_visibility (GTK_ENTRY (edit_entry_nickserv), FALSE);
 
+	label_nstype = gtk_label_new (_("NickServ type:"));
+	gtk_widget_show (label_nstype);
+	gtk_table_attach (GTK_TABLE (table3), label_nstype, 1, 2, 18, 19,
+							(GtkAttachOptions) (GTK_FILL),
+							(GtkAttachOptions) (0), 0, 0);
+	gtk_misc_set_alignment (GTK_MISC (label_nstype), 0, 0.5);
+
+	comboboxentry_nstypes = servlist_create_nstypecombo ();
+	ignore_changed = TRUE;
+	gtk_entry_set_text (GTK_ENTRY (GTK_BIN (comboboxentry_nstypes)->child), net->nstype ? nstypes[net->nstype] : "Default");
+	ignore_changed = FALSE;
+	gtk_widget_show (comboboxentry_nstypes);
+	gtk_table_attach (GTK_TABLE (table3), comboboxentry_nstypes, 2, 3, 18, 19,
+							(GtkAttachOptions) (GTK_FILL),
+							(GtkAttachOptions) (GTK_FILL), 0, 0);
+
 	edit_entry_pass =
-		servlist_create_entry (table3, _("Server password:"), 18,
+		servlist_create_entry (table3, _("Server password:"), 20,
 									  net->pass, 0,
 					_("Password for the server, if in doubt, leave blank."));
 	gtk_entry_set_visibility (GTK_ENTRY (edit_entry_pass), FALSE);
 
 	edit_entry_saslpass =
-		servlist_create_entry (table3, _("SASL password:"), 19,
+		servlist_create_entry (table3, _("SASL password:"), 21,
 									  net->saslpass, 0,
 					_("Password for SASL authentication, if in doubt, leave blank."));
 	gtk_entry_set_visibility (GTK_ENTRY (edit_entry_saslpass), FALSE);
 
 	label34 = gtk_label_new (_("Character set:"));
 	gtk_widget_show (label34);
-	gtk_table_attach (GTK_TABLE (table3), label34, 1, 2, 20, 21,
+	gtk_table_attach (GTK_TABLE (table3), label34, 1, 2, 22, 23,
 							(GtkAttachOptions) (GTK_FILL),
 							(GtkAttachOptions) (0), 0, 0);
 	gtk_misc_set_alignment (GTK_MISC (label34), 0, 0.5);
@@ -1511,7 +1585,7 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
 	gtk_entry_set_text (GTK_ENTRY (GTK_BIN (comboboxentry_charset)->child), net->encoding ? net->encoding : "System default");
 	ignore_changed = FALSE;
 	gtk_widget_show (comboboxentry_charset);
-	gtk_table_attach (GTK_TABLE (table3), comboboxentry_charset, 2, 3, 20, 21,
+	gtk_table_attach (GTK_TABLE (table3), comboboxentry_charset, 2, 3, 22, 23,
 							(GtkAttachOptions) (GTK_FILL),
 							(GtkAttachOptions) (GTK_FILL), 0, 0);