summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/Makefile.am7
-rw-r--r--src/common/cfgfiles.c3
-rw-r--r--src/common/cfgfiles.h19
-rw-r--r--src/common/chanopt.c19
-rw-r--r--src/common/chanopt.h24
-rw-r--r--src/common/common-xp.vcxproj161
-rw-r--r--src/common/common-xp.vcxproj.filters203
-rw-r--r--src/common/common.vcxproj2
-rw-r--r--src/common/common.vcxproj.filters6
-rw-r--r--src/common/ctcp.h19
-rw-r--r--src/common/dbus/example-gdbus.py51
-rw-r--r--src/common/dbus/example.py25
-rw-r--r--src/common/dcc.h19
-rw-r--r--src/common/fe.h24
-rw-r--r--src/common/hexchat-plugin.h19
-rw-r--r--src/common/hexchat.c76
-rw-r--r--src/common/hexchat.h24
-rw-r--r--src/common/hexchatc.h19
-rw-r--r--src/common/history.h19
-rw-r--r--src/common/identd.c19
-rw-r--r--src/common/identd.h24
-rw-r--r--src/common/ignore.h19
-rw-r--r--src/common/inbound.c72
-rw-r--r--src/common/inbound.h19
-rw-r--r--src/common/inet.h24
-rw-r--r--src/common/make-te-xp.vcxproj102
-rw-r--r--src/common/make-te-xp.vcxproj.filters22
-rw-r--r--src/common/make-te.c19
-rw-r--r--src/common/modes.c14
-rw-r--r--src/common/modes.h19
-rw-r--r--src/common/msproxy.h5
-rw-r--r--src/common/network.h19
-rw-r--r--src/common/notify.h19
-rw-r--r--src/common/outbound.c70
-rw-r--r--src/common/outbound.h19
-rw-r--r--src/common/plugin-timer.c19
-rw-r--r--src/common/plugin-timer.h19
-rw-r--r--src/common/plugin.c1
-rw-r--r--src/common/plugin.h19
-rw-r--r--src/common/proto-irc.c41
-rw-r--r--src/common/proto-irc.h19
-rw-r--r--src/common/server.c26
-rw-r--r--src/common/server.h19
-rw-r--r--src/common/servlist.c29
-rw-r--r--src/common/servlist.h19
-rw-r--r--src/common/ssl.c6
-rw-r--r--src/common/ssl.h26
-rw-r--r--src/common/strlutil.c84
-rw-r--r--src/common/strlutil.h2
-rw-r--r--src/common/text.c90
-rw-r--r--src/common/text.h26
-rw-r--r--src/common/textevents.in4
-rw-r--r--src/common/thread.c19
-rw-r--r--src/common/thread.h24
-rw-r--r--src/common/tree.c19
-rw-r--r--src/common/tree.h19
-rw-r--r--src/common/typedef.h19
-rw-r--r--src/common/url.c8
-rw-r--r--src/common/url.h19
-rw-r--r--src/common/userlist.h19
-rw-r--r--src/common/util.c17
-rw-r--r--src/common/util.h22
62 files changed, 978 insertions, 880 deletions
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 3be3b1c6..f4418a75 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -31,7 +31,6 @@ EXTRA_DIST = \
 	servlist.h \
 	ssl.h \
 	ssl.c	\
-	strlutil.c \
 	text.h \
 	textenums.h \
 	textevents.h \
@@ -52,10 +51,14 @@ libhexchatcommon_a_LIBADD =				\
 endif
 SUBDIRS = $(dbusdir) .
 
+if DO_PLUGIN
+include_HEADERS = hexchat-plugin.h
+endif
+
 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 \
 	outbound.c plugin.c plugin-timer.c proto-irc.c server.c servlist.c \
-	$(ssl_c) strlutil.c text.c tree.c url.c userlist.c util.c
+	$(ssl_c) text.c tree.c url.c userlist.c util.c
 libhexchatcommon_a_CFLAGS = $(LIBPROXY_CFLAGS)
 
 textenums.h: textevents.h
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 9aac5a4f..cca2267a 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -450,7 +450,6 @@ const struct prefs vars[] =
 	{"gui_tab_icons", P_OFFINT (hex_gui_tab_icons), TYPE_BOOL},
 	{"gui_tab_layout", P_OFFINT (hex_gui_tab_layout), TYPE_INT},
 	{"gui_tab_newtofront", P_OFFINT (hex_gui_tab_newtofront), TYPE_INT},
-	{"gui_tab_notices", P_OFFINT (hex_gui_tab_notices), TYPE_BOOL},
 	{"gui_tab_pos", P_OFFINT (hex_gui_tab_pos), TYPE_INT},
 	{"gui_tab_server", P_OFFINT (hex_gui_tab_server), TYPE_BOOL},
 	{"gui_tab_small", P_OFFINT (hex_gui_tab_small), TYPE_INT},
@@ -466,6 +465,7 @@ const struct prefs vars[] =
 	{"gui_tray_minimize", P_OFFINT (hex_gui_tray_minimize), TYPE_BOOL},
 	{"gui_tray_quiet", P_OFFINT (hex_gui_tray_quiet), TYPE_BOOL},
 	{"gui_ulist_buttons", P_OFFINT (hex_gui_ulist_buttons), TYPE_BOOL},
+	{"gui_ulist_color", P_OFFINT (hex_gui_ulist_color), TYPE_BOOL},
 	{"gui_ulist_count", P_OFFINT (hex_gui_ulist_count), TYPE_BOOL},
 	{"gui_ulist_doubleclick", P_OFFSET (hex_gui_ulist_doubleclick), TYPE_STR},
 	{"gui_ulist_hide", P_OFFINT (hex_gui_ulist_hide), TYPE_BOOL},
@@ -523,6 +523,7 @@ const struct prefs vars[] =
 	{"irc_nick3", P_OFFSET (hex_irc_nick3), TYPE_STR},
 	{"irc_nick_hilight", P_OFFSET (hex_irc_nick_hilight), TYPE_STR},
 	{"irc_no_hilight", P_OFFSET (hex_irc_no_hilight), TYPE_STR},
+	{"irc_notice_pos", P_OFFINT (hex_irc_notice_pos), TYPE_INT},
 	{"irc_part_reason", P_OFFSET (hex_irc_part_reason), TYPE_STR},
 	{"irc_quit_reason", P_OFFSET (hex_irc_quit_reason), TYPE_STR},
 	{"irc_raw_modes", P_OFFINT (hex_irc_raw_modes), TYPE_BOOL},
diff --git a/src/common/cfgfiles.h b/src/common/cfgfiles.h
index e55befe5..3feb6a31 100644
--- a/src/common/cfgfiles.h
+++ b/src/common/cfgfiles.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /* cfgfiles.h */
 
 #ifndef HEXCHAT_CFGFILES_H
diff --git a/src/common/chanopt.c b/src/common/chanopt.c
index c0382000..561f2f9c 100644
--- a/src/common/chanopt.c
+++ b/src/common/chanopt.c
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /* per-channel/dialog settings :: /CHANOPT */
 
 #include <stdio.h>
diff --git a/src/common/chanopt.h b/src/common/chanopt.h
index 90ca86c3..c0990385 100644
--- a/src/common/chanopt.h
+++ b/src/common/chanopt.h
@@ -1,6 +1,30 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef HEXCHAT_CHANOPT_H
+#define HEXCHAT_CHANOPT_H
+
 int chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[]);
 gboolean chanopt_is_set (unsigned int global, guint8 per_chan_setting);
 gboolean chanopt_is_set_a (unsigned int global, guint8 per_chan_setting);
 void chanopt_save_all (void);
 void chanopt_save (session *sess);
 void chanopt_load (session *sess);
+
+#endif
diff --git a/src/common/common-xp.vcxproj b/src/common/common-xp.vcxproj
deleted file mode 100644
index 2b5979b6..00000000
--- a/src/common/common-xp.vcxproj
+++ /dev/null
@@ -1,161 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>

-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

-  <ItemGroup Label="ProjectConfigurations">

-    <ProjectConfiguration Include="Release|Win32">

-      <Configuration>Release</Configuration>

-      <Platform>Win32</Platform>

-    </ProjectConfiguration>

-    <ProjectConfiguration Include="Release|x64">

-      <Configuration>Release</Configuration>

-      <Platform>x64</Platform>

-    </ProjectConfiguration>

-  </ItemGroup>

-  <ItemGroup>

-    <ClInclude Include="..\..\config-win32.h" />

-    <ClInclude Include="cfgfiles.h" />

-    <ClInclude Include="chanopt.h" />

-    <ClInclude Include="ctcp.h" />

-    <ClInclude Include="dcc.h" />

-    <ClInclude Include="fe.h" />

-    <ClInclude Include="history.h" />

-    <ClInclude Include="identd.h" />

-    <ClInclude Include="ignore.h" />

-    <ClInclude Include="inbound.h" />

-    <ClInclude Include="inet.h" />

-    <ClInclude Include="modes.h" />

-    <ClInclude Include="msproxy.h" />

-    <ClInclude Include="network.h" />

-    <ClInclude Include="notify.h" />

-    <ClInclude Include="outbound.h" />

-    <ClInclude Include="plugin-timer.h" />

-    <ClInclude Include="plugin.h" />

-    <ClInclude Include="proto-irc.h" />

-    <ClInclude Include="server.h" />

-    <ClInclude Include="servlist.h" />

