summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/Makefile.am6
-rw-r--r--src/common/cfgfiles.c2
-rw-r--r--src/common/hexchat.h7
-rw-r--r--src/common/plugin.c42
-rw-r--r--src/common/servlist.c12
-rw-r--r--src/common/ssl.c5
-rw-r--r--src/fe-gtk/Makefile.am4
-rw-r--r--src/fe-gtk/servlistgui.c24
-rw-r--r--src/fe-gtk/xtext.c38
-rw-r--r--src/htm/Makefile.am9
10 files changed, 119 insertions, 30 deletions
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index ca1eaba3..9c2d443e 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -44,6 +44,10 @@ if USE_OPENSSL
 ssl_c = ssl.c
 endif
 
+if USE_MSPROXY
+msproxy_c = msproxy.c
+endif
+
 if USE_DBUS
 dbusdir = dbus
 libhexchatcommon_a_LIBADD =				\
@@ -58,7 +62,7 @@ endif
 noinst_PROGRAMS = make-te
 
 libhexchatcommon_a_SOURCES = cfgfiles.c chanopt.c ctcp.c dcc.c hexchat.c \
-	history.c ignore.c inbound.c modes.c msproxy.c network.c notify.c \
+	history.c ignore.c inbound.c modes.c $(msproxy_c) network.c notify.c \
 	outbound.c plugin.c plugin-timer.c proto-irc.c server.c servlist.c \
 	$(ssl_c) text.c tree.c url.c userlist.c util.c
 libhexchatcommon_a_CFLAGS = $(LIBPROXY_CFLAGS)
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 489eeda2..b7a8beda 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -926,7 +926,7 @@ make_config_dirs (void)
 {
 	char *buf;
 
-	if (g_mkdir (get_xdir (), 0700) != 0)
+	if (g_mkdir_with_parents (get_xdir (), 0700) != 0)
 		return -1;
 	
 	buf = g_build_filename (get_xdir (), "addons", NULL);
diff --git a/src/common/hexchat.h b/src/common/hexchat.h
index 39a44191..7143f8ab 100644
--- a/src/common/hexchat.h
+++ b/src/common/hexchat.h
@@ -31,6 +31,13 @@
 #ifndef HEXCHAT_H
 #define HEXCHAT_H
 
+#ifdef USE_OPENSSL
+#ifdef __APPLE__
+#define __AVAILABILITYMACROS__
+#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
+#endif
+#endif
+
 #include "history.h"
 
 #ifndef HAVE_SNPRINTF
diff --git a/src/common/plugin.c b/src/common/plugin.c
index 286a68c7..89ebd89c 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -479,36 +479,50 @@ plugin_auto_load_cb (char *filename)
 	}
 }
 
