From f0554b27df459b7794d990f9da72318e2e3d2620 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 23 May 2021 19:01:39 +0100 Subject: [PATCH 01/20] Add a workaround for icons not scaling right on HiDPI screens. (#2573) --- src/fe-gtk/pixmaps.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/fe-gtk/pixmaps.c b/src/fe-gtk/pixmaps.c index 6c6cfaeb..9bdf46fc 100644 --- a/src/fe-gtk/pixmaps.c +++ b/src/fe-gtk/pixmaps.c @@ -89,7 +89,9 @@ pixmap_load_from_file (char *filename) static GdkPixbuf * load_pixmap (const char *filename) { - GdkPixbuf *pixbuf; + GdkPixbuf *pixbuf, *scaledpixbuf; + const char *scale; + int iscale; gchar *path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "icons" G_DIR_SEPARATOR_S "%s.png", get_xdir (), filename); pixbuf = gdk_pixbuf_new_from_file (path, 0); @@ -102,6 +104,24 @@ load_pixmap (const char *filename) g_free (path); } + // Hack to avoid unbearably tiny icons on HiDPI screens. + scale = g_getenv ("GDK_SCALE"); + if (scale) + { + iscale = atoi (scale); + if (iscale > 0) + { + scaledpixbuf = gdk_pixbuf_scale_simple (pixbuf, gdk_pixbuf_get_width (pixbuf) * iscale, + gdk_pixbuf_get_height (pixbuf) * iscale, GDK_INTERP_BILINEAR); + + if (scaledpixbuf) + { + g_object_unref (pixbuf); + pixbuf = scaledpixbuf; + } + } + } + g_warn_if_fail (pixbuf != NULL); return pixbuf; From e4fd69e3d4ec2eb707a693ea69b8e14181249d0a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 23 May 2021 19:12:10 +0100 Subject: [PATCH 02/20] Implement support for the IRCv3 SETNAME specification. (#2571) --- src/common/inbound.c | 1 + src/common/proto-irc.c | 5 +++++ src/common/userlist.c | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/inbound.c b/src/common/inbound.c index 71c60357..a7cf51a4 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1724,6 +1724,7 @@ static const char * const supported_caps[] = { "userhost-in-names", "cap-notify", "chghost", + "setname", /* ZNC */ "znc.in/server-time-iso", diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index fa2d822b..e3f4a962 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -1157,6 +1157,11 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], NULL, 0xff, tags_data); return; + case WORDL('S', 'E', 'T', 'N'): + inbound_user_info (sess, NULL, NULL, NULL, NULL, nick, STRIP_COLON(word, word_eol, 3), + NULL, 0xff, tags_data); + return; + case WORDL('I','N','V','I'): if (ignore_check (word[1], IG_INVI)) return; diff --git a/src/common/userlist.c b/src/common/userlist.c index 0f28a000..17719ff6 100644 --- a/src/common/userlist.c +++ b/src/common/userlist.c @@ -130,8 +130,11 @@ userlist_add_hostname (struct session *sess, char *nick, char *hostname, g_free (user->hostname); user->hostname = g_strdup (hostname); } - if (!user->realname && realname && *realname) + if (realname && *realname && g_strcmp0 (user->realname, realname) != 0) + { + g_free (user->realname); user->realname = g_strdup (realname); + } if (!user->servername && servername) user->servername = g_strdup (servername); if (!user->account && account && strcmp (account, "0") != 0) From c06f6f2565513089462ba2c627457e66ff637be9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 24 May 2021 01:32:00 +0100 Subject: [PATCH 03/20] Implement support for the IRCv3 invite-notify specification. (#2574) --- src/common/inbound.c | 1 + src/common/proto-irc.c | 11 ++++++----- src/common/text.c | 7 +++++++ src/common/textevents.in | 6 ++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/common/inbound.c b/src/common/inbound.c index a7cf51a4..3a26dce9 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1725,6 +1725,7 @@ static const char * const supported_caps[] = { "cap-notify", "chghost", "setname", + "invite-notify", /* ZNC */ "znc.in/server-time-iso", diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index e3f4a962..57eda88a 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -1165,13 +1165,14 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], case WORDL('I','N','V','I'): if (ignore_check (word[1], IG_INVI)) return; - - if (word[4][0] == ':') - EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, word[4] + 1, nick, - serv->servername, NULL, 0, + + text = STRIP_COLON(word, word_eol, 4); + if (serv->p_cmp (word[3], serv->nick)) + EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITEDOTHER, sess, text, nick, + word[3], serv->servername, 0, tags_data->timestamp); else - EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, word[4], nick, + EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, text, nick, serv->servername, NULL, 0, tags_data->timestamp); diff --git a/src/common/text.c b/src/common/text.c index 4a274f98..b0a90e03 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -1295,6 +1295,13 @@ static char * const pevt_invited_help[] = { N_("Server Name"), }; +static char * const pevt_invitedother_help[] = { + N_("Channel Name"), + N_("Nick of person who sent the invite"), + N_("Nick of person who was invited"), + N_("Server Name"), +}; + static char * const pevt_usersonchan_help[] = { N_("Channel Name"), N_("Users"), diff --git a/src/common/textevents.in b/src/common/textevents.in index 9790c18d..14bd4b06 100644 --- a/src/common/textevents.in +++ b/src/common/textevents.in @@ -496,6 +496,12 @@ pevt_invited_help %C24*%O$tYou have been invited to %C22$1%O by %C18$2%O (%C29$3%O) 3 +Invited Other +XP_TE_INVITEDOTHER +pevt_invitedother_help +%C24*%O$t%C26$3%C has been invited to %C22$1%O by %C18$2%O (%C29$4%O) +4 + Join XP_TE_JOIN pevt_join_help From 29e78d385115b9072fa2c4027e3e03e0e1021607 Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sat, 11 Apr 2020 23:12:59 +0300 Subject: [PATCH 04/20] Change Inno path property --- win32/hexchat.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/hexchat.props b/win32/hexchat.props index 831996e5..f40c794a 100644 --- a/win32/hexchat.props +++ b/win32/hexchat.props @@ -41,7 +41,7 @@ $(HexChatBuild)\$(PlatformName)\lib\ $(HexChatBuild)\$(PlatformName)\pdb\ $(HexChatBuild)\$(PlatformName)\rel\ - "$(MSBuildExtensionsPath32)\..\Inno Setup 5\iscc.exe" + "$(ProgramFiles)\Inno Setup 5\iscc.exe" From 939ec7a16e205e974cfe1a97c2ff4974e763c7fa Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sun, 12 Apr 2020 10:32:31 +0300 Subject: [PATCH 05/20] Updated Toolset to v142 --- plugins/checksum/checksum.vcxproj | 2 +- plugins/exec/exec.vcxproj | 2 +- plugins/fishlim/fishlim.vcxproj | 2 +- plugins/lua/lua.vcxproj | 2 +- plugins/perl/perl.vcxproj | 2 +- plugins/python/python2.vcxproj | 2 +- plugins/python/python3.vcxproj | 2 +- plugins/sysinfo/sysinfo.vcxproj | 2 +- plugins/upd/upd.vcxproj | 2 +- plugins/winamp/winamp.vcxproj | 2 +- src/common/common.vcxproj | 2 +- src/fe-gtk/fe-gtk.vcxproj | 2 +- .../notifications/notifications-winrt.vcxproj | 124 +++++++++--------- src/fe-text/fe-text.vcxproj | 2 +- src/htm/Properties/Resources.Designer.cs | 2 +- src/htm/Properties/Settings.Designer.cs | 2 +- src/htm/app.config | 2 +- src/htm/htm.csproj | 2 +- src/libenchant_win8/libenchant_win8.vcxproj | 2 +- win32/copy/copy.vcxproj | 2 +- win32/installer/installer.vcxproj | 2 +- win32/nls/nls.vcxproj | 2 +- 22 files changed, 83 insertions(+), 83 deletions(-) diff --git a/plugins/checksum/checksum.vcxproj b/plugins/checksum/checksum.vcxproj index 7924be88..fba08cce 100644 --- a/plugins/checksum/checksum.vcxproj +++ b/plugins/checksum/checksum.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/plugins/exec/exec.vcxproj b/plugins/exec/exec.vcxproj index e34f10e6..ceb11843 100644 --- a/plugins/exec/exec.vcxproj +++ b/plugins/exec/exec.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/plugins/fishlim/fishlim.vcxproj b/plugins/fishlim/fishlim.vcxproj index 157c7928..579c2436 100644 --- a/plugins/fishlim/fishlim.vcxproj +++ b/plugins/fishlim/fishlim.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/plugins/lua/lua.vcxproj b/plugins/lua/lua.vcxproj index 22afe729..5c0be68e 100644 --- a/plugins/lua/lua.vcxproj +++ b/plugins/lua/lua.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/plugins/perl/perl.vcxproj b/plugins/perl/perl.vcxproj index 8b5069c0..92c27408 100644 --- a/plugins/perl/perl.vcxproj +++ b/plugins/perl/perl.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/plugins/python/python2.vcxproj b/plugins/python/python2.vcxproj index 0b098112..42895ce4 100644 --- a/plugins/python/python2.vcxproj +++ b/plugins/python/python2.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/plugins/python/python3.vcxproj b/plugins/python/python3.vcxproj index 5868d3b0..3eb86c2a 100644 --- a/plugins/python/python3.vcxproj +++ b/plugins/python/python3.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/plugins/sysinfo/sysinfo.vcxproj b/plugins/sysinfo/sysinfo.vcxproj index b1c7c8f0..a3ff0f8a 100644 --- a/plugins/sysinfo/sysinfo.vcxproj +++ b/plugins/sysinfo/sysinfo.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary Unicode diff --git a/plugins/upd/upd.vcxproj b/plugins/upd/upd.vcxproj index 16f96e45..5dc497b4 100644 --- a/plugins/upd/upd.vcxproj +++ b/plugins/upd/upd.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/plugins/winamp/winamp.vcxproj b/plugins/winamp/winamp.vcxproj index ccc04e72..78367ae9 100644 --- a/plugins/winamp/winamp.vcxproj +++ b/plugins/winamp/winamp.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 DynamicLibrary diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj index 33a883bf..bc191f43 100644 --- a/src/common/common.vcxproj +++ b/src/common/common.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 StaticLibrary diff --git a/src/fe-gtk/fe-gtk.vcxproj b/src/fe-gtk/fe-gtk.vcxproj index 61d0a074..06df36dc 100644 --- a/src/fe-gtk/fe-gtk.vcxproj +++ b/src/fe-gtk/fe-gtk.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 Application diff --git a/src/fe-gtk/notifications/notifications-winrt.vcxproj b/src/fe-gtk/notifications/notifications-winrt.vcxproj index 1f392b6b..d720c864 100644 --- a/src/fe-gtk/notifications/notifications-winrt.vcxproj +++ b/src/fe-gtk/notifications/notifications-winrt.vcxproj @@ -1,62 +1,62 @@ - - - - - Release - Win32 - - - Release - x64 - - - - - true - - - - {C53145CC-D021-40C9-B97C-0249AB9A43C9} - Win32Proj - notifications-winrt - notifications-winrt - - - - v140 - DynamicLibrary - Unicode - - - - - - hcnotifications-winrt - $(HexChatRel)plugins\ - - - - WIN32;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT;NDEBUG;_WINDOWS;_USRDLL;NOTIFICATIONS_EXPORTS;%(PreprocessorDefinitions) - true - $(VCInstallDir)vcpackages;$(FrameworkSdkDir)References\CommonConfiguration\Neutral;%(AdditionalUsingDirectories) - - - $(DepLibs);mincore.lib;runtimeobject.lib;%(AdditionalDependencies) - 6.03 - $(DepsRoot)\lib;%(AdditionalLibraryDirectories) - - - - - WIN32;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT;NDEBUG;_WINDOWS;_USRDLL;NOTIFICATIONS_EXPORTS;%(PreprocessorDefinitions) - true - $(VCInstallDir)vcpackages;$(FrameworkSdkDir)References\CommonConfiguration\Neutral;%(AdditionalUsingDirectories) - - - $(DepLibs);mincore.lib;runtimeobject.lib;%(AdditionalDependencies) - 6.03 - $(DepsRoot)\lib;%(AdditionalLibraryDirectories) - - - - + + + + + Release + Win32 + + + Release + x64 + + + + + true + + + + {C53145CC-D021-40C9-B97C-0249AB9A43C9} + Win32Proj + notifications-winrt + notifications-winrt + + + + v142 + DynamicLibrary + Unicode + + + + + + hcnotifications-winrt + $(HexChatRel)plugins\ + + + + WIN32;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT;NDEBUG;_WINDOWS;_USRDLL;NOTIFICATIONS_EXPORTS;%(PreprocessorDefinitions) + true + $(VCInstallDir)vcpackages;$(FrameworkSdkDir)References\CommonConfiguration\Neutral;%(AdditionalUsingDirectories) + + + $(DepLibs);mincore.lib;runtimeobject.lib;%(AdditionalDependencies) + 6.03 + $(DepsRoot)\lib;%(AdditionalLibraryDirectories) + + + + + WIN32;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT;NDEBUG;_WINDOWS;_USRDLL;NOTIFICATIONS_EXPORTS;%(PreprocessorDefinitions) + true + $(VCInstallDir)vcpackages;$(FrameworkSdkDir)References\CommonConfiguration\Neutral;%(AdditionalUsingDirectories) + + + $(DepLibs);mincore.lib;runtimeobject.lib;%(AdditionalDependencies) + 6.03 + $(DepsRoot)\lib;%(AdditionalLibraryDirectories) + + + + diff --git a/src/fe-text/fe-text.vcxproj b/src/fe-text/fe-text.vcxproj index 6c7c25a8..75b64a12 100644 --- a/src/fe-text/fe-text.vcxproj +++ b/src/fe-text/fe-text.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 Application diff --git a/src/htm/Properties/Resources.Designer.cs b/src/htm/Properties/Resources.Designer.cs index 7627ee06..8e2cd74a 100644 --- a/src/htm/Properties/Resources.Designer.cs +++ b/src/htm/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace thememan.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/htm/Properties/Settings.Designer.cs b/src/htm/Properties/Settings.Designer.cs index cf679280..c8c467e8 100644 --- a/src/htm/Properties/Settings.Designer.cs +++ b/src/htm/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace thememan.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/htm/app.config b/src/htm/app.config index ad1957f6..b33a2051 100644 --- a/src/htm/app.config +++ b/src/htm/app.config @@ -1,3 +1,3 @@ - + diff --git a/src/htm/htm.csproj b/src/htm/htm.csproj index eaf57a0f..7c96d274 100644 --- a/src/htm/htm.csproj +++ b/src/htm/htm.csproj @@ -12,7 +12,7 @@ thememan 512 false - v4.5.2 + v4.6.1 publish\ diff --git a/src/libenchant_win8/libenchant_win8.vcxproj b/src/libenchant_win8/libenchant_win8.vcxproj index 3496f978..a6cbdad6 100644 --- a/src/libenchant_win8/libenchant_win8.vcxproj +++ b/src/libenchant_win8/libenchant_win8.vcxproj @@ -19,7 +19,7 @@ DynamicLibrary true - v140 + v142 diff --git a/win32/copy/copy.vcxproj b/win32/copy/copy.vcxproj index 72f2c032..b26d7e28 100644 --- a/win32/copy/copy.vcxproj +++ b/win32/copy/copy.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 Application diff --git a/win32/installer/installer.vcxproj b/win32/installer/installer.vcxproj index 3458b658..3cc11e44 100644 --- a/win32/installer/installer.vcxproj +++ b/win32/installer/installer.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 Application diff --git a/win32/nls/nls.vcxproj b/win32/nls/nls.vcxproj index aa60abff..759ae14d 100644 --- a/win32/nls/nls.vcxproj +++ b/win32/nls/nls.vcxproj @@ -1,7 +1,7 @@  - v140 + v142 Application From e2ec2c9ab71a0678591f78c8657eb8eb1fe1ae10 Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sun, 12 Apr 2020 15:13:03 +0300 Subject: [PATCH 06/20] Fixed notifications-winrt compilation error Both platform.winmd and windows.winmd were unable to find so added the location of each to the compiler. --- src/fe-gtk/notifications/notifications-winrt.vcxproj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fe-gtk/notifications/notifications-winrt.vcxproj b/src/fe-gtk/notifications/notifications-winrt.vcxproj index d720c864..2f6ffc99 100644 --- a/src/fe-gtk/notifications/notifications-winrt.vcxproj +++ b/src/fe-gtk/notifications/notifications-winrt.vcxproj @@ -1,4 +1,4 @@ - + @@ -38,7 +38,8 @@ WIN32;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT;NDEBUG;_WINDOWS;_USRDLL;NOTIFICATIONS_EXPORTS;%(PreprocessorDefinitions) true - $(VCInstallDir)vcpackages;$(FrameworkSdkDir)References\CommonConfiguration\Neutral;%(AdditionalUsingDirectories) + $(VC_LibraryPath_VC_x86_Store)\references;$(WindowsSDK_UnionMetadataPath);$(VCInstallDir)vcpackages;$(FrameworkSdkDir)References\CommonConfiguration\Neutral;%(AdditionalUsingDirectories) + true $(DepLibs);mincore.lib;runtimeobject.lib;%(AdditionalDependencies) @@ -50,7 +51,8 @@ WIN32;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT;NDEBUG;_WINDOWS;_USRDLL;NOTIFICATIONS_EXPORTS;%(PreprocessorDefinitions) true - $(VCInstallDir)vcpackages;$(FrameworkSdkDir)References\CommonConfiguration\Neutral;%(AdditionalUsingDirectories) + $(VC_LibraryPath_VC_x86_Store)\references;$(WindowsSDK_UnionMetadataPath);$(VCInstallDir)vcpackages;$(FrameworkSdkDir)References\CommonConfiguration\Neutral;%(AdditionalUsingDirectories) + true $(DepLibs);mincore.lib;runtimeobject.lib;%(AdditionalDependencies) From 04acbdc221a75f94d38ec4f80a3f826117443466 Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Mon, 13 Apr 2020 17:14:42 +0300 Subject: [PATCH 07/20] Update github workflows --- .github/workflows/ubuntu-build.yml | 2 +- .github/workflows/windows-build.yml | 74 +++++++++++++++++++++++++++++ win32/installer/hexchat.iss.tt | 4 +- 3 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/windows-build.yml diff --git a/.github/workflows/ubuntu-build.yml b/.github/workflows/ubuntu-build.yml index c3bafadc..f2d3ac8e 100644 --- a/.github/workflows/ubuntu-build.yml +++ b/.github/workflows/ubuntu-build.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: fetch-depth: 1 diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml new file mode 100644 index 00000000..82b5bcec --- /dev/null +++ b/.github/workflows/windows-build.yml @@ -0,0 +1,74 @@ +name: Windows Build +on: [push, pull_request] + +jobs: + build: + runs-on: windows-2019 + strategy: + matrix: + platform: [x64, win32] + arch: [x64, x86] + exclude: + - platform: x64 + arch: x86 + - platform: win32 + arch: x64 + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Install Dependencies + run: | + New-Item -Name "deps" -ItemType "Directory" + + Invoke-WebRequest http://files.jrsoftware.org/is/5/innosetup-5.5.9-unicode.exe -OutFile deps\innosetup-unicode.exe + & deps\innosetup-unicode.exe /VERYSILENT | Out-Null + + Invoke-WebRequest https://bitbucket.org/mitrich_k/inno-download-plugin/downloads/idpsetup-1.5.1.exe -OutFile deps\idpsetup.exe + & deps\idpsetup.exe /VERYSILENT + + Invoke-WebRequest https://dl.hexchat.net/gtk/gtk-${{ matrix.platform }}-2018-08-29.7z -OutFile deps\gtk-${{ matrix.arch }}.7z + & 7z.exe x deps\gtk-${{ matrix.arch }}.7z -oC:\gtk-build\gtk + + Invoke-WebRequest https://dl.hexchat.net/gtk-win32/gendef-20111031.7z -OutFile deps\gendef.7z + & 7z.exe x deps\gendef.7z -oC:\gtk-build + + Invoke-WebRequest https://dl.hexchat.net/gtk-win32/WinSparkle-20151011.7z -OutFile deps\WinSparkle.7z + & 7z.exe x deps\WinSparkle.7z -oC:\gtk-build\WinSparkle + + Invoke-WebRequest https://dl.hexchat.net/misc/perl/perl-5.20.0-${{ matrix.arch }}.7z -OutFile deps\perl-${{ matrix.arch }}.7z + & 7z.exe x deps\perl-${{ matrix.arch }}.7z -oC:\gtk-build\perl-5.20\${{ matrix.platform }} + + New-Item -Path "c:\gtk-build" -Name "python-2.7" -ItemType "Directory" + New-Item -Path "c:\gtk-build" -Name "python-3.6" -ItemType "Directory" + New-Item -Path "c:\gtk-build\python-2.7" -Name "${{ matrix.platform }}" -ItemType "SymbolicLink" -Value "C:/hostedtoolcache/windows/Python/2.7.17/${{ matrix.arch }}" + New-Item -Path "c:\gtk-build\python-3.6" -Name "${{ matrix.platform }}" -ItemType "SymbolicLink" -Value "C:/hostedtoolcache/windows/Python/3.6.8/${{ matrix.arch }}" + + C:/hostedtoolcache/windows/Python/3.6.8/${{ matrix.arch }}/python.exe -m pip install cffi + C:/hostedtoolcache/windows/Python/2.7.17/${{ matrix.arch }}/python.exe -m pip install -qq cffi + shell: powershell + + - name: Build + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" + msbuild win32\hexchat.sln /m /verbosity:minimal /p:Configuration=Release /p:Platform=${{ matrix.platform }} + shell: cmd + + - name: Preparing Artifacts + run: | + move ..\hexchat-build\${{ matrix.platform }}\HexChat*.exe .\ + move ..\hexchat-build .\ + shell: cmd + + - uses: actions/upload-artifact@v2-preview + with: + name: Installer + path: HexChat*.exe + + - uses: actions/upload-artifact@v2-preview + with: + name: Build + path: hexchat-build diff --git a/win32/installer/hexchat.iss.tt b/win32/installer/hexchat.iss.tt index 3ac5ec41..be985384 100644 --- a/win32/installer/hexchat.iss.tt +++ b/win32/installer/hexchat.iss.tt @@ -31,9 +31,9 @@ Compression=lzma2/ultra64 SourceDir=..\rel OutputDir=.. #if APPARCH == "x64" -OutputBaseFilename={#APPNAM} {#APPVER} x64 +OutputBaseFilename={#APPNAM}-{#APPVER}_x64 #else -OutputBaseFilename={#APPNAM} {#APPVER} x86 +OutputBaseFilename={#APPNAM}-{#APPVER}_x86 #endif FlatComponentsList=no PrivilegesRequired=none From 65930492ca6fff4beb25d8ee4f4b1e99058e8846 Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sat, 30 Jan 2021 23:49:17 +0200 Subject: [PATCH 08/20] ci: fixed Inno Download Plugin download path --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 82b5bcec..21bb8b37 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -27,7 +27,7 @@ jobs: Invoke-WebRequest http://files.jrsoftware.org/is/5/innosetup-5.5.9-unicode.exe -OutFile deps\innosetup-unicode.exe & deps\innosetup-unicode.exe /VERYSILENT | Out-Null - Invoke-WebRequest https://bitbucket.org/mitrich_k/inno-download-plugin/downloads/idpsetup-1.5.1.exe -OutFile deps\idpsetup.exe + Invoke-WebRequest https://dl.hexchat.net/misc/idpsetup-1.5.1.exe -OutFile deps\idpsetup.exe & deps\idpsetup.exe /VERYSILENT Invoke-WebRequest https://dl.hexchat.net/gtk/gtk-${{ matrix.platform }}-2018-08-29.7z -OutFile deps\gtk-${{ matrix.arch }}.7z From 5310f451f2ad6fa49255fc507246a35aeb4ebef8 Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sat, 30 Jan 2021 23:58:44 +0200 Subject: [PATCH 09/20] ci: fixed python paths --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 21bb8b37..f8a965f9 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -44,11 +44,11 @@ jobs: New-Item -Path "c:\gtk-build" -Name "python-2.7" -ItemType "Directory" New-Item -Path "c:\gtk-build" -Name "python-3.6" -ItemType "Directory" - New-Item -Path "c:\gtk-build\python-2.7" -Name "${{ matrix.platform }}" -ItemType "SymbolicLink" -Value "C:/hostedtoolcache/windows/Python/2.7.17/${{ matrix.arch }}" + New-Item -Path "c:\gtk-build\python-2.7" -Name "${{ matrix.platform }}" -ItemType "SymbolicLink" -Value "C:/hostedtoolcache/windows/Python/2.7.18/${{ matrix.arch }}" New-Item -Path "c:\gtk-build\python-3.6" -Name "${{ matrix.platform }}" -ItemType "SymbolicLink" -Value "C:/hostedtoolcache/windows/Python/3.6.8/${{ matrix.arch }}" C:/hostedtoolcache/windows/Python/3.6.8/${{ matrix.arch }}/python.exe -m pip install cffi - C:/hostedtoolcache/windows/Python/2.7.17/${{ matrix.arch }}/python.exe -m pip install -qq cffi + C:/hostedtoolcache/windows/Python/2.7.18/${{ matrix.arch }}/python.exe -m pip install -qq cffi shell: powershell - name: Build From c64dda4deae6edd676dfe4145adeb4fdf11be53a Mon Sep 17 00:00:00 2001 From: Miguel Date: Mon, 24 May 2021 02:42:07 +0100 Subject: [PATCH 10/20] Update ptnet servers (#2205) Co-authored-by: Elias --- src/common/servlist.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/servlist.c b/src/common/servlist.c index e0191a7b..d15965af 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -277,9 +277,12 @@ static const struct defaultserver def[] = {0, "irc.ponychat.net"}, {"PTNet.org", 0}, - /* Note that the network suggests ISO-8859-1 but most users ignore this */ + {0, "irc.ptnet.org"}, {0, "uevora.ptnet.org"}, - {0, "vianetworks.ptnet.org"}, + {0, "claranet.ptnet.org"}, + {0, "sonaquela.ptnet.org"}, + {0, "uc.ptnet.org"}, + {0, "ipg.ptnet.org"}, {"QuakeNet", 0, 0, 0, LOGIN_CHALLENGEAUTH}, {0, "irc.quakenet.org"}, From 6199635e7fbd220860e9b650b6d3fe63f60d4f80 Mon Sep 17 00:00:00 2001 From: Lorenzo Ancora <34890309+LorenzoAncora@users.noreply.github.com> Date: Mon, 24 May 2021 03:47:33 +0200 Subject: [PATCH 11/20] Add the official EU server to hackint network (#2495) --- src/common/servlist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/servlist.c b/src/common/servlist.c index d15965af..90197a5e 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -198,6 +198,7 @@ static const struct defaultserver def[] = #ifdef USE_OPENSSL {"hackint", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {0, "irc.hackint.org"}, + {0, "irc.eu.hackint.org"}, #endif {"Hashmark", 0}, From 37118a4d2b70c11a76c732346975c2745d3cc4c6 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 24 May 2021 02:53:28 +0100 Subject: [PATCH 12/20] Implement support for the IRCv3 account-tag specification. (#2572) Co-authored-by: Patrick --- src/common/hexchat.h | 1 + src/common/inbound.c | 3 +++ src/common/proto-irc.c | 19 +++++++++++++++++++ src/common/proto-irc.h | 4 ++++ src/common/server.c | 1 + src/common/userlist.c | 12 +++++++----- 6 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/common/hexchat.h b/src/common/hexchat.h index f7cacfcc..f9ca006b 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -569,6 +569,7 @@ typedef struct server unsigned int have_idmsg:1; /* freenode's IDENTIFY-MSG */ unsigned int have_accnotify:1; /* cap account-notify */ unsigned int have_extjoin:1; /* cap extended-join */ + unsigned int have_account_tag:1; /* cap account-tag */ unsigned int have_server_time:1; /* cap server-time */ unsigned int have_sasl:1; /* SASL capability */ unsigned int have_except:1; /* ban exemptions +e */ diff --git a/src/common/inbound.c b/src/common/inbound.c index 3a26dce9..7175b2ae 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1671,6 +1671,8 @@ inbound_toggle_caps (server *serv, const char *extensions_str, gboolean enable) serv->have_server_time = enable; else if (!strcmp (extension, "away-notify")) serv->have_awaynotify = enable; + else if (!strcmp (extension, "account-tag")) + serv->have_account_tag = enable; else if (!strcmp (extension, "sasl")) { serv->have_sasl = enable; @@ -1726,6 +1728,7 @@ static const char * const supported_caps[] = { "chghost", "setname", "invite-notify", + "account-tag", /* ZNC */ "znc.in/server-time-iso", diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index 57eda88a..cfe76361 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -1010,6 +1010,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], const message_tags_data *tags_data) { server *serv = sess->server; + char *account; char ip[128], nick[NICKLEN]; char *text, *ex; int len = strlen (type); @@ -1028,6 +1029,14 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], ex[0] = '!'; } + + /** Update the account for this message's source. */ + if (serv->have_account_tag) + { + account = tags_data->account && *tags_data->account ? tags_data->account : "*"; + inbound_account (serv, nick, account, tags_data); + } + if (len == 4) { guint32 t; @@ -1522,6 +1531,9 @@ handle_message_tags (server *serv, const char *tags_str, *value = '\0'; value++; + if (serv->have_account_tag && !strcmp (key, "account")) + tags_data->account = g_strdup (value); + if (serv->have_server_time && !strcmp (key, "time")) handle_message_tag_time (value, tags_data); } @@ -1619,9 +1631,16 @@ irc_inline (server *serv, char *buf, int len) } xit: + message_tags_data_free (&tags_data); g_free (pdibuf); } +void +message_tags_data_free (message_tags_data *tags_data) +{ + g_clear_pointer (&tags_data->account, g_free); +} + void proto_fill_her_up (server *serv) { diff --git a/src/common/proto-irc.h b/src/common/proto-irc.h index 6c075795..0f72c644 100644 --- a/src/common/proto-irc.h +++ b/src/common/proto-irc.h @@ -25,6 +25,7 @@ #define MESSAGE_TAGS_DATA_INIT \ { \ + NULL, /* account name */ \ (time_t)0, /* timestamp */ \ } @@ -36,9 +37,12 @@ */ typedef struct { + char *account; time_t timestamp; } message_tags_data; +void message_tags_data_free (message_tags_data *tags_data); + void proto_fill_her_up (server *serv); #endif diff --git a/src/common/server.c b/src/common/server.c index c6fa1ced..5c645eb5 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -1784,6 +1784,7 @@ server_set_defaults (server *serv) serv->have_idmsg = FALSE; serv->have_accnotify = FALSE; serv->have_extjoin = FALSE; + serv->have_account_tag = FALSE; serv->have_server_time = FALSE; serv->have_sasl = FALSE; serv->have_except = FALSE; diff --git a/src/common/userlist.c b/src/common/userlist.c index 17719ff6..5f2d67f2 100644 --- a/src/common/userlist.c +++ b/src/common/userlist.c @@ -101,13 +101,15 @@ userlist_set_account (struct session *sess, char *nick, char *account) user = userlist_find (sess, nick); if (user) { - g_free (user->account); - if (strcmp (account, "*") == 0) - user->account = NULL; - else + { + g_clear_pointer (&user->account, g_free); + } else if (g_strcmp0 (user->account, account)) + { + g_free (user->account); user->account = g_strdup (account); - + } + /* gui doesnt currently reflect login status, maybe later fe_userlist_rehash (sess, user); */ } From ad20708766c2ab11fe6eb23042883d3802d02145 Mon Sep 17 00:00:00 2001 From: Filippo Cortigiani Date: Mon, 24 May 2021 04:12:20 +0200 Subject: [PATCH 13/20] Added SimosNap to server list (#2349) --- src/common/servlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/servlist.c b/src/common/servlist.c index 90197a5e..de75c8b9 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -307,6 +307,9 @@ static const struct defaultserver def[] = {"Serenity-IRC", 0}, {0, "irc.serenity-irc.net"}, + {"SimosNap", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "irc.simosnap.com"}, + {"SlashNET", 0}, /* Self signed */ {0, "irc.slashnet.org"}, From d3545f37cd5f551ed8bc0ab7b20e5c8140adc0a6 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sun, 23 May 2021 21:15:43 -0500 Subject: [PATCH 14/20] Change default network to Libera.Chat --- src/common/servlist.c | 4 ++-- src/fe-gtk/joind.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/servlist.c b/src/common/servlist.c index de75c8b9..93557f97 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -240,7 +240,7 @@ static const struct defaultserver def[] = /* Self signed */ {0, "irc.librairc.net"}, - {"Libera Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {"Libera.Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {0, "irc.libera.chat"}, #ifdef USE_OPENSSL @@ -942,7 +942,7 @@ servlist_load_defaults (void) { int i = 0, j = 0; ircnet *net = NULL; - guint def_hash = g_str_hash ("freenode"); + guint def_hash = g_str_hash ("Libera.Chat"); while (1) { diff --git a/src/fe-gtk/joind.c b/src/fe-gtk/joind.c index f1d3da50..ce3cbcae 100644 --- a/src/fe-gtk/joind.c +++ b/src/fe-gtk/joind.c @@ -247,7 +247,7 @@ joind_show_dialog (server *serv) G_CALLBACK (joind_ok_cb), serv); if (serv->network) - if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "freenode") == 0) + if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "Libera.Chat") == 0) { gtk_entry_set_text (GTK_ENTRY (entry1), "#hexchat"); } From 0a85d79dff820e97c5db1ad365f0360738875bdc Mon Sep 17 00:00:00 2001 From: cranberry Date: Mon, 24 May 2021 04:16:39 +0200 Subject: [PATCH 15/20] Adding LibertaCasa + TripSit to servlist.c (#2538) --- src/common/servlist.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/common/servlist.c b/src/common/servlist.c index 93557f97..f92f2f4e 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -236,6 +236,11 @@ static const struct defaultserver def[] = {"Krstarica", 0}, {0, "irc.krstarica.com"}, +#ifdef USE_OPENSSL + {"LibertaCasa", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "irc.liberta.casa"}, +#endif + {"LibraIRC", 0}, /* Self signed */ {0, "irc.librairc.net"}, @@ -355,6 +360,14 @@ static const struct defaultserver def[] = {"tilde.chat", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {0, "irc.tilde.chat"}, +#ifdef USE_OPENSSL + {"TripSit", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "irc.tripsit.me"}, + {0, "newirc.tripsit.me"}, + {0, "coconut.tripsit.me"}, + {0, "innsbruck.tripsit.me"}, +#endif + {"TURLINet", 0, 0, 0, 0, 0, TRUE}, /* Other servers use CP1251 and invalid certs */ {0, "irc.servx.ru"}, From e03fab07ed77db699abbde01e2b872019df07b80 Mon Sep 17 00:00:00 2001 From: BakasuraRCE Date: Wed, 29 Jul 2020 09:47:05 -0500 Subject: [PATCH 16/20] plugin interface: Refactor "flags" option in "channels" list to be more clear with bit operators --- src/common/plugin.c | 104 ++++++++++++++++++++++++++------------------ 1 file changed, 61 insertions(+), 43 deletions(-) diff --git a/src/common/plugin.c b/src/common/plugin.c index 5c09e921..00cf4599 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -115,6 +115,32 @@ enum HOOK_DELETED = 1 << 7 /* marked for deletion */ }; +enum +{ + CHANNEL_FLAG_CONNECTED = 1 << 0, + CHANNEL_FLAG_CONNECING = 1 << 1, + CHANNEL_FLAG_AWAY = 1 << 2, + CHANNEL_FLAG_END_OF_MOTD = 1 << 3, + CHANNEL_FLAG_HAS_WHOX = 1 << 4, + CHANNEL_FLAG_HAS_IDMSG = 1 << 5, + CHANNEL_FLAG_HIDE_JOIN_PARTS = 1 << 6, + CHANNEL_FLAG_HIDE_JOIN_PARTS_UNSET = 1 << 7, + CHANNEL_FLAG_BEEP = 1 << 8, + CHANNEL_FLAG_BEEP_UNSET = 1 << 9, + CHANNEL_FLAG_UNUSED = 1 << 10, + CHANNEL_FLAG_LOGGING = 1 << 11, + CHANNEL_FLAG_LOGGING_UNSET = 1 << 12, + CHANNEL_FLAG_SCROLLBACK = 1 << 13, + CHANNEL_FLAG_SCROLLBACK_UNSET = 1 << 14, + CHANNEL_FLAG_STRIP_COLORS = 1 << 15, + CHANNEL_FLAG_STRIP_COLORS_UNSET = 1 << 16, + CHANNEL_FLAG_TRAY = 1 << 17, + CHANNEL_FLAG_TRAY_UNSET = 1 << 18, + CHANNEL_FLAG_TASKBAR = 1 << 19, + CHANNEL_FLAG_TASKBAR_UNSET = 1 << 20, + CHANNEL_FLAG_COUNT = 21 +}; + GSList *plugin_list = NULL; /* export for plugingui.c */ static GSList *hook_list = NULL; @@ -1521,7 +1547,11 @@ hexchat_list_int (hexchat_plugin *ph, hexchat_list *xlist, const char *name) { guint32 hash = str_hash (name); gpointer data = ph->context; - int tmp = 0; + + int channel_flag; + int channel_flags[CHANNEL_FLAG_COUNT]; + int channel_flags_used = 0; + int type = LIST_CHANNELS; /* a NULL xlist is a shortcut to current "channels" context */ @@ -1582,48 +1612,36 @@ hexchat_list_int (hexchat_plugin *ph, hexchat_list *xlist, const char *name) case 0xd1b: /* id */ return ((struct session *)data)->server->id; case 0x5cfee87: /* flags */ - /* used if alert_taskbar is unset */ /* 20 */ - tmp <<= 1; - tmp |= ((struct session *)data)->alert_taskbar; /* 19 */ - tmp <<= 1; - /* used if alert_tray is unset */ /* 18 */ - tmp <<= 1; - tmp |= ((struct session *)data)->alert_tray; /* 17 */ - tmp <<= 1; - /* used if text_strip is unset */ /* 16 */ - tmp <<= 1; - tmp |= ((struct session *)data)->text_strip; /* 15 */ - tmp <<= 1; - /* used if text_scrollback is unset */ /* 14 */ - tmp <<= 1; - tmp |= ((struct session *)data)->text_scrollback; /* 13 */ - tmp <<= 1; - /* used if text_logging is unset */ /* 12 */ - tmp <<= 1; - tmp |= ((struct session *)data)->text_logging; /* 11 */ - tmp <<= 1; - /* unused for historical reasons */ /* 10 */ - tmp <<= 1; - /* used if alert_beep is unset */ /* 9 */ - tmp <<= 1; - tmp |= ((struct session *)data)->alert_beep; /* 8 */ - tmp <<= 1; - /* used if text_hidejoinpart is unset */ /* 7 */ - tmp <<= 1; - tmp |= ((struct session *)data)->text_hidejoinpart; /* 6 */ - tmp <<= 1; - tmp |= ((struct session *)data)->server->have_idmsg; /* 5 */ - tmp <<= 1; - tmp |= ((struct session *)data)->server->have_whox; /* 4 */ - tmp <<= 1; - tmp |= ((struct session *)data)->server->end_of_motd;/* 3 */ - tmp <<= 1; - tmp |= ((struct session *)data)->server->is_away; /* 2 */ - tmp <<= 1; - tmp |= ((struct session *)data)->server->connecting; /* 1 */ - tmp <<= 1; - tmp |= ((struct session *)data)->server->connected; /* 0 */ - return tmp; + channel_flags[0] = ((struct session *)data)->server->connected; + channel_flags[1] = ((struct session *)data)->server->connecting; + channel_flags[2] = ((struct session *)data)->server->is_away; + channel_flags[3] = ((struct session *)data)->server->end_of_motd; + channel_flags[4] = ((struct session *)data)->server->have_whox; + channel_flags[5] = ((struct session *)data)->server->have_idmsg; + channel_flags[6] = ((struct session *)data)->text_hidejoinpart; + channel_flags[7] = ((struct session *)data)->text_hidejoinpart == SET_DEFAULT; + channel_flags[8] = ((struct session *)data)->alert_beep; + channel_flags[9] = ((struct session *)data)->alert_beep == SET_DEFAULT; + channel_flags[10] = 0; /* unused for historical reasons */ + channel_flags[11] = ((struct session *)data)->text_logging; + channel_flags[12] = ((struct session *)data)->text_logging == SET_DEFAULT; + channel_flags[13] = ((struct session *)data)->text_scrollback; + channel_flags[14] = ((struct session *)data)->text_scrollback == SET_DEFAULT; + channel_flags[15] = ((struct session *)data)->text_strip; + channel_flags[16] = ((struct session *)data)->text_strip == SET_DEFAULT; + channel_flags[17] = ((struct session *)data)->alert_tray; + channel_flags[18] = ((struct session *)data)->alert_tray == SET_DEFAULT; + channel_flags[19] = ((struct session *)data)->alert_taskbar; + channel_flags[20] = ((struct session *)data)->alert_taskbar == SET_DEFAULT; + + /* Set flags */ + for (channel_flag = 0; channel_flag < CHANNEL_FLAG_COUNT; ++channel_flag) { + if (channel_flags[channel_flag]) { + channel_flags_used |= 1 << channel_flag; + } + } + + return channel_flags_used; case 0x1a192: /* lag */ return ((struct session *)data)->server->lag; case 0x1916144c: /* maxmodes */ From da26097aab554c44540c25f0741dc19f6e92cc41 Mon Sep 17 00:00:00 2001 From: BakasuraRCE Date: Wed, 29 Jul 2020 09:50:12 -0500 Subject: [PATCH 17/20] notification: Implement notification option for channels --- src/common/chanopt.c | 2 ++ src/common/hexchat.c | 1 + src/common/hexchat.h | 1 + src/common/plugin.c | 6 ++++- src/fe-gtk/maingui.c | 26 +++++++++++++++++---- src/fe-gtk/plugin-notification.c | 40 ++++++++++++++++++++++++++++---- 6 files changed, 67 insertions(+), 9 deletions(-) diff --git a/src/common/chanopt.c b/src/common/chanopt.c index 1870c99c..67cb46cf 100644 --- a/src/common/chanopt.c +++ b/src/common/chanopt.c @@ -58,6 +58,7 @@ typedef struct static const channel_options chanopt[] = { + {"alert_balloon", NULL, S_F(alert_balloon)}, {"alert_beep", "BEEP", S_F(alert_beep)}, {"alert_taskbar", NULL, S_F(alert_taskbar)}, {"alert_tray", "TRAY", S_F(alert_tray)}, @@ -182,6 +183,7 @@ typedef struct { /* Per-Channel Alerts */ /* use a byte, because we need a pointer to each element */ + guint8 alert_balloon; guint8 alert_beep; guint8 alert_taskbar; guint8 alert_tray; diff --git a/src/common/hexchat.c b/src/common/hexchat.c index e9a9a7fc..8702c63d 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c @@ -493,6 +493,7 @@ session_new (server *serv, char *from, int type, int focus) sess->logfd = -1; sess->type = type; + sess->alert_balloon = SET_DEFAULT; sess->alert_beep = SET_DEFAULT; sess->alert_taskbar = SET_DEFAULT; sess->alert_tray = SET_DEFAULT; diff --git a/src/common/hexchat.h b/src/common/hexchat.h index f9ca006b..d8effa1f 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -363,6 +363,7 @@ typedef struct session { /* Per-Channel Alerts */ /* use a byte, because we need a pointer to each element */ + guint8 alert_balloon; guint8 alert_beep; guint8 alert_taskbar; guint8 alert_tray; diff --git a/src/common/plugin.c b/src/common/plugin.c index 00cf4599..f2c2ecfb 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -138,7 +138,9 @@ enum CHANNEL_FLAG_TRAY_UNSET = 1 << 18, CHANNEL_FLAG_TASKBAR = 1 << 19, CHANNEL_FLAG_TASKBAR_UNSET = 1 << 20, - CHANNEL_FLAG_COUNT = 21 + CHANNEL_FLAG_BALLOON = 1 << 21, + CHANNEL_FLAG_BALLOON_UNSET = 1 << 22, + CHANNEL_FLAG_COUNT = 23 }; GSList *plugin_list = NULL; /* export for plugingui.c */ @@ -1633,6 +1635,8 @@ hexchat_list_int (hexchat_plugin *ph, hexchat_list *xlist, const char *name) channel_flags[18] = ((struct session *)data)->alert_tray == SET_DEFAULT; channel_flags[19] = ((struct session *)data)->alert_taskbar; channel_flags[20] = ((struct session *)data)->alert_taskbar == SET_DEFAULT; + channel_flags[21] = ((struct session *)data)->alert_balloon; + channel_flags[22] = ((struct session *)data)->alert_balloon == SET_DEFAULT; /* Set flags */ for (channel_flag = 0; channel_flag < CHANNEL_FLAG_COUNT; ++channel_flag) { diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 335522a0..4e5baaa0 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -1520,14 +1520,32 @@ static void mg_create_alertmenu (session *sess, GtkWidget *menu) { GtkWidget *submenu; + int hex_balloon, hex_beep, hex_tray, hex_flash; - submenu = menu_quick_sub (_("_Extra Alerts"), menu, NULL, XCMENU_MNEMONIC, -1); - mg_perchan_menu_item (_("Beep on _Message"), submenu, &sess->alert_beep, prefs.hex_input_beep_chans); + switch (sess->type) { + case SESS_DIALOG: + hex_balloon = prefs.hex_input_balloon_priv; + hex_beep = prefs.hex_input_beep_priv; + hex_tray = prefs.hex_input_tray_priv; + hex_flash = prefs.hex_input_flash_priv; + break; + default: + hex_balloon = prefs.hex_input_balloon_chans; + hex_beep = prefs.hex_input_beep_chans; + hex_tray = prefs.hex_input_tray_chans; + hex_flash = prefs.hex_input_flash_chans; + } - mg_perchan_menu_item (_("Blink Tray _Icon"), submenu, &sess->alert_tray, prefs.hex_input_tray_chans); + submenu = menu_quick_sub(_("_Extra Alerts"), menu, NULL, XCMENU_MNEMONIC, -1); - mg_perchan_menu_item (_("Blink Task _Bar"), submenu, &sess->alert_taskbar, prefs.hex_input_flash_chans); + mg_perchan_menu_item(_("Show Notifications"), submenu, &sess->alert_balloon, hex_balloon); + + mg_perchan_menu_item(_("Beep on _Message"), submenu, &sess->alert_beep, hex_beep); + + mg_perchan_menu_item(_("Blink Tray _Icon"), submenu, &sess->alert_tray, hex_tray); + + mg_perchan_menu_item(_("Blink Task _Bar"), submenu, &sess->alert_taskbar, hex_flash); } static void diff --git a/src/fe-gtk/plugin-notification.c b/src/fe-gtk/plugin-notification.c index 3ac89244..29478d7a 100644 --- a/src/fe-gtk/plugin-notification.c +++ b/src/fe-gtk/plugin-notification.c @@ -25,6 +25,9 @@ static hexchat_plugin *ph; +const int CHANNEL_FLAG_BALLOON = 1 << 21; +const int CHANNEL_FLAG_BALLOON_UNSET = 1 << 22; + static gboolean should_alert (void) { @@ -117,10 +120,24 @@ static int incoming_message_cb (char *word[], gpointer userdata) { int message; + int flags; + int alert = 0; - if (hexchat_get_prefs (ph, "input_balloon_chans", NULL, &message) == 3 && message && should_alert ()) - { - show_notificationf (word[2], _("Channel message from: %s (%s)"), word[1], hexchat_get_info (ph, "channel")); + flags = hexchat_list_int(ph, NULL, "flags"); + + /* Let sure that can alert */ + if (should_alert()) { + /* Follow the channel rules if set */ + if (!(flags & CHANNEL_FLAG_BALLOON_UNSET)) { + alert = (flags & CHANNEL_FLAG_BALLOON); + } else { + /* Else follow global environment */ + alert = (hexchat_get_prefs(ph, "input_balloon_chans", NULL, &message) == 3 && message); + } + } + + if (alert) { + show_notificationf(word[2], _("Channel message from: %s (%s)"), word[1], hexchat_get_info(ph, "channel")); } return HEXCHAT_EAT_NONE; } @@ -129,8 +146,23 @@ static int incoming_priv_cb (char *word[], gpointer userdata) { int priv; + int flags; + int alert = 0; - if (hexchat_get_prefs (ph, "input_balloon_priv", NULL, &priv) == 3 && priv && should_alert ()) + flags = hexchat_list_int(ph, NULL, "flags"); + + /* Let sure that can alert */ + if (should_alert()) { + /* Follow the private rules if set */ + if (!(flags & CHANNEL_FLAG_BALLOON_UNSET)) { + alert = (flags & CHANNEL_FLAG_BALLOON); + } else { + /* Else follow global environment */ + alert = (hexchat_get_prefs(ph, "input_balloon_priv", NULL, &priv) == 3 && priv); + } + } + + if (alert) { const char *network = hexchat_get_info (ph, "network"); if (!network) From 7121bb6e823dd6b5507fa892a501fda33104cb68 Mon Sep 17 00:00:00 2001 From: BakasuraRCE Date: Wed, 29 Jul 2020 09:52:50 -0500 Subject: [PATCH 18/20] plugin interface: :lipstick: --- src/common/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/plugin.c b/src/common/plugin.c index f2c2ecfb..40e55bbf 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -1550,7 +1550,7 @@ hexchat_list_int (hexchat_plugin *ph, hexchat_list *xlist, const char *name) guint32 hash = str_hash (name); gpointer data = ph->context; - int channel_flag; + int channel_flag; int channel_flags[CHANNEL_FLAG_COUNT]; int channel_flags_used = 0; From 076b2c1c7332e82028811d92a7f7f4b091be0163 Mon Sep 17 00:00:00 2001 From: Andrew Rodland Date: Sun, 23 May 2021 22:19:28 -0400 Subject: [PATCH 19/20] Merge pull request #1457 from arodland/forgiving-ctcp Be forgiving of a missing ending CTCP delimiter in a truncated message --- src/common/proto-irc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index cfe76361..c8e44b62 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -1259,10 +1259,13 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], text++; } len = strlen (text); - if (text[0] == 1 && text[len - 1] == 1) /* ctcp */ + if (text[0] == 1) /* ctcp */ { char *new_pdibuf = NULL; - text[len - 1] = 0; + if (text[len - 1] == 1) + { + text[len - 1] = 0; + } text++; if (g_ascii_strncasecmp (text, "ACTION", 6) != 0) flood_check (nick, ip, serv, sess, 0); From cdfc3b9ea93ac0f5eb3a2b16c80854931db3d881 Mon Sep 17 00:00:00 2001 From: Xandrah Date: Mon, 24 May 2021 04:46:00 +0100 Subject: [PATCH 20/20] Update servlist.c (#2522) * Update servlist.c Added DeltaPool to IRC Networks * Update servlist.c Updated to support SASL --- src/common/servlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/servlist.c b/src/common/servlist.c index f92f2f4e..d65582cd 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -385,6 +385,9 @@ static const struct defaultserver def[] = {"Xertion", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {0, "irc.xertion.org"}, + + {"DeltaPool", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "irc.deltapool.net"}, {0,0} };