-    <ClInclude Include="ssl.h" />

-    <ClInclude Include="strlutil.h" />

-    <ClInclude Include="text.h" />

-    <ClInclude Include="textenums.h" />

-    <ClInclude Include="textevents.h" />

-    <ClInclude Include="thread.h" />

-    <ClInclude Include="tree.h" />

-    <ClInclude Include="typedef.h" />

-    <ClInclude Include="url.h" />

-    <ClInclude Include="userlist.h" />

-    <ClInclude Include="util.h" />

-    <ClInclude Include="hexchat-plugin.h" />

-    <ClInclude Include="hexchat.h" />

-    <ClInclude Include="hexchatc.h" />

-  </ItemGroup>

-  <ItemGroup>

-    <ClCompile Include="cfgfiles.c" />

-    <ClCompile Include="chanopt.c" />

-    <ClCompile Include="ctcp.c" />

-    <ClCompile Include="dcc.c" />

-    <ClCompile Include="history.c" />

-    <ClCompile Include="identd.c" />

-    <ClCompile Include="ignore.c" />

-    <ClCompile Include="inbound.c" />

-    <ClCompile Include="modes.c" />

-    <ClCompile Include="msproxy.c" />

-    <ClCompile Include="network.c" />

-    <ClCompile Include="notify.c" />

-    <ClCompile Include="outbound.c" />

-    <ClCompile Include="plugin-timer.c" />

-    <ClCompile Include="plugin.c" />

-    <ClCompile Include="proto-irc.c" />

-    <ClCompile Include="server.c" />

-    <ClCompile Include="servlist.c" />

-    <ClCompile Include="ssl.c" />

-    <ClCompile Include="strlutil.c" />

-    <ClCompile Include="text.c" />

-    <ClCompile Include="thread.c" />

-    <ClCompile Include="tree.c" />

-    <ClCompile Include="url.c" />

-    <ClCompile Include="userlist.c" />

-    <ClCompile Include="util.c" />

-    <ClCompile Include="hexchat.c" />

-  </ItemGroup>

-  <PropertyGroup Label="Globals">

-    <ProjectGuid>{87554B59-006C-4D94-9714-897B27067BA3}</ProjectGuid>

-    <Keyword>Win32Proj</Keyword>

-    <RootNamespace>common</RootNamespace>

-    <ProjectName>common</ProjectName>

-  </PropertyGroup>

-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

-    <ConfigurationType>StaticLibrary</ConfigurationType>

-    <UseDebugLibraries>false</UseDebugLibraries>

-    <WholeProgramOptimization>true</WholeProgramOptimization>

-    <CharacterSet>MultiByte</CharacterSet>

-    <PlatformToolset>WDK7</PlatformToolset>

-  </PropertyGroup>

-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

-    <ConfigurationType>StaticLibrary</ConfigurationType>

-    <UseDebugLibraries>false</UseDebugLibraries>

-    <WholeProgramOptimization>true</WholeProgramOptimization>

-    <CharacterSet>MultiByte</CharacterSet>

-    <PlatformToolset>WDK7</PlatformToolset>

-  </PropertyGroup>

-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

-  <ImportGroup Label="ExtensionSettings">

-  </ImportGroup>

-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />

-    <Import Project="..\..\win32\hexchat-xp.props" />

-  </ImportGroup>

-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">

-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />

-    <Import Project="..\..\win32\hexchat-xp.props" />

-  </ImportGroup>

-  <PropertyGroup Label="UserMacros" />

-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

-    <OutDir>$(HexChatBin)</OutDir>

-    <IntDir>$(HexChatObj)$(ProjectName)\</IntDir>

-  </PropertyGroup>

-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

-    <OutDir>$(HexChatBin)</OutDir>

-    <IntDir>$(HexChatObj)$(ProjectName)\</IntDir>

-  </PropertyGroup>

-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

-    <ClCompile>

-      <PrecompiledHeader>

-      </PrecompiledHeader>

-      <Optimization>MaxSpeed</Optimization>

-      <FunctionLevelLinking>true</FunctionLevelLinking>

-      <IntrinsicFunctions>true</IntrinsicFunctions>

-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>

-      <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

-      <MultiProcessorCompilation>true</MultiProcessorCompilation>

-      <DisableSpecificWarnings></DisableSpecificWarnings>

-    </ClCompile>

-    <Link>

-      <SubSystem>Windows</SubSystem>

-      <GenerateDebugInformation>true</GenerateDebugInformation>

-      <EnableCOMDATFolding>true</EnableCOMDATFolding>

-      <OptimizeReferences>true</OptimizeReferences>

-    </Link>

-  </ItemDefinitionGroup>

-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

-    <ClCompile>

-      <PrecompiledHeader>

-      </PrecompiledHeader>

-      <Optimization>MaxSpeed</Optimization>

-      <FunctionLevelLinking>true</FunctionLevelLinking>

-      <IntrinsicFunctions>true</IntrinsicFunctions>

-      <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>

-      <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

-      <MultiProcessorCompilation>true</MultiProcessorCompilation>

-      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>

-    </ClCompile>

-    <Link>

-      <SubSystem>Windows</SubSystem>

-      <GenerateDebugInformation>true</GenerateDebugInformation>

-      <EnableCOMDATFolding>true</EnableCOMDATFolding>

-      <OptimizeReferences>true</OptimizeReferences>

-    </Link>

-  </ItemDefinitionGroup>

-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

-  <ImportGroup Label="ExtensionTargets">

-  </ImportGroup>

-</Project>
\ No newline at end of file
diff --git a/src/common/common-xp.vcxproj.filters b/src/common/common-xp.vcxproj.filters
deleted file mode 100644
index ceeea660..00000000
--- a/src/common/common-xp.vcxproj.filters
+++ /dev/null
@@ -1,203 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>

-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

-  <ItemGroup>

-    <Filter Include="Source Files">

-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>

-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>

-    </Filter>

-    <Filter Include="Header Files">

-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>

-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>

-    </Filter>

-  </ItemGroup>

-  <ItemGroup>

-    <ClInclude Include="cfgfiles.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="chanopt.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="ctcp.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="dcc.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="fe.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="history.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="identd.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="ignore.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="inbound.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="inet.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="modes.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="msproxy.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="network.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="notify.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="outbound.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="plugin.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="plugin-timer.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="proto-irc.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="server.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="servlist.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="ssl.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="text.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="textenums.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="textevents.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="thread.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="tree.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="url.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="userlist.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="util.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="hexchat.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="hexchatc.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="hexchat-plugin.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="..\..\config-win32.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="strlutil.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-    <ClInclude Include="typedef.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

-  </ItemGroup>

-  <ItemGroup>

-    <ClCompile Include="cfgfiles.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="chanopt.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="ctcp.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="dcc.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="history.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="identd.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="ignore.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="inbound.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="modes.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="msproxy.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="network.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="notify.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="outbound.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="plugin.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="plugin-timer.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="proto-irc.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="server.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="servlist.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="ssl.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="text.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="thread.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="tree.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="url.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="userlist.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="util.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="hexchat.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-    <ClCompile Include="strlutil.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-  </ItemGroup>

-</Project>
\ No newline at end of file
diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj
index 2595912a..b4fa224a 100644
--- a/src/common/common.vcxproj
+++ b/src/common/common.vcxproj
@@ -33,7 +33,6 @@
     <ClInclude Include="server.h" />

     <ClInclude Include="servlist.h" />

     <ClInclude Include="ssl.h" />

-    <ClInclude Include="strlutil.h" />

     <ClInclude Include="text.h" />

     <ClInclude Include="textenums.h" />

     <ClInclude Include="textevents.h" />

@@ -67,7 +66,6 @@
     <ClCompile Include="server.c" />

     <ClCompile Include="servlist.c" />

     <ClCompile Include="ssl.c" />

-    <ClCompile Include="strlutil.c" />

     <ClCompile Include="text.c" />

     <ClCompile Include="thread.c" />

     <ClCompile Include="tree.c" />

diff --git a/src/common/common.vcxproj.filters b/src/common/common.vcxproj.filters
index ceeea660..d94ec2d3 100644
--- a/src/common/common.vcxproj.filters
+++ b/src/common/common.vcxproj.filters
@@ -110,9 +110,6 @@
     <ClInclude Include="..\..\config-win32.h">

       <Filter>Header Files</Filter>

     </ClInclude>

-    <ClInclude Include="strlutil.h">

-      <Filter>Header Files</Filter>

-    </ClInclude>

     <ClInclude Include="typedef.h">

       <Filter>Header Files</Filter>

     </ClInclude>

@@ -196,8 +193,5 @@
     <ClCompile Include="hexchat.c">

       <Filter>Source Files</Filter>

     </ClCompile>

-    <ClCompile Include="strlutil.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

   </ItemGroup>

 </Project>
\ No newline at end of file
diff --git a/src/common/ctcp.h b/src/common/ctcp.h
index 296e6b1b..54e33f4c 100644
--- a/src/common/ctcp.h
+++ b/src/common/ctcp.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_CTCP_H
 #define HEXCHAT_CTCP_H
 