+static char *
+plugin_get_libdir ()
+{
+	const char *libdir;
+
+	libdir = g_getenv ("HEXCHAT_LIBDIR");
+	if (libdir && *libdir)
+		return (char*)libdir;
+	else
+		return HEXCHATLIBDIR;
+}
+
 void
 plugin_auto_load (session *sess)
 {
+	char *lib_dir; 
 	char *sub_dir;
 	ps = sess;
 
+	lib_dir = plugin_get_libdir ();
 	sub_dir = g_build_filename (get_xdir (), "addons", NULL);
 
 #ifdef WIN32
 	/* a long list of bundled plugins that should be loaded automatically,
 	 * user plugins should go to <config>, leave Program Files alone! */
-	for_files (HEXCHATLIBDIR, "hcchecksum.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcdoat.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcexec.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcfishlim.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcmpcinfo.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcperl.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcpython2.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcpython3.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcupd.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcwinamp.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcsysinfo.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcchecksum.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcdoat.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcexec.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcfishlim.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcmpcinfo.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcperl.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcpython2.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcpython3.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcupd.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcwinamp.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcsysinfo.dll", plugin_auto_load_cb);
 
 	for_files (sub_dir, "*.dll", plugin_auto_load_cb);
 #else
 #if defined(__hpux)
-	for_files (HEXCHATLIBDIR, "*.sl", plugin_auto_load_cb);
+	for_files (lib_dir, "*.sl", plugin_auto_load_cb);
 	for_files (sub_dir, "*.sl", plugin_auto_load_cb);
 #else
-	for_files (HEXCHATLIBDIR, "*.so", plugin_auto_load_cb);
+	for_files (lib_dir, "*.so", plugin_auto_load_cb);
 	for_files (sub_dir, "*.so", plugin_auto_load_cb);
 #endif
 #endif
@@ -1166,7 +1180,7 @@ hexchat_get_info (hexchat_plugin *ph, const char *id)
 	switch (hash)
 	{
 		case 0x325acab5:	/* libdirfs */
-			return HEXCHATLIBDIR;
+			return plugin_get_libdir ();
 
 		case 0x14f51cd8: /* version */
 			return PACKAGE_VERSION;
diff --git a/src/common/servlist.c b/src/common/servlist.c
index 46f99c5d..c84df64c 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -120,6 +120,12 @@ static const struct defaultserver def[] =
 	{"Beirut", 0},
 	{0,			"irc.beirut.com"},
 
+	{"Canternet", 0, 0, 0, LOGIN_SASL},
+#ifdef USE_OPENSSL
+	{0, 		"irc.canternet.org/+6697"},
+#endif
+	{0,			"irc.canternet.org"},
+
 	{"Chat4all", 0},
 #ifdef USE_OPENSSL
 	{0,			"irc.chat4all.org/+7001"},
@@ -463,6 +469,12 @@ static const struct defaultserver def[] =
 #endif
 	{0,			"irc.swiftirc.net/6667"},
 
+	{"synIRC", 0},
+#ifdef USE_OPENSSL
+	{0, "irc.synirc.net/+6697"},
+#endif
+	{0, "irc.synirc.net/6667"},
+
 	{"Techman's World IRC",		0},
 #ifdef USE_OPENSSL
 	{0,			"irc.techmansworld.com/+6697"},
diff --git a/src/common/ssl.c b/src/common/ssl.c
index 742da619..d036fb66 100644
--- a/src/common/ssl.c
+++ b/src/common/ssl.c
@@ -17,6 +17,11 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#ifdef __APPLE__
+#define __AVAILABILITYMACROS__
+#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
+#endif
+
 #include "inet.h"				  /* make it first to avoid macro redefinitions */
 #include <openssl/ssl.h>		  /* SSL_() */
 #include <openssl/err.h>		  /* ERR_() */
diff --git a/src/fe-gtk/Makefile.am b/src/fe-gtk/Makefile.am
index 2e95232e..5a622fa0 100644
--- a/src/fe-gtk/Makefile.am
+++ b/src/fe-gtk/Makefile.am
@@ -14,6 +14,10 @@ EXTRA_DIST = \
 	sexy-spell-entry.h sexy-marshal.h textgui.h urlgrab.h userlistgui.h xtext.h \
 	../../data/hexchat.gresource.xml
 
+BUILT_SOURCES = resources.c
+
+CLEANFILES = $(BUILT_SOURCES)
+
 if DO_PLUGIN
 plugingui_c = plugingui.c
 endif
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c
index 7a9ee8a1..389607d0 100644
--- a/src/fe-gtk/servlistgui.c
+++ b/src/fe-gtk/servlistgui.c
@@ -944,6 +944,7 @@ static int
 servlist_savegui (void)
 {
 	char *sp;
+	const char *nick1, *nick2;
 
 	/* check for blank username, ircd will not allow this */
 	if (gtk_entry_get_text (GTK_ENTRY (entry_guser))[0] == 0)
@@ -952,8 +953,15 @@ servlist_savegui (void)
 	/* if (gtk_entry_get_text (GTK_ENTRY (entry_greal))[0] == 0)
 		return 1; */
 
-	strcpy (prefs.hex_irc_nick1, gtk_entry_get_text (GTK_ENTRY (entry_nick1)));
-	strcpy (prefs.hex_irc_nick2, gtk_entry_get_text (GTK_ENTRY (entry_nick2)));
+	nick1 = gtk_entry_get_text (GTK_ENTRY (entry_nick1));
+	nick2 = gtk_entry_get_text (GTK_ENTRY (entry_nick2));
+
+	/* ensure unique nicknames */
+	if (!rfc_casecmp (nick1, nick2))
+		return 2;
+
+	strcpy (prefs.hex_irc_nick1, nick1);
+	strcpy (prefs.hex_irc_nick2, nick2);
 	strcpy (prefs.hex_irc_nick3, gtk_entry_get_text (GTK_ENTRY (entry_nick3)));
 	strcpy (prefs.hex_irc_user_name, gtk_entry_get_text (GTK_ENTRY (entry_guser)));
 	sp = strchr (prefs.hex_irc_user_name, ' ');
@@ -1104,12 +1112,20 @@ servlist_toggle_global_user (gboolean sensitive)
 static void
 servlist_connect_cb (GtkWidget *button, gpointer userdata)
 {
+	int servlist_err;
+
 	if (!selected_net)
 		return;
 
-	if (servlist_savegui () != 0)
+	servlist_err = servlist_savegui ();
+	if (servlist_err == 1)
+	{
+		fe_message (_("User name cannot be left blank."), FE_MSG_ERROR);
+		return;
+	}
+	else if (servlist_err == 2)
 	{
-		fe_message (_("User name and Real name cannot be left blank."), FE_MSG_ERROR);
+		fe_message (_("You must have a unique nickname for Second Choice."), FE_MSG_ERROR);
 		return;
 	}
 
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index 7010ac46..52751b69 100644
--- a/src/fe-gtk/xtext.c
+++ b/src/fe-gtk/xtext.c
@@ -857,7 +857,10 @@ gtk_xtext_find_x (GtkXText * xtext, int x, textentry * ent, int subline,
 		indent = xtext->buffer->indent;
 
 	if (line > xtext->adj->page_size || line < 0)
+	{
+		*out_of_bounds = TRUE;
 		return 0;
+	}
 
 	if (xtext->buffer->grid_dirty || line > 255)
 	{
@@ -890,6 +893,10 @@ gtk_xtext_find_char (GtkXText * xtext, int x, int y, int *off,
 	int line;
 	int subline;
 
+	/* Adjust y value for negative rounding, double to int */
+	if (y < 0)
+		y -= xtext->fontsize;
+
 	line = (y + xtext->pixel_offset) / xtext->fontsize;
 	ent = gtk_xtext_nth (xtext, line + (int)xtext->adj->value, &subline);
 	if (!ent)
@@ -1270,6 +1277,9 @@ gtk_xtext_selection_draw (GtkXText * xtext, GdkEventMotion * event, gboolean ren
 			gtk_xtext_render_page (xtext);
 		return;
 	}
+	else if (tmp) {
+		offset_start = xtext->buffer->last_offset_start;
+	}
 
 	ent_end = gtk_xtext_find_char (xtext, high_x, high_y, &offset_end, &tmp);
 	if (!ent_end)
@@ -1283,6 +1293,10 @@ gtk_xtext_selection_draw (GtkXText * xtext, GdkEventMotion * event, gboolean ren
 		}
 		offset_end = ent_end->str_len;
 	}
+	else if (tmp)
+	{
+		offset_end = xtext->buffer->last_offset_end;
+	}
 
 	/* marking less than a complete line? */
 	/* make sure "start" is smaller than "end" (swap them if need be) */
@@ -1317,6 +1331,11 @@ gtk_xtext_selection_draw (GtkXText * xtext, GdkEventMotion * event, gboolean ren
 			ent = ent->next;
 		}
 	}
+	else
+	{
+		if (xtext->mark_stamp)
+			offset_start = 0;
+	}
 
 	if (render)
 		gtk_xtext_selection_render (xtext, ent_start, offset_start, ent_end, offset_end);
@@ -1351,7 +1370,6 @@ gtk_xtext_scrolldown_timeout (GtkXText * xtext)
 		return 0;
 	}
 
-	adj->value = (int)adj->value;	/* Align to line boundary */
 	xtext->select_start_y -= xtext->fontsize;
 	xtext->select_start_adj++;
 	adj->value++;
@@ -1372,6 +1390,7 @@ gtk_xtext_scrollup_timeout (GtkXText * xtext)
 	int p_y;
 	xtext_buffer *buf = xtext->buffer;
 	GtkAdjustment *adj = xtext->adj;
+	int delta_y;
 
 	gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0);
 
@@ -1384,10 +1403,16 @@ gtk_xtext_scrollup_timeout (GtkXText * xtext)
 		return 0;
 	}
 
-	adj->value = (int)adj->value;	/* Align to line boundary */
-	xtext->select_start_y += xtext->fontsize;
-	xtext->select_start_adj--;
-	adj->value--;
+	if (adj->value < 0)
+	{
+		delta_y = adj->value * xtext->fontsize;
+		adj->value = 0;
+	} else {
+		delta_y = xtext->fontsize;
+		adj->value--;
+	}
+	xtext->select_start_y += delta_y;
+	xtext->select_start_adj = adj->value;
 	gtk_adjustment_value_changed (adj);
 	gtk_xtext_selection_draw (xtext, NULL, TRUE);
 	gtk_xtext_render_ents (xtext, buf->pagetop_ent->prev, buf->last_ent_end);
@@ -1793,10 +1818,9 @@ gtk_xtext_unselect (GtkXText *xtext)
 	gtk_xtext_selection_clear (xtext->buffer);
 
 	/* FIXME: use jump_out on multi-line selects too! */
-	gtk_xtext_render_ents (xtext, buf->last_ent_start, buf->last_ent_end);
-
 	xtext->jump_in_offset = 0;
 	xtext->jump_out_offset = 0;
+	gtk_xtext_render_ents (xtext, buf->last_ent_start, buf->last_ent_end);
 
 	xtext->skip_border_fills = FALSE;
 	xtext->skip_stamp = FALSE;
diff --git a/src/htm/Makefile.am b/src/htm/Makefile.am
index 85480402..e524bf27 100644
--- a/src/htm/Makefile.am
+++ b/src/htm/Makefile.am
@@ -1,10 +1,13 @@
-MDTOOL_OPTS = --verbose
-
 theme_SCRIPTS = thememan.exe thememan
 themedir = $(bindir)
 
+mdtool_verbose = $(mdtool_verbose_$(V))
+mdtool_verbose_ = $(mdtool_verbose_$(AM_DEFAULT_VERBOSITY))
+mdtool_verbose_0 = @echo "  MDTOOL  " $@; $(MDTOOL) build $< > /dev/null;
+mdtool_verbose_1 = $(MDTOOL) --verbose build $<;
+
 thememan.exe: htm-mono.csproj
-	$(MDTOOL) $(MDTOOL_OPTS) build $<
+	$(mdtool_verbose)
 
 clean-local:
 	rm -f thememan.exe thememan.exe.config thememan.exe.mdb thememan Main.resources