diff --git a/src/common/dbus/example-gdbus.py b/src/common/dbus/example-gdbus.py
new file mode 100644
index 00000000..4f141034
--- /dev/null
+++ b/src/common/dbus/example-gdbus.py
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+
+# HexChat
+# Copyright (C) 1998-2010 Peter Zelezny.
+# Copyright (C) 2009-2013 Berke Viktor.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+#
+
+from gi.repository import Gio
+
+bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
+connection = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None,
+  						'org.hexchat.service', '/org/hexchat/Remote', 'org.hexchat.connection', None)
+path = connection.Connect('(ssss)', 
+					'example.py',
+					'Python example', 
+					'Example of a D-Bus client written in python', 
+					'1.0')		
+hexchat = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None,
+								'org.hexchat.service', path, 'org.hexchat.plugin', None)
+         
+# Note the type before every arguement, this must be done.
+# Type requirements are listed in our docs and characters are listed in the dbus docs.
+# s = string, u = uint, i = int, etc.
+
+channels = hexchat.ListGet ('(s)', "channels")
+while hexchat.ListNext ('(u)', channels):
+	name = hexchat.ListStr ('(us)', channels, "channel")
+	print("------- " + name + " -------")
+	hexchat.SetContext ('(u)', hexchat.ListInt ('(us)', channels, "context"))
+	hexchat.EmitPrint ('(sas)', "Channel Message", ["John", "Hi there", "@"])
+	users = hexchat.ListGet ('(s)', "users")
+	while hexchat.ListNext ('(u)', users):
+		print("Nick: " + hexchat.ListStr ('(us)', users, "nick"))
+	hexchat.ListFree ('(u)', users)
+hexchat.ListFree ('(u)', channels)
+
+print(hexchat.Strip ('(sii)', "\00312Blue\003 \002Bold!\002", -1, 1|2))
diff --git a/src/common/dbus/example.py b/src/common/dbus/example.py
index 49855784..4b94cd68 100644
--- a/src/common/dbus/example.py
+++ b/src/common/dbus/example.py
@@ -1,5 +1,24 @@
 #! /usr/bin/python
 
+# HexChat
+# Copyright (C) 1998-2010 Peter Zelezny.
+# Copyright (C) 2009-2013 Berke Viktor.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+#
+
 import dbus
 
 bus = dbus.SessionBus()
@@ -15,14 +34,14 @@ hexchat = dbus.Interface(proxy, 'org.hexchat.plugin')
 channels = hexchat.ListGet ("channels")
 while hexchat.ListNext (channels):
 	name = hexchat.ListStr (channels, "channel")
-	print "------- " + name + " -------"
+	print("------- " + name + " -------")
 	hexchat.SetContext (hexchat.ListInt (channels, "context"))
 	hexchat.EmitPrint ("Channel Message", ["John", "Hi there", "@"])
 	users = hexchat.ListGet ("users")
 	while hexchat.ListNext (users):
-		print "Nick: " + hexchat.ListStr (users, "nick")
+		print("Nick: " + hexchat.ListStr (users, "nick"))
 	hexchat.ListFree (users)
 hexchat.ListFree (channels)
 
-print hexchat.Strip ("\00312Blue\003 \002Bold!\002", -1, 1|2)
+print(hexchat.Strip ("\00312Blue\003 \002Bold!\002", -1, 1|2))
 
diff --git a/src/common/dcc.h b/src/common/dcc.h
index 6dcd53d5..32d0ed5f 100644
--- a/src/common/dcc.h
+++ b/src/common/dcc.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /* dcc.h */
 
 #include <time.h>						/* for time_t */
diff --git a/src/common/fe.h b/src/common/fe.h
index 4903ef0e..22db38df 100644
--- a/src/common/fe.h
+++ b/src/common/fe.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #include "userlist.h"
 #include "dcc.h"
 
@@ -59,9 +78,8 @@ int fe_is_chanwindow (struct server *serv);
 void fe_add_chan_list (struct server *serv, char *chan, char *users,
 							  char *topic);
 void fe_chan_list_end (struct server *serv);
-int fe_is_banwindow (struct session *sess);
-void fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int is_exemption);
-void fe_ban_list_end (struct session *sess, int is_exemption);
+gboolean fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int rplcode);
+gboolean fe_ban_list_end (struct session *sess, int rplcode);
 void fe_notify_update (char *name);
 void fe_notify_ask (char *name, char *networks);
 void fe_text_clear (struct session *sess, int lines);
diff --git a/src/common/hexchat-plugin.h b/src/common/hexchat-plugin.h
index f6e9a659..36dc544f 100644
--- a/src/common/hexchat-plugin.h
+++ b/src/common/hexchat-plugin.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /* You can distribute this header with your plugins for easy compilation */
 #ifndef HEXCHAT_PLUGIN_H
 #define HEXCHAT_PLUGIN_H
diff --git a/src/common/hexchat.c b/src/common/hexchat.c
index b6c12ce2..140f7653 100644
--- a/src/common/hexchat.c
+++ b/src/common/hexchat.c
@@ -1009,46 +1009,6 @@ hexchat_execv (char * const argv[])
 #endif
 }
 
-#if 0 /* def WIN32 */
-static void
-xchat_restore_window (HWND hexchat_window)
-{
-	/* ShowWindow (hexchat_window, SW_RESTORE); another way, but works worse */
-	SendMessage (hexchat_window, WM_SYSCOMMAND, SC_RESTORE, 0);
-	SetForegroundWindow (hexchat_window);
-}
-
-BOOL CALLBACK
-enum_windows_impl (HWND current_window, LPARAM lParam)
-{
-	TCHAR window_name[8];
-	TCHAR module_path[1024];
-	ZeroMemory (&window_name, sizeof (window_name));
-
-	if (!current_window)
-	{
-		return TRUE;
-	}
-
-	GetWindowText (current_window, window_name, 8);		/* name length + 1 */
-	if (strcmp (window_name, "HexChat") == 0)
-	{
-		/* use a separate if block, this way we don't have to call GetWindowModuleFileName() for each hit */
-		ZeroMemory (&module_path, sizeof (module_path));
-		GetWindowModuleFileName (current_window, module_path, sizeof (module_path));
-
-		if (strstr (module_path, "hexchat.exe"))	/* We've found it, stop */
-		{
-			xchat_restore_window (current_window);
-			return FALSE;
-		}
-	}
-
-	return TRUE;								/* Keep searching */
-
-}
-#endif
-
 int
 main (int argc, char *argv[])
 {
@@ -1057,7 +1017,6 @@ main (int argc, char *argv[])
 
 #ifdef WIN32
 	char hexchat_lang[13];	/* LC_ALL= plus 5 chars of hex_gui_lang and trailing \0 */
-	/* HANDLE mutex; */
 #endif
 
 	srand (time (0));	/* CL: do this only once! */
@@ -1258,33 +1217,6 @@ main (int argc, char *argv[])
 	}
 
 	putenv (hexchat_lang);
-
-#if 0
-	if (prefs.hex_gui_single && !portable_mode ())
-	{
-		DWORD error;
-
-		mutex = CreateMutex (NULL, TRUE, "Local\\hexchat");
-		error = GetLastError ();
-
-		if (error == ERROR_ALREADY_EXISTS || mutex == NULL)
-		{
-			/* Restoring the HexChat window from the tray via the taskbar icon.
-			 * Only works correctly when HexTray is used.
-			 */
-			if (hextray_mode ())
-			{
-				/* FindWindow() doesn't support wildcards so we check all the open windows */
-				EnumWindows (enum_windows_impl, (LPARAM) NULL);
-				return 0;
-			}
-			else
-			{
-				return 1;
-			}
-		}
-	}
-#endif
 #endif
 
 #ifdef SOCKS
@@ -1324,14 +1256,6 @@ main (int argc, char *argv[])
 
 #ifdef WIN32
 	WSACleanup ();
-
-#if 0
-	if (prefs.hex_gui_single && !portable_mode ())
-	{
-		ReleaseMutex (mutex);
-		CloseHandle (mutex);
-	}
-#endif
 #endif
 
 	return 0;
diff --git a/src/common/hexchat.h b/src/common/hexchat.h
index 4f5c82a8..3e07ec4e 100644
--- a/src/common/hexchat.h
+++ b/src/common/hexchat.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifdef WIN32
 #include "../../config-win32.h"
 #else
@@ -146,7 +165,6 @@ struct hexchatprefs
 	unsigned int hex_gui_tab_dialogs;
 	unsigned int hex_gui_tab_dots;
 	unsigned int hex_gui_tab_icons;
-	unsigned int hex_gui_tab_notices;
 	unsigned int hex_gui_tab_server;
 	unsigned int hex_gui_tab_sort;
 	unsigned int hex_gui_tab_utils;
@@ -158,6 +176,7 @@ struct hexchatprefs
 	unsigned int hex_gui_tray_minimize;
 	unsigned int hex_gui_tray_quiet;
 	unsigned int hex_gui_ulist_buttons;
+	unsigned int hex_gui_ulist_color;
 	unsigned int hex_gui_ulist_count;
 	unsigned int hex_gui_ulist_hide;
 	unsigned int hex_gui_ulist_icons;
@@ -276,6 +295,7 @@ struct hexchatprefs
 	int hex_input_balloon_time;
 	int hex_irc_ban_type;
 	int hex_irc_join_delay;
+	int hex_irc_notice_pos;
 	int hex_net_ping_timeout;
 	int hex_net_proxy_port;
 	int hex_net_proxy_type;				/* 0=disabled, 1=wingate 2=socks4, 3=socks5, 4=http */
@@ -572,10 +592,10 @@ typedef struct server
 	unsigned int have_awaynotify:1;
 	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 */
+	unsigned int have_invite:1;	/* invite exemptions +I */
 	unsigned int using_cp1255:1;	/* encoding is CP1255/WINDOWS-1255? */
 	unsigned int using_irc:1;		/* encoding is "IRC" (CP1252/UTF-8 hybrid)? */
 	unsigned int use_who:1;			/* whether to use WHO command to get dcc_ip */
diff --git a/src/common/hexchatc.h b/src/common/hexchatc.h
index 9650dc10..774f4dd9 100644
--- a/src/common/hexchatc.h
+++ b/src/common/hexchatc.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_C_H
 #define HEXCHAT_C_H
 
diff --git a/src/common/history.h b/src/common/history.h
index c5696d70..dc79192c 100644
--- a/src/common/history.h
+++ b/src/common/history.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_HISTORY_H
 #define HEXCHAT_HISTORY_H
 
diff --git a/src/common/identd.c b/src/common/identd.c
index 5cfc536f..6dde6a5f 100644
--- a/src/common/identd.c
+++ b/src/common/identd.c
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /* simple identd server for HexChat under Win32 */
 
 #include "inet.h"
diff --git a/src/common/identd.h b/src/common/identd.h
index 636f9641..3b29135f 100644
--- a/src/common/identd.h
+++ b/src/common/identd.h
@@ -1 +1,25 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef HEXCHAT_IDENTD_H
+#define HEXCHAT_IDENTD_H
+
 void identd_start (char *username);
+
+#endif
diff --git a/src/common/ignore.h b/src/common/ignore.h
index e4b14a3f..3263a940 100644
--- a/src/common/ignore.h
+++ b/src/common/ignore.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_IGNORE_H
 #define HEXCHAT_IGNORE_H
 
diff --git a/src/common/inbound.c b/src/common/inbound.c
index d44fbef6..878a8759 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -155,6 +155,7 @@ void
 inbound_privmsg (server *serv, char *from, char *ip, char *text, int id)
 {
 	session *sess;
+	struct User *user;
 	char idtext[64];
 
 	sess = find_dialog (serv, from);
@@ -197,6 +198,10 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id)
 		EMIT_SIGNAL (XP_TE_PRIVMSG, sess, from, text, idtext, NULL, 0);
 		return;
 	}
+	
+	user = userlist_find (sess, from);
+	if (user)
+		user->lasttalk = time (0);
 
 	if (sess->type == SESS_DIALOG)
 		EMIT_SIGNAL (XP_TE_DPRIVMSG, sess, from, text, idtext, NULL, 0);
@@ -867,7 +872,27 @@ inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id)
 	if (!sess)
 	{
 		ptr = 0;
-		if (prefs.hex_gui_tab_notices)
+		if (prefs.hex_irc_notice_pos == 0)
+		{
+											/* paranoia check */
+			if (msg[0] == '[' && (!serv->have_idmsg || id))
+			{
+				/* guess where chanserv meant to post this -sigh- */
+				if (!g_ascii_strcasecmp (nick, "ChanServ") && !find_dialog (serv, nick))
+				{
+					char *dest = strdup (msg + 1);
+					char *end = strchr (dest, ']');
+					if (end)
+					{
+						*end = 0;
+						sess = find_channel (serv, dest);
+					}
+					free (dest);
+				}
+			}
+			if (!sess)
+				sess = find_session_from_nick (nick, serv);
+		} else if (prefs.hex_irc_notice_pos == 1)
 		{
 			int stype = server_notice ? SESS_SNOTICES : SESS_NOTICES;
 			sess = find_session_from_type (stype, serv);
@@ -888,25 +913,9 @@ inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id)
 				msg += 14;
 		} else
 		{
-											/* paranoia check */
-			if (msg[0] == '[' && (!serv->have_idmsg || id))
-			{
-				/* guess where chanserv meant to post this -sigh- */
-				if (!g_ascii_strcasecmp (nick, "ChanServ") && !find_dialog (serv, nick))
-				{
-					char *dest = strdup (msg + 1);
-					char *end = strchr (dest, ']');
-					if (end)
-					{
-						*end = 0;
-						sess = find_channel (serv, dest);
-					}
-					free (dest);
-				}
-			}
-			if (!sess)
-				sess = find_session_from_nick (nick, serv);
+			sess = serv->front_session;
 		}
+
 		if (!sess)
 		{
 			if (server_notice)	
@@ -1046,6 +1055,7 @@ check_autojoin_channels (server *serv)
 
 		free (serv->autojoin);
 		serv->autojoin = NULL;
+		i++;
 	}
 
 	/* this is really only for re-connects when you
@@ -1069,8 +1079,17 @@ check_autojoin_channels (server *serv)
 				if (po)
 					*po = 0;
 
-				channels = g_slist_append (channels, g_strdup (sess->waitchannel));
-				keys = g_slist_append (keys, g_strdup (sess->channelkey));
+				/* There can be no gap between keys, list keyed chans first. */
+				if (sess->channelkey[0] != 0)
+				{
+					channels = g_slist_prepend (channels, g_strdup (sess->waitchannel));
+					keys = g_slist_prepend (keys, g_strdup (sess->channelkey));
+				}
+				else
+				{
+					channels = g_slist_append (channels, g_strdup (sess->waitchannel));
+					keys = g_slist_append (keys, g_strdup (sess->channelkey));
+				}
 				i++;
 			}
 		}
@@ -1274,12 +1293,14 @@ inbound_user_info (session *sess, char *chan, char *user, char *host,
 }
 
 int
-inbound_banlist (session *sess, time_t stamp, char *chan, char *mask, char *banner, int is_exemption)
+inbound_banlist (session *sess, time_t stamp, char *chan, char *mask, char *banner, int rplcode)
 {
 	char *time_str = ctime (&stamp);
 	server *serv = sess->server;
+	char *nl;
 
-	time_str[19] = 0;	/* get rid of the \n */
+	if ((nl = strchr (time_str, '\n')))
+		*nl = 0;
 	if (stamp == 0)
 		time_str = "";
 
@@ -1290,18 +1311,17 @@ inbound_banlist (session *sess, time_t stamp, char *chan, char *mask, char *bann
 		goto nowindow;
 	}
 
-   if (!fe_is_banwindow (sess))
+	if (!fe_add_ban_list (sess, mask, banner, time_str, rplcode))
 	{
 nowindow:
 		/* let proto-irc.c do the 'goto def' for exemptions */
-		if (is_exemption)
+		if (rplcode != 367)	/* RPL_EXCEPTLIST */
 			return FALSE;
 
 		EMIT_SIGNAL (XP_TE_BANLIST, sess, chan, mask, banner, time_str, 0);
 		return TRUE;
 	}
 
-	fe_add_ban_list (sess, mask, banner, time_str, is_exemption);
 	return TRUE;
 }
 
diff --git a/src/common/inbound.h b/src/common/inbound.h
index 319996ed..d77a9e53 100644
--- a/src/common/inbound.h
+++ b/src/common/inbound.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_INBOUND_H
 #define HEXCHAT_INBOUND_H
 
diff --git a/src/common/inet.h b/src/common/inet.h
index 75e2fb01..36d5bb60 100644
--- a/src/common/inet.h
+++ b/src/common/inet.h
@@ -1,5 +1,27 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /* include stuff for internet */
 
+#ifndef HEXCHAT_INET_H
+#define HEXCHAT_INET_H
+
 #ifndef WIN32
 
 #ifdef WANTSOCKET
@@ -41,3 +63,5 @@
 #define sock_error WSAGetLastError
 
 #endif
+
+#endif
diff --git a/src/common/make-te-xp.vcxproj b/src/common/make-te-xp.vcxproj
deleted file mode 100644
index bd4cb2da..00000000
--- a/src/common/make-te-xp.vcxproj
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>

-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

-  <ItemGroup Label="ProjectConfigurations">

-    <ProjectConfiguration Include="Release|Win32">

-      <Configuration>Release</Configuration>

-      <Platform>Win32</Platform>

-    </ProjectConfiguration>

-    <ProjectConfiguration Include="Release|x64">

-      <Configuration>Release</Configuration>

-      <Platform>x64</Platform>

-    </ProjectConfiguration>

-  </ItemGroup>

-  <PropertyGroup Label="Globals">

-    <ProjectGuid>{A7D7CE59-2A31-48AE-BED2-A9828E241832}</ProjectGuid>

-    <Keyword>Win32Proj</Keyword>

-    <RootNamespace>makete</RootNamespace>

-    <ProjectName>make-te</ProjectName>

-  </PropertyGroup>

-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

-    <ConfigurationType>Application</ConfigurationType>

-    <UseDebugLibraries>false</UseDebugLibraries>

-    <WholeProgramOptimization>true</WholeProgramOptimization>

-    <CharacterSet>MultiByte</CharacterSet>

-    <PlatformToolset>WDK7</PlatformToolset>

-  </PropertyGroup>

-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

-    <ConfigurationType>Application</ConfigurationType>

-    <UseDebugLibraries>false</UseDebugLibraries>

-    <WholeProgramOptimization>true</WholeProgramOptimization>

-    <CharacterSet>MultiByte</CharacterSet>

-    <PlatformToolset>WDK7</PlatformToolset>

-  </PropertyGroup>

-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

-  <ImportGroup Label="ExtensionSettings">

-  </ImportGroup>

-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />

-    <Import Project="..\..\win32\hexchat-xp.props" />

-  </ImportGroup>

-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">

-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />

-    <Import Project="..\..\win32\hexchat-xp.props" />

-  </ImportGroup>

-  <PropertyGroup Label="UserMacros" />

-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

-    <LinkIncremental>false</LinkIncremental>

-    <OutDir>$(HexChatBin)</OutDir>

-    <IntDir>$(HexChatObj)$(ProjectName)\</IntDir>

-  </PropertyGroup>

-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

-    <LinkIncremental>false</LinkIncremental>

-    <OutDir>$(HexChatBin)</OutDir>

-    <IntDir>$(HexChatObj)$(ProjectName)\</IntDir>

-  </PropertyGroup>

-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

-    <ClCompile>

-      <PrecompiledHeader>

-      </PrecompiledHeader>

-      <Optimization>MaxSpeed</Optimization>

-      <FunctionLevelLinking>true</FunctionLevelLinking>

-      <IntrinsicFunctions>true</IntrinsicFunctions>

-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

-      <MultiProcessorCompilation>true</MultiProcessorCompilation>

-    </ClCompile>

-    <Link>

-      <SubSystem>Console</SubSystem>

-      <GenerateDebugInformation>true</GenerateDebugInformation>

-      <EnableCOMDATFolding>true</EnableCOMDATFolding>

-      <OptimizeReferences>true</OptimizeReferences>

-    </Link>

-    <PostBuildEvent>

-      <Command>"$(HexChatBin)make-te.exe" &lt; "$(ProjectDir)textevents.in" &gt; "$(ProjectDir)textevents.h" 2&gt; "$(ProjectDir)textenums.h"</Command>

-    </PostBuildEvent>

-  </ItemDefinitionGroup>

-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

-    <ClCompile>

-      <PrecompiledHeader>

-      </PrecompiledHeader>

-      <Optimization>MaxSpeed</Optimization>

-      <FunctionLevelLinking>true</FunctionLevelLinking>

-      <IntrinsicFunctions>true</IntrinsicFunctions>

-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

-      <MultiProcessorCompilation>true</MultiProcessorCompilation>

-    </ClCompile>

-    <Link>

-      <SubSystem>Console</SubSystem>

-      <GenerateDebugInformation>true</GenerateDebugInformation>

-      <EnableCOMDATFolding>true</EnableCOMDATFolding>

-      <OptimizeReferences>true</OptimizeReferences>

-    </Link>

-    <PostBuildEvent>

-      <Command>"$(HexChatBin)make-te.exe" &lt; "$(ProjectDir)textevents.in" &gt; "$(ProjectDir)textevents.h" 2&gt; "$(ProjectDir)textenums.h"</Command>

-    </PostBuildEvent>

-  </ItemDefinitionGroup>

-  <ItemGroup>

-    <ClCompile Include="make-te.c" />

-  </ItemGroup>

-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

-  <ImportGroup Label="ExtensionTargets">

-  </ImportGroup>

-</Project>
\ No newline at end of file
diff --git a/src/common/make-te-xp.vcxproj.filters b/src/common/make-te-xp.vcxproj.filters
deleted file mode 100644
index ac9f0939..00000000
--- a/src/common/make-te-xp.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>

-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

-  <ItemGroup>

-    <Filter Include="Source Files">

-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>

-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>

-    </Filter>

-    <Filter Include="Header Files">

-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>

-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>

-    </Filter>

-    <Filter Include="Resource Files">

-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>

-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>

-    </Filter>

-  </ItemGroup>

-  <ItemGroup>

-    <ClCompile Include="make-te.c">

-      <Filter>Source Files</Filter>

-    </ClCompile>

-  </ItemGroup>

-</Project>
\ No newline at end of file
diff --git a/src/common/make-te.c b/src/common/make-te.c
index 117d41ab..309eec2f 100644
--- a/src/common/make-te.c
+++ b/src/common/make-te.c
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /* Process textevents.in with make-te < textevents.in > textevents.h 2> textenums.h
  *
  * textevents.in notes:
diff --git a/src/common/modes.c b/src/common/modes.c
index 6caa46b9..419b704a 100644
--- a/src/common/modes.c
+++ b/src/common/modes.c
@@ -19,8 +19,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <glib.h>
-#include <glib/gprintf.h>
 
 #include "hexchat.h"
 #include "hexchatc.h"
@@ -34,6 +32,8 @@
 #include <strings.h>
 #endif
 
+#include <glib/gprintf.h>
+
 typedef struct
 {
 	server *serv;
@@ -813,17 +813,15 @@ 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
 			serv->have_except = TRUE;
 #endif
+		} else if (strcmp (word[w], "INVEX") == 0)
+		{
+			/* supports mode letter +I, default channel invite */
+			serv->have_invite = TRUE;
 		} else if (strncmp (word[w], "ELIST=", 6) == 0)
 		{
 			/* supports LIST >< min/max user counts? */
diff --git a/src/common/modes.h b/src/common/modes.h
index 30ccbd72..e55ec911 100644
--- a/src/common/modes.h
+++ b/src/common/modes.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_MODES_H
 #define HEXCHAT_MODES_H
 
diff --git a/src/common/msproxy.h b/src/common/msproxy.h
index 9fb312ad..4371d704 100644
--- a/src/common/msproxy.h
+++ b/src/common/msproxy.h
@@ -21,6 +21,9 @@
  *      Inferno Nettverk A/S, Norway.  All rights reserved.
  */
 
+#ifndef HEXCHAT_MSPROXY_H
+#define HEXCHAT_MSPROXY_H
+
 #include "network.h"
 
 #define MSPROXY_EXECUTABLE 		"hexchat.exe"	/* This probably can be used for access control on the server side */
@@ -255,3 +258,5 @@ struct msproxy_response_t {
 
 int traverse_msproxy (int sok, char *serverAddr, int port, struct msproxy_state_t *state, netstore *ns_proxy, int csok4, int csok6, int *csok, char bound);
 void msproxy_keepalive (void);
+
+#endif
diff --git a/src/common/network.h b/src/common/network.h
index d7957568..6a4dce39 100644
--- a/src/common/network.h
+++ b/src/common/network.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_NETWORK_H
 #define HEXCHAT_NETWORK_H
 
diff --git a/src/common/notify.h b/src/common/notify.h
index eefb30e8..8e513d5f 100644
--- a/src/common/notify.h
+++ b/src/common/notify.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_NOTIFY_H
 #define HEXCHAT_NOTIFY_H
 
diff --git a/src/common/outbound.c b/src/common/outbound.c
index c146c2ac..c3325f7c 100644
--- a/src/common/outbound.c
+++ b/src/common/outbound.c
@@ -2272,7 +2272,7 @@ cmd_ignore (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 		return TRUE;
 	}
 	if (!*word[3])
-		return FALSE;
+		word[3] = "ALL";
 
 	i = 3;
 	while (1)
@@ -2873,7 +2873,7 @@ open_query (server *serv, char *nick, gboolean focus_existing)
 
 	sess = find_dialog (serv, nick);
 	if (!sess)
-		new_ircwindow (serv, nick, SESS_DIALOG, 1);
+		new_ircwindow (serv, nick, SESS_DIALOG, focus_existing);
 	else if (focus_existing)
 		fe_ctrl_gui (sess, 2, 0);	/* bring-to-front */
 }
@@ -3066,7 +3066,7 @@ cmd_splay (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 }
 
 static int
-parse_irc_url (char *url, char *server_name[], char *port[], char *channel[], int *use_ssl)
+parse_irc_url (char *url, char *server_name[], char *port[], char *channel[], char *key[], int *use_ssl)
 {
 	char *co;
 #ifdef USE_OPENSSL
@@ -3102,8 +3102,17 @@ urlserv:
 				*channel = co+1;
 			else
 				*channel = co;
-			
+				
+			/* check for key - mirc style */
+			co = strchr (co + 1, '?');
+			if (co)
+			{
+				*co = 0;
+				co++;
+				*key = co;
+			}	
 		}
+			
 		return TRUE;
 	}
 	return FALSE;
@@ -3117,6 +3126,7 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 	char *port = NULL;
 	char *pass = NULL;
 	char *channel = NULL;
+	char *key = NULL;
 	int use_ssl = FALSE;
 	int is_url = TRUE;
 	server *serv = sess->server;
@@ -3130,7 +3140,7 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 	}
 #endif
 
-	if (!parse_irc_url (word[2 + offset], &server_name, &port, &channel, &use_ssl))
+	if (!parse_irc_url (word[2 + offset], &server_name, &port, &channel, &key, &use_ssl))
 	{
 		is_url = FALSE;
 		server_name = word[2 + offset];
@@ -3156,6 +3166,8 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 	{
 		sess->willjoinchannel[0] = '#';
 		safe_strcpy ((sess->willjoinchannel + 1), channel, (CHANLEN - 1));
+		if (key)
+			safe_strcpy (sess->channelkey, key, 64);
 	}
 
 	/* support +7000 style ports like mIRC */
@@ -3277,6 +3289,12 @@ cmd_unignore (struct session *sess, char *tbuf, char *word[],
 	char *arg = word[3];
 	if (*mask)
 	{
+		if (strchr (mask, '?') == NULL && strchr (mask, '*') == NULL)
+		{
+			mask = tbuf;
+			snprintf (tbuf, TBUFSIZE, "%s!*@*", word[2]);
+		}
+		
 		if (ignore_del (mask, NULL))
 		{
 			if (g_ascii_strcasecmp (arg, "QUIET"))
@@ -3356,15 +3374,18 @@ find_server_from_net (void *net)
 }
 
 static void
-url_join_only (server *serv, char *tbuf, char *channel)
+url_join_only (server *serv, char *tbuf, char *channel, char *key)
 {
-	/* already connected, JOIN only. FIXME: support keys? */
+	/* already connected, JOIN only. */
 	if (channel == NULL)
 		return;
 	tbuf[0] = '#';
 	/* tbuf is 4kb */
 	safe_strcpy ((tbuf + 1), channel, 256);
-	serv->p_join (serv, tbuf, "");
+	if (key)
+		serv->p_join (serv, tbuf, key);
+	else
+		serv->p_join (serv, tbuf, "");
 }
 
 static int
@@ -3375,12 +3396,13 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 		char *server_name = NULL;
 		char *port = NULL;
 		char *channel = NULL;
+		char *key = NULL;
 		char *url = g_strdup (word[2]);
 		int use_ssl = FALSE;
 		void *net;
 		server *serv;
 
-		if (parse_irc_url (url, &server_name, &port, &channel, &use_ssl))
+		if (parse_irc_url (url, &server_name, &port, &channel, &key, &use_ssl))
 		{
 			/* maybe we're already connected to this net */
 
@@ -3396,7 +3418,7 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 				serv = find_server_from_net (net);
 				if (serv)
 				{
-					url_join_only (serv, tbuf, channel);
+					url_join_only (serv, tbuf, channel, key);
 					g_free (url);
 					return TRUE;
 				}
@@ -3407,7 +3429,7 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 				serv = find_server_from_hostname (server_name);
 				if (serv)
 				{
-					url_join_only (serv, tbuf, channel);
+					url_join_only (serv, tbuf, channel, key);
 					g_free (url);
 					return TRUE;
 				}
@@ -4438,16 +4460,29 @@ handle_user_input (session *sess, char *text, int history, int nocommand)
 		return 1;
 	}
 
+#if 0 /* Who would remember all this? */
 	if (prefs.hex_input_command_char[0] == '/')
 	{
 		int i;
 		const char *unix_dirs [] = {
-			"/bin/", "/boot/", "/dev/",
-			"/etc/", "/home/", "/lib/",
-			"/lost+found/", "/mnt/", "/opt/",
-			"/proc/", "/root/", "/sbin/",
-			"/tmp/", "/usr/", "/var/",
-			"/gnome/", NULL};
+			"/bin/",
+			"/boot/",
+			"/dev/",
+			"/etc/",
+			"/home/",
+			"/lib/",
+			"/lost+found/",
+			"/mnt/",
+			"/opt/",
+			"/proc/",
+			"/root/",
+			"/sbin/",
+			"/tmp/",
+			"/usr/",
+			"/var/",
+			"/gnome/",
+			NULL
+		};
 		for (i = 0; unix_dirs[i] != NULL; i++)
 			if (strncmp (text, unix_dirs[i], strlen (unix_dirs[i]))==0)
 			{
@@ -4455,6 +4490,7 @@ handle_user_input (session *sess, char *text, int history, int nocommand)
 				return 1;
 			}
 	}
+#endif
 
 	return handle_command (sess, text + 1, TRUE);
 }
diff --git a/src/common/outbound.h b/src/common/outbound.h
index def3868d..6f45b121 100644
--- a/src/common/outbound.h
+++ b/src/common/outbound.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_OUTBOUND_H
 #define HEXCHAT_OUTBOUND_H
 
diff --git a/src/common/plugin-timer.c b/src/common/plugin-timer.c
index 7c87cc41..7f5f5cb4 100644
--- a/src/common/plugin-timer.c
+++ b/src/common/plugin-timer.c
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
diff --git a/src/common/plugin-timer.h b/src/common/plugin-timer.h
index 6be73760..711e2bd4 100644
--- a/src/common/plugin-timer.h
+++ b/src/common/plugin-timer.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_PLUGIN_TIMER_H
 #define HEXCHAT_PLUGIN_TIMER_H
 
diff --git a/src/common/plugin.c b/src/common/plugin.c
index fe58ba69..479994c8 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -471,7 +471,6 @@ plugin_auto_load (session *sess)
 	for_files (".\\plugins", "hcdoat.dll", plugin_auto_load_cb);
 	for_files (".\\plugins", "hcexec.dll", plugin_auto_load_cb);
 	for_files (".\\plugins", "hcfishlim.dll", plugin_auto_load_cb);
-	/* for_files (".\\plugins", "hchextray.dll", plugin_auto_load_cb); don't load HexTray until it's fixed */
 	for_files (".\\plugins", "hcmpcinfo.dll", plugin_auto_load_cb);
 	for_files (".\\plugins", "hcperl.dll", plugin_auto_load_cb);
 	for_files (".\\plugins", "hcpython.dll", plugin_auto_load_cb);
diff --git a/src/common/plugin.h b/src/common/plugin.h
index 0aa43f0b..dd878895 100644
--- a/src/common/plugin.h
+++ b/src/common/plugin.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_COMMONPLUGIN_H
 #define HEXCHAT_COMMONPLUGIN_H
 
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index 699d068d..906ee713 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]);
@@ -778,8 +770,18 @@ process_numeric (session * sess, int n,
 		}
 		break;
 
+	case 346:	/* +I-list entry */
+		if (!inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], 346))
+			goto def;
+		break;
+
+	case 347:	/* end of invite list */
+		if (!fe_ban_list_end (sess, 347))
+			goto def;
+		break;
+
 	case 348:	/* +e-list entry */
-		if (!inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], TRUE))
+		if (!inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], 348))
 			goto def;
 		break;
 
@@ -790,9 +792,8 @@ process_numeric (session * sess, int n,
 			sess = serv->front_session;
 			goto def;
 		}
-		if (!fe_is_banwindow (sess))
+		if (!fe_ban_list_end (sess, 349))
 			goto def;
-		fe_ban_list_end (sess, TRUE);
 		break;
 
 	case 353:						  /* NAMES */
@@ -806,7 +807,8 @@ process_numeric (session * sess, int n,
 		break;
 
 	case 367: /* banlist entry */
-		inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], FALSE);
+		if (!inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], 367))
+			goto def;
 		break;
 
 	case 368:
@@ -816,9 +818,8 @@ process_numeric (session * sess, int n,
 			sess = serv->front_session;
 			goto def;
 		}
-		if (!fe_is_banwindow (sess))
+		if (!fe_ban_list_end (sess, 368))
 			goto def;
-		fe_ban_list_end (sess, FALSE);
 		break;
 
 	case 369:	/* WHOWAS end */
@@ -881,6 +882,18 @@ process_numeric (session * sess, int n,
 		notify_set_online (serv, word[4]);
 		break;
 
+	case 728:	/* +q-list entry */
+		/* NOTE:  FREENODE returns these results inconsistent with e.g. +b */
+		/* Who else has imlemented MODE_QUIET, I wonder? */
+		if (!inbound_banlist (sess, atol (word[8]), word[4], word[6], word[7], 728))
+			goto def;
+		break;
+
+	case 729:	/* end of quiet list */
+		if (!fe_ban_list_end (sess, 729))
+			goto def;
+		break;
+
 	case 903:	/* successful SASL auth */
 	case 904:	/* aborted SASL auth */
 	case 905:	/* failed SASL auth */
diff --git a/src/common/proto-irc.h b/src/common/proto-irc.h
index 1070fd71..2de9815c 100644
--- a/src/common/proto-irc.h
+++ b/src/common/proto-irc.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_PROTO_H
 #define HEXCHAT_PROTO_H
 
diff --git a/src/common/server.c b/src/common/server.c
index ca873042..9e07b5d5 100644
--- a/src/common/server.c
+++ b/src/common/server.c
@@ -313,13 +313,6 @@ server_inline (server *serv, char *line, int len)
 {
 	char *utf_line_allocated = NULL;
 
-#ifdef WIN32
-#if 0
-	char *cleaned_line;
-	int cleaned_len;
-#endif
-#endif
-
 	/* Checks whether we're set to use UTF-8 charset */
 	if (serv->using_irc ||				/* 1. using CP1252/UTF-8 Hybrid */
 		(serv->encoding == NULL && prefs.utf8_locale) || /* OR 2. using system default->UTF-8 */
@@ -406,28 +399,11 @@ server_inline (server *serv, char *line, int len)
 		}
 	}
 
-#ifdef WIN32
-#if 0
-	cleaned_line = text_replace_non_bmp (line, len, &cleaned_len);
-	if (cleaned_line != NULL ) {
-		line = cleaned_line;
-		len = cleaned_len;
-	}
-#endif
-	text_replace_non_bmp2 (line);
-#endif
-
 	fe_add_rawlog (serv, line, len, FALSE);
 
 	/* let proto-irc.c handle it */
 	serv->p_inline (serv, line, len);
 
-#ifdef WIN32
-#if 0
-	g_free (cleaned_line);
-#endif
-#endif
-
 	if (utf_line_allocated != NULL) /* only if a special copy was allocated */
 		g_free (utf_line_allocated);
 }
@@ -1911,10 +1887,10 @@ server_set_defaults (server *serv)
 	serv->have_awaynotify = 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;
+	serv->have_invite = FALSE;
 }
 
 char *
diff --git a/src/common/server.h b/src/common/server.h
index e5c70636..08aeca56 100644
--- a/src/common/server.h
+++ b/src/common/server.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_SERVER_H
 #define HEXCHAT_SERVER_H
 
diff --git a/src/common/servlist.c b/src/common/servlist.c
index f4208f61..306b42e8 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -27,8 +27,6 @@
 #endif
 
 #include "hexchat.h"
-#include <glib.h>
-
 #include "cfgfiles.h"
 #include "fe.h"
 #include "server.h"
@@ -496,6 +494,9 @@ static const struct defaultserver def[] =
 #endif
 	{0,			"irc.snoonet.org/6667"},
 
+	{"Snyde", 0},
+	{0,			"irc.snyde.net/6667"},
+
 	{"Sohbet.Net", 0},
 	{0,			"irc.sohbet.net"},
 
@@ -511,6 +512,12 @@ static const struct defaultserver def[] =
 	{0,			"us.spidernet.org"},
 	{0,			"eu.spidernet.org"},
 	{0,			"irc.spidernet.org"},*/
+	
+	{"SpotChat", 0},
+#ifdef USE_OPENSSL
+	{0,			"irc.spotchat.org/+6697"},
+#endif
+	{0,			"irc.spotchat.org/6667"},
 
 	{"StarChat", 0},
 	{0,			"irc.starchat.net"},
@@ -1047,7 +1054,19 @@ servlist_load (void)
 	char *tmp;
 	ircnet *net = NULL;
 
-	fp = hexchat_fopen_file ("servlist_.conf", "r", 0);
+	/* simple migration we will keep for a short while */
+	char *oldfile = g_build_filename (get_xdir (), "servlist_.conf", NULL);
+	char *newfile = g_build_filename (get_xdir (), "servlist.conf", NULL);
+
+	if (g_file_test (oldfile, G_FILE_TEST_EXISTS) && !g_file_test (newfile, G_FILE_TEST_EXISTS))
+	{
+		g_rename (oldfile, newfile);
+	}
+
+	g_free (oldfile);
+	g_free (newfile);
+
+	fp = hexchat_fopen_file ("servlist.conf", "r", 0);
 	if (!fp)
 		return FALSE;
 
@@ -1178,12 +1197,12 @@ servlist_save (void)
 #ifndef WIN32
 	int first = FALSE;
 
-	buf = g_strdup_printf ("%s/servlist_.conf", get_xdir ());
+	buf = g_strdup_printf ("%s/servlist.conf", get_xdir ());
 	if (g_access (buf, F_OK) != 0)
 		first = TRUE;
 #endif
 
-	fp = hexchat_fopen_file ("servlist_.conf", "w", 0);
+	fp = hexchat_fopen_file ("servlist.conf", "w", 0);
 	if (!fp)
 	{
 #ifndef WIN32
diff --git a/src/common/servlist.h b/src/common/servlist.h
index b50ca0ea..5ed3c4d6 100644
--- a/src/common/servlist.h
+++ b/src/common/servlist.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_SERVLIST_H
 #define HEXCHAT_SERVLIST_H
 
diff --git a/src/common/ssl.c b/src/common/ssl.c
index 75a81250..742da619 100644
--- a/src/common/ssl.c
+++ b/src/common/ssl.c
@@ -31,7 +31,7 @@
 #include "ssl.h"				  /* struct cert_info */
 
 #ifndef HAVE_SNPRINTF
-#include <glib.h>

+#include <glib.h>
 #include <glib/gprintf.h>
 #define snprintf g_snprintf
 #endif
@@ -77,7 +77,7 @@ _SSL_context_init (void (*info_cb_func), int server)
 
 	SSLeay_add_ssl_algorithms ();
 	SSL_load_error_strings ();
-	ctx = SSL_CTX_new (server ? SSLv3_server_method() : SSLv3_client_method ());
+	ctx = SSL_CTX_new (server ? SSLv23_server_method() : SSLv23_client_method ());
 
 	SSL_CTX_set_session_cache_mode (ctx, SSL_SESS_CACHE_BOTH);
 	SSL_CTX_set_timeout (ctx, 300);
@@ -288,7 +288,7 @@ _SSL_socket (SSL_CTX *ctx, int sd)
 		__SSL_critical_error ("SSL_new");
 
 	SSL_set_fd (ssl, sd);
-	if (ctx->method == SSLv3_client_method())
+	if (ctx->method == SSLv23_client_method())
 		SSL_set_connect_state (ssl);
 	else
 	        SSL_set_accept_state(ssl);
diff --git a/src/common/ssl.h b/src/common/ssl.h
index 26eb0f88..ad34944c 100644
--- a/src/common/ssl.h
+++ b/src/common/ssl.h
@@ -1,6 +1,24 @@
-/*
-    ...
-*/
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef HEXCHAT_SSL_H
+#define HEXCHAT_SSL_H
 
 struct cert_info {
     char subject[256];
@@ -63,3 +81,5 @@ int _SSL_recv (SSL * ssl, char *buf, int len);
 #define	_SSL_get_ctx_x509_base64(a)	_SSL_get_ctx_obj_base64(a, 2)
 
 /*int _SSL_verify_x509(X509 *x509);*/
+
+#endif
diff --git a/src/common/strlutil.c b/src/common/strlutil.c
deleted file mode 100644
index c823c1e8..00000000
--- a/src/common/strlutil.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left).  At most siz-1 characters
- * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
- */
-size_t
-strlcat(char *dst, const char *src, size_t siz)
-{
-	char *d = dst;
-	const char *s = src;
-	size_t n = siz;
-	size_t dlen;
-
-	/* Find the end of dst and adjust bytes left but don't go past end */
-	while (n-- != 0 && *d != '\0')
-		d++;
-	dlen = d - dst;
-	n = siz - dlen;
-
-	if (n == 0)
-		return(dlen + strlen(s));
-	while (*s != '\0') {
-		if (n != 1) {
-			*d++ = *s;
-			n--;
-		}
-		s++;
-	}
-	*d = '\0';
-
-	return(dlen + (s - src));	/* count does not include NUL */
-}
-
-/*
- * Copy src to string dst of size siz.  At most siz-1 characters
- * will be copied.  Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t
-strlcpy(char *dst, const char *src, size_t siz)
-{
-	char *d = dst;
-	const char *s = src;
-	size_t n = siz;
-
-	/* Copy as many bytes as will fit */
-	if (n != 0) {
-		while (--n != 0) {
-			if ((*d++ = *s++) == '\0')
-				break;
-		}
-	}
-
-	/* Not enough room in dst, add NUL and traverse rest of src */
-	if (n == 0) {
-		if (siz != 0)
-			*d = '\0';		/* NUL-terminate dst */
-		while (*s++)
-			;
-	}
-
-	return(s - src - 1);	/* count does not include NUL */
-}
diff --git a/src/common/strlutil.h b/src/common/strlutil.h
deleted file mode 100644
index 968aab53..00000000
--- a/src/common/strlutil.h
+++ /dev/null
@@ -1,2 +0,0 @@
-size_t strlcat(char *dst, const char *src, size_t siz);
-size_t strlcpy(char *dst, const char *src, size_t siz);
diff --git a/src/common/text.c b/src/common/text.c
index 0bef377c..96fdacd0 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -33,7 +33,6 @@
 #endif
 
 #include "hexchat.h"
-#include <glib.h>
 #include "cfgfiles.h"
 #include "chanopt.h"
 #include "plugin.h"
@@ -307,21 +306,9 @@ scrollback_load (session *sess)
 					{
 						text = strip_color (text + 1, -1, STRIP_COLOR);
 					}
-#ifdef WIN32
-#if 0
-					cleaned_text = text_replace_non_bmp (text, -1, &cleaned_len);
-					if (cleaned_text != NULL)
-					{
-						if (prefs.hex_text_stripcolor_replay)
-						{
-							g_free (text);
-						}
-						text = cleaned_text;
-					}
-#endif
-					text_replace_non_bmp2 (text);
-#endif
+
 					fe_print_text (sess, text, stamp);
+
 					if (prefs.hex_text_stripcolor_replay)
 					{
 						g_free (text);
@@ -833,71 +820,6 @@ iso_8859_1_to_utf8 (unsigned char *text, int len, gsize *bytes_written)
 	return res;
 }
 
-#ifdef WIN32
-/* replace characters outside of the Basic Multilingual Plane with
- * replacement characters (0xFFFD) */
-#if 0
-char *
-text_replace_non_bmp (char *utf8_input, int input_length, glong *output_length)
-{
-	gunichar *ucs4_text;
-	gunichar suspect;
-	gchar *utf8_text;
-	glong ucs4_length;
-	glong index;
-
-	ucs4_text = g_utf8_to_ucs4_fast (utf8_input, input_length, &ucs4_length);
-
-	/* replace anything not in the Basic Multilingual Plane
-	 * (code points above 0xFFFF) with the replacement
-	 * character */
-	for (index = 0; index < ucs4_length; index++)
-	{
-		suspect = ucs4_text[index];
-		if ((suspect >= 0x1D173 && suspect <= 0x1D17A)
-			|| (suspect >= 0xE0001 && suspect <= 0xE007F))
-		{
-			ucs4_text[index] = 0xFFFD; /* replacement character */
-		}
-	}
-
-	utf8_text = g_ucs4_to_utf8 (
-		ucs4_text,
-		ucs4_length,
-		NULL,
-		output_length,
-		NULL
-	);
-	g_free (ucs4_text);
-
-	return utf8_text;
-}
-#endif
-
-void
-text_replace_non_bmp2 (char *utf8_input)
-{
-	char *tmp = utf8_input, *next;
-	gunichar suspect;
-
-	while (tmp != NULL && *tmp)
-	{
-		next = g_utf8_next_char(tmp);
-		suspect = g_utf8_get_char_validated(tmp, next - tmp);
-		if ((suspect >= 0x1D173 && suspect <= 0x1D17A) || (suspect >= 0xE0001 && suspect <= 0xE007F))
-		{
-			/* 0xFFFD - replacement character */
-			*tmp = 0xEF;
-			*(++tmp) = 0xBF;
-			*(++tmp) = 0xBD;
-			*(++tmp) = 0x1A;	/* ASCII Sub to fill the 4th non-BMP byte */
-		}
-
-		tmp = next;
-	}
-}
-#endif
-
 char *
 text_validate (char **text, int *len)
 {
@@ -1857,6 +1779,8 @@ format_event (session *sess, int index, char **args, char *o, int sizeofo, unsig
 				printf ("arg[%d] is NULL in print event\n", a + 1);
 			} else
 			{
+				if (strlen (ar) > sizeofo - oi - 4)
+					ar[sizeofo - oi - 4] = 0;	/* Avoid buffer overflow */
 				if (stripcolor_args & ARG_FLAG(a + 1)) len = strip_color2 (ar, -1, &o[oi], STRIP_ALL);
 				else len = strip_hidden_attribute (ar, &o[oi]);
 				oi += len;
@@ -2081,8 +2005,8 @@ pevt_build_string (const char *input, char **output, int *max_arg)
 
 static char rcolors[] = { 19, 20, 22, 24, 25, 26, 27, 28, 29 };
 
-static int
-color_of (char *name)
+int
+text_color_of (char *name)
 {
 	int i = 0, sum = 0;
 
@@ -2105,7 +2029,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
 
 	if (prefs.hex_text_color_nicks && (index == XP_TE_CHANACTION || index == XP_TE_CHANMSG))
 	{
-		snprintf (tbuf, sizeof (tbuf), "\003%d%s", color_of (a), a);
+		snprintf (tbuf, sizeof (tbuf), "\003%d%s", text_color_of (a), a);
 		a = tbuf;
 		stripcolor_args &= ~ARG_FLAG(1);	/* don't strip color from this argument */
 	}
diff --git a/src/common/text.h b/src/common/text.h
index ccbae785..52cc8ea9 100644
--- a/src/common/text.h
+++ b/src/common/text.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #include "textenums.h"
 
 #ifndef HEXCHAT_TEXT_H
@@ -26,14 +45,9 @@ void pevent_save (char *fn);
 int pevt_build_string (const char *input, char **output, int *max_arg);
 int pevent_load (char *filename);
 void pevent_make_pntevts (void);
+int text_color_of (char *name);
 void text_emit (int index, session *sess, char *a, char *b, char *c, char *d);
 int text_emit_by_name (char *name, session *sess, char *a, char *b, char *c, char *d);
-#ifdef WIN32
-#if 0
-char *text_replace_non_bmp (char *utf8_input, int input_length, glong *output_length);
-#endif
-void text_replace_non_bmp2 (char *utf8_input);
-#endif
 char *text_validate (char **text, int *len);
 int get_stamp_str (char *fmt, time_t tim, char **ret);
 void format_event (session *sess, int index, char **args, char *o, int sizeofo, unsigned int stripcolor_args);
diff --git a/src/common/textevents.in b/src/common/textevents.in
index 69d42526..7b7050ed 100644
--- a/src/common/textevents.in
+++ b/src/common/textevents.in
@@ -175,7 +175,7 @@ pevt_chanrmlimit_help
 Channel Set Key
 XP_TE_CHANSETKEY
 pevt_chansetkey_help
-%C22*%O$t$1 sets channel keyword to %C24$2%O
+%C22*%O$t%C26$1%O sets channel keyword to %C24$2%O
 2
 
 Channel Set Limit
@@ -187,7 +187,7 @@ pevt_chansetlimit_help
 Channel UnBan
 XP_TE_CHANUNBAN
 pevt_chanunban_help
-%C22*%O$t%C26$1%O removes ban on %C24$2%O
+%C22*%O$t%C26$1%O removes ban on %C18$2%O
 2
 
 Channel Voice
diff --git a/src/common/thread.c b/src/common/thread.c
index ba808737..40a8778f 100644
--- a/src/common/thread.c
+++ b/src/common/thread.c
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #if 0	/* native file dialogs */
 #include <fcntl.h>
 #include "thread.h"
diff --git a/src/common/thread.h b/src/common/thread.h
index 97a4ed30..2c736ca2 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -1,3 +1,25 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef HEXCHAT_THREAD_H
+#define HEXCHAT_THREAD_H
+
 #if 0	/* native file dialogs */
 #include <windows.h>
 
@@ -10,3 +32,5 @@ typedef struct
 thread *thread_new (void);
 int thread_start (thread *th, void *(*start_routine)(void *), void *arg);
 #endif
+
+#endif
diff --git a/src/common/tree.c b/src/common/tree.c
index 715b0e56..587d15f0 100644
--- a/src/common/tree.c
+++ b/src/common/tree.c
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /*
 This is used for quick userlist insertion and lookup. It's not really
 a tree, but it could be :)
diff --git a/src/common/tree.h b/src/common/tree.h
index ced8e425..848f5abf 100644
--- a/src/common/tree.h
+++ b/src/common/tree.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_TREE_H
 #define HEXCHAT_TREE_H
 
diff --git a/src/common/typedef.h b/src/common/typedef.h
index daeffcae..2034f923 100644
--- a/src/common/typedef.h
+++ b/src/common/typedef.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_TYPEDEF_H
 #define HEXCHAT_TYPEDEF_H
 
diff --git a/src/common/url.c b/src/common/url.c
index 6bd7d9ff..9b4e30ad 100644
--- a/src/common/url.c
+++ b/src/common/url.c
@@ -288,8 +288,8 @@ url_check_line (char *buf, int len)
 		int start, end;
 
 		g_match_info_fetch_pos(gmi, 0, &start, &end);
-		if (po[end - 1] == '\r')
-			po[--end] = 0;
+		while (end > start && (po[end - 1] == '\r' || po[end - 1] == '\n'))
+			end--;
 		if (g_strstr_len (po + start, end - start, "://"))
 			url_add(po + start, end - start);
 		g_match_info_next(gmi, NULL);
@@ -515,8 +515,8 @@ re_channel (void)
 
 /*	PATH description --- */
 #ifdef WIN32
-/* Windows path can be C: D: etc */
-#define PATH "^([a-z]:).*"
+/* Windows path can be .\ ..\ or C: D: etc */
+#define PATH "^(\\.{1,2}\\\\|[a-z]:).*"
 #else
 /* Linux path can be / or ./ or ../ etc */
 #define PATH "^(/|\\./|\\.\\./).*"
diff --git a/src/common/url.h b/src/common/url.h
index b8e5c848..96d9f946 100644
--- a/src/common/url.h
+++ b/src/common/url.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #ifndef HEXCHAT_URL_H
 #define HEXCHAT_URL_H
 
diff --git a/src/common/userlist.h b/src/common/userlist.h
index d0d79da8..c1070670 100644
--- a/src/common/userlist.h
+++ b/src/common/userlist.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 #include <time.h>
 
 #ifndef HEXCHAT_USERLIST_H
diff --git a/src/common/util.c b/src/common/util.c
index 2319f75e..9ce23879 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -48,7 +48,6 @@
 #include <errno.h>
 #include "hexchat.h"
 #include "hexchatc.h"
-#include <glib.h>
 #include <ctype.h>
 #include "util.h"
 
@@ -1861,20 +1860,14 @@ portable_mode ()
 }
 
 int
-hextray_mode ()
+unity_mode ()
 {
-#ifdef WIN32
-	if ((_access( "plugins/hchextray.dll", 0 )) != -1)
-	{
+#ifdef G_OS_UNIX
+	const char *env = g_getenv("XDG_CURRENT_DESKTOP");
+	if (env && strcmp (env, "Unity") == 0)
 		return 1;
-	}
-	else
-	{
-		return 0;
-	}
-#else
-	return 0;
 #endif
+	return 0;
 }
 
 /* Routine for listing subfolders of a given folder. ALWAYS free correctly after use, e.g.
diff --git a/src/common/util.h b/src/common/util.h
index 8114cbc7..9e2d9f52 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -1,3 +1,22 @@
+/* HexChat
+ * Copyright (C) 1998-2010 Peter Zelezny.
+ * Copyright (C) 2009-2013 Berke Viktor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
 /************************************************************************
  *    This technique was borrowed in part from the source code to 
  *    ircd-hybrid-5.3 to implement case-insensitive string matches which
@@ -14,7 +33,6 @@
 #ifndef HEXCHAT_UTIL_H
 #define HEXCHAT_UTIL_H
 
-#include "strlutil.h"
 #define rfc_tolower(c) (rfc_tolowertab[(unsigned char)(c)])
 
 extern const unsigned char rfc_tolowertab[];
@@ -59,7 +77,7 @@ guint32 str_ihash (const unsigned char *key);
 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);