Compare commits

..

1 Commits

Author SHA1 Message Date
Patrick Griffis
c310862d2c win32: Add files for appx building
This is quite sloppy but it should get the job done.
2021-10-11 15:42:38 -05:00
77 changed files with 183 additions and 250 deletions

View File

@@ -1,7 +1,7 @@
name: Flatpak Build name: Flatpak Build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
flatpak_build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: bilelmoussaoui/flatpak-github-actions:gnome-40 image: bilelmoussaoui/flatpak-github-actions:gnome-40

View File

@@ -2,7 +2,7 @@ name: MSYS2 Build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
msys2_build: build:
runs-on: windows-latest runs-on: windows-latest
defaults: defaults:
run: run:

View File

@@ -1,7 +1,7 @@
name: Ubuntu Build name: Ubuntu Build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
ubuntu_build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:

View File

@@ -2,7 +2,7 @@ name: Windows Build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
windows_build: build:
runs-on: windows-2019 runs-on: windows-2019
strategy: strategy:
matrix: matrix:
@@ -55,9 +55,28 @@ jobs:
msbuild win32\hexchat.sln /m /verbosity:minimal /p:Configuration=Release /p:Platform=${{ matrix.platform }} msbuild win32\hexchat.sln /m /verbosity:minimal /p:Configuration=Release /p:Platform=${{ matrix.platform }}
shell: cmd shell: cmd
- name: Creating Appx
run: |
cp -r ..\hexchat-build\${{ matrix.platform }}\rel ..\hexchat-appx
.\win32\version-template.ps1 win32\AppxManifest.xml.in $(Join-Path $(Resolve-Path ..\hexchat-appx) AppxManifest.xml)
cd ..\hexchat-appx
rm plugins\hcperl.dll
rm plugins\hcpython2.dll
rm plugins\hcpython3.dll
rm plugins\hcupd.dll
rm -r python
rm *.pyd
rm WinSparkle.dll
rm portable-mode
rm hexchat-text.exe
rm thememan.exe
makeappx pack /d . /p hexchat-${{ matrix.arch }}.appx
shell: powershell
- name: Preparing Artifacts - name: Preparing Artifacts
run: | run: |
move ..\hexchat-build\${{ matrix.platform }}\HexChat*.exe .\ move ..\hexchat-build\${{ matrix.platform }}\HexChat*.exe .\
move ..\hexchat-appx\hexchat-${{ matrix.arch }}.appx .\
move ..\hexchat-build .\ move ..\hexchat-build .\
shell: cmd shell: cmd
@@ -68,5 +87,10 @@ jobs:
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: Build Files ${{ matrix.arch }} name: Build Files ${{ matrix.arch }}
path: hexchat-build path: hexchat-build
- uses: actions/upload-artifact@v2
with:
name: Appx Files ${{ matrix.arch }}
path: hexchat-${{ matrix.arch }}.appx

View File

@@ -1,11 +1,9 @@
icondir = join_paths(get_option('datadir'), 'icons/hicolor') icondir = join_paths(get_option('datadir'), 'icons/hicolor')
install_data( install_data(
'hexchat.png', 'hexchat.png',
rename: 'io.github.Hexchat.png',
install_dir: join_paths(icondir, '48x48/apps') install_dir: join_paths(icondir, '48x48/apps')
) )
install_data( install_data(
'hexchat.svg', 'hexchat.svg',
rename: 'io.github.Hexchat.svg',
install_dir: join_paths(icondir, 'scalable/apps') install_dir: join_paths(icondir, 'scalable/apps')
) )

View File

@@ -26,19 +26,6 @@
<id>hexchat.desktop</id> <id>hexchat.desktop</id>
</provides> </provides>
<releases> <releases>
<release date="2022-02-12" version="2.16.1">
<description>
<p>This is a minor release with mostly bug-fixes:</p>
<ul>
<li>Add `-NOOVERRIDE` flag to the `GUI COLOR` command</li>
<li>Add `-q` (quiet) flag to the `EXECWRITE` command</li>
<li>Rename installed icon to match app-id (Fixes notification icon)</li>
<li>Fix escaping already escaped URLs when opening them</li>
<li>Fix Python scripts not being opened as UTF-8</li>
<li>Fix `TIMER` command supporting decimals regardless of locale</li>
</ul>
</description>
</release>
<release date="2021-10-01" version="2.16.0"> <release date="2021-10-01" version="2.16.0">
<description> <description>
<p>This is a feature release:</p> <p>This is a feature release:</p>

View File

@@ -4,7 +4,7 @@ GenericName=IRC Client
Comment=Chat with other people online Comment=Chat with other people online
Keywords=IM;Chat; Keywords=IM;Chat;
Exec=@exec_command@ Exec=@exec_command@
Icon=io.github.Hexchat Icon=hexchat
Terminal=false Terminal=false
Type=Application Type=Application
Categories=GTK;Network;IRCClient; Categories=GTK;Network;IRCClient;

View File

@@ -5,6 +5,7 @@
"runtime-version": "40", "runtime-version": "40",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
"command": "hexchat", "command": "hexchat",
"rename-icon": "hexchat",
"finish-args": [ "finish-args": [
"--share=ipc", "--share=ipc",
"--socket=x11", "--socket=x11",
@@ -30,7 +31,7 @@
"modules": [ "modules": [
"shared-modules/gtk2/gtk2.json", "shared-modules/gtk2/gtk2.json",
"shared-modules/gtk2/gtk2-common-themes.json", "shared-modules/gtk2/gtk2-common-themes.json",
"shared-modules/dbus-glib/dbus-glib.json", "shared-modules/dbus-glib/dbus-glib-0.110.json",
"shared-modules/lua5.3/lua-5.3.5.json", "shared-modules/lua5.3/lua-5.3.5.json",
"shared-modules/libcanberra/libcanberra.json", "shared-modules/libcanberra/libcanberra.json",
"python3-cffi.json", "python3-cffi.json",

View File

@@ -1,5 +1,5 @@
project('hexchat', 'c', project('hexchat', 'c',
version: '2.16.1', version: '2.16.0',
meson_version: '>= 0.47.0', meson_version: '>= 0.47.0',
default_options: [ default_options: [
'c_std=gnu89', 'c_std=gnu89',
@@ -34,7 +34,6 @@ config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('GETTEXT_PACKAGE', 'hexchat') config_h.set_quoted('GETTEXT_PACKAGE', 'hexchat')
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'),
get_option('datadir'), 'locale')) get_option('datadir'), 'locale'))
config_h.set_quoted('G_LOG_DOMAIN', 'hexchat')
config_h.set10('ENABLE_NLS', true) config_h.set10('ENABLE_NLS', true)
# Optional features # Optional features

View File

@@ -3,5 +3,4 @@ shared_module('checksum', 'checksum.c',
install: true, install: true,
install_dir: plugindir, install_dir: plugindir,
name_prefix: '', name_prefix: '',
vs_module_defs: 'checksum.def',
) )

View File

@@ -1,6 +1,5 @@
shared_module('exec', 'exec.c', shared_module('exec', 'exec.c',
dependencies: hexchat_plugin_dep, dependencies: hexchat_plugin_dep,
install: true, install: true,
install_dir: plugindir, install_dir: plugindir
vs_module_defs: 'exec.def',
) )

View File

@@ -87,54 +87,6 @@ static const signed char fish_unbase64[256] = {
dest |= (uint8_t)*((source)++); \ dest |= (uint8_t)*((source)++); \
} while (0); } while (0);
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
#include <openssl/provider.h>
static OSSL_PROVIDER *legacy_provider;
static OSSL_PROVIDER *default_provider;
static OSSL_LIB_CTX* *ossl_ctx;
#endif
int fish_init(void)
{
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
ossl_ctx = OSSL_LIB_CTX_new();
if (!ossl_ctx)
return 0;
legacy_provider = OSSL_PROVIDER_load(ossl_ctx, "legacy");
if (!legacy_provider) {
fish_deinit();
return 0;
}
default_provider = OSSL_PROVIDER_load(ossl_ctx, "default");
if (!default_provider) {
fish_deinit();
return 0;
}
#endif
return 1;
}
void fish_deinit(void)
{
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
if (legacy_provider) {
OSSL_PROVIDER_unload(legacy_provider);
legacy_provider = NULL;
}
if (default_provider) {
OSSL_PROVIDER_unload(default_provider);
default_provider = NULL;
}
if (ossl_ctx) {
OSSL_LIB_CTX_free(ossl_ctx);
ossl_ctx = NULL;
}
#endif
}
/** /**
* Encode ECB FiSH Base64 * Encode ECB FiSH Base64
@@ -276,19 +228,9 @@ char *fish_cipher(const char *plaintext, size_t plaintext_len, const char *key,
plaintext_len -= 8; plaintext_len -= 8;
} }
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
cipher = EVP_CIPHER_fetch(ossl_ctx, "BF-CBC", NULL);
#else
cipher = (EVP_CIPHER *) EVP_bf_cbc(); cipher = (EVP_CIPHER *) EVP_bf_cbc();
#endif
} else if (mode == EVP_CIPH_ECB_MODE) { } else if (mode == EVP_CIPH_ECB_MODE) {
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
cipher = EVP_CIPHER_fetch(ossl_ctx, "BF-ECB", NULL);
#else
cipher = (EVP_CIPHER *) EVP_bf_ecb(); cipher = (EVP_CIPHER *) EVP_bf_ecb();
#endif
} }
/* Zero Padding */ /* Zero Padding */

View File

@@ -35,8 +35,6 @@ enum fish_mode {
FISH_CBC_MODE = 0x2 FISH_CBC_MODE = 0x2
}; };
int fish_init(void);
void fish_deinit(void);
char *fish_base64_encode(const char *message, size_t message_len); char *fish_base64_encode(const char *message, size_t message_len);
char *fish_base64_decode(const char *message, size_t *final_len); char *fish_base64_decode(const char *message, size_t *final_len);
char *fish_encrypt(const char *key, size_t keylen, const char *message, size_t message_len, enum fish_mode mode); char *fish_encrypt(const char *key, size_t keylen, const char *message, size_t message_len, enum fish_mode mode);

View File

@@ -19,5 +19,4 @@ shared_module('fishlim', fishlim_sources,
install: true, install: true,
install_dir: plugindir, install_dir: plugindir,
name_prefix: '', name_prefix: '',
vs_module_defs: 'fishlim.def',
) )

View File

@@ -815,9 +815,6 @@ int hexchat_plugin_init(hexchat_plugin *plugin_handle,
hexchat_hook_server_attrs(ph, "TOPIC", HEXCHAT_PRI_NORM, handle_incoming, NULL); hexchat_hook_server_attrs(ph, "TOPIC", HEXCHAT_PRI_NORM, handle_incoming, NULL);
hexchat_hook_server_attrs(ph, "332", HEXCHAT_PRI_NORM, handle_incoming, NULL); hexchat_hook_server_attrs(ph, "332", HEXCHAT_PRI_NORM, handle_incoming, NULL);
if (!fish_init())
return 0;
if (!dh1080_init()) if (!dh1080_init())
return 0; return 0;
@@ -831,7 +828,6 @@ int hexchat_plugin_init(hexchat_plugin *plugin_handle,
int hexchat_plugin_deinit(void) { int hexchat_plugin_deinit(void) {
g_clear_pointer(&pending_exchanges, g_hash_table_destroy); g_clear_pointer(&pending_exchanges, g_hash_table_destroy);
dh1080_deinit(); dh1080_deinit();
fish_deinit();
hexchat_printf(ph, "%s plugin unloaded\n", plugin_name); hexchat_printf(ph, "%s plugin unloaded\n", plugin_name);
return 1; return 1;

View File

@@ -12,5 +12,4 @@ fishlim_tests = executable('fishlim_tests', fishlim_test_sources,
test('Fishlim Tests', fishlim_tests, test('Fishlim Tests', fishlim_tests,
protocol: 'tap', protocol: 'tap',
timeout: 600,
) )

View File

@@ -21,7 +21,6 @@
*/ */
#include <string.h>
#include <glib.h> #include <glib.h>
#include "fish.h" #include "fish.h"
@@ -130,17 +129,17 @@ static void
test_base64_len (void) test_base64_len (void)
{ {
char *b64 = NULL; char *b64 = NULL;
int i, message_len = 0;
char message[1000]; char message[1000];
int message_end = sizeof (message) - 1;
random_string(message, message_end); for (i = 0; i < 10; ++i) {
for (message_len = 1; message_len < 1000; ++message_len) {
for (; message_end >= 0; --message_end) { random_string(message, message_len);
message[message_end] = '\0'; /* Truncate instead of generating new strings */ b64 = g_base64_encode((const unsigned char *) message, message_len);
b64 = g_base64_encode((const unsigned char *) message, message_end); g_assert_nonnull(b64);
g_assert_nonnull(b64); g_assert_cmpuint(strlen(b64), == , base64_len(message_len));
g_assert_cmpuint(strlen(b64), == , base64_len(message_end)); g_free(b64);
g_free(b64); }
} }
} }
@@ -151,15 +150,18 @@ static void
test_base64_fish_len (void) test_base64_fish_len (void)
{ {
char *b64 = NULL; char *b64 = NULL;
int message_len = 0; int i, message_len = 0;
char message[1000]; char message[1000];
for (message_len = 1; message_len < 1000; ++message_len) { for (i = 0; i < 10; ++i) {
random_string(message, message_len);
b64 = fish_base64_encode(message, message_len); for (message_len = 1; message_len < 1000; ++message_len) {
g_assert_nonnull(b64); random_string(message, message_len);
g_assert_cmpuint(strlen(b64), == , base64_fish_len(message_len)); b64 = fish_base64_encode(message, message_len);
g_free(b64); g_assert_nonnull(b64);
g_assert_cmpuint(strlen(b64), == , base64_fish_len(message_len));
g_free(b64);
}
} }
} }
@@ -240,28 +242,30 @@ test_foreach_utf8_data_chunks(void)
{ {
GRand *rand = NULL; GRand *rand = NULL;
GString *chunks = NULL; GString *chunks = NULL;
int max_chunks_len, chunks_len; int tests, max_chunks_len, chunks_len;
char ascii_message[1001]; char ascii_message[1001];
char *data_chunk = NULL; char *data_chunk = NULL;
rand = g_rand_new(); rand = g_rand_new();
max_chunks_len = g_rand_int_range(rand, 2, 301);
random_string(ascii_message, 1000);
data_chunk = ascii_message; for (tests = 0; tests < 1000; ++tests) {
chunks = g_string_new(NULL); max_chunks_len = g_rand_int_range(rand, 2, 301);
random_string(ascii_message, 1000);
while (foreach_utf8_data_chunks(data_chunk, max_chunks_len, &chunks_len)) { data_chunk = ascii_message;
g_string_append(chunks, g_strndup(data_chunk, chunks_len));
/* Next chunk */ chunks = g_string_new(NULL);
data_chunk += chunks_len;
while (foreach_utf8_data_chunks(data_chunk, max_chunks_len, &chunks_len)) {
g_string_append(chunks, g_strndup(data_chunk, chunks_len));
/* Next chunk */
data_chunk += chunks_len;
}
/* Check data loss */
g_assert_cmpstr(chunks->str, == , ascii_message);
g_string_free(chunks, TRUE);
} }
/* Check data loss */
g_assert_cmpstr(chunks->str, == , ascii_message);
g_string_free(chunks, TRUE);
g_rand_free (rand);
} }
int int
@@ -278,8 +282,5 @@ main(int argc, char *argv[]) {
g_test_add_func("/fishlim/max_text_command_len", test_max_text_command_len); g_test_add_func("/fishlim/max_text_command_len", test_max_text_command_len);
g_test_add_func("/fishlim/foreach_utf8_data_chunks", test_foreach_utf8_data_chunks); g_test_add_func("/fishlim/foreach_utf8_data_chunks", test_foreach_utf8_data_chunks);
fish_init(); return g_test_run();
int ret = g_test_run();
fish_deinit();
return ret;
} }

View File

@@ -22,8 +22,6 @@
*/ */
#include <string.h>
#include "utils.h" #include "utils.h"
#include "fish.h" #include "fish.h"

View File

@@ -88,5 +88,4 @@ shared_module('perl',
install_dir: plugindir, install_dir: plugindir,
install_rpath: perl_rpath, install_rpath: perl_rpath,
name_prefix: '', name_prefix: '',
vs_module_defs: 'perl.def',
) )

View File

@@ -28,5 +28,4 @@ shared_module('python', python3_source,
install: true, install: true,
install_dir: plugindir, install_dir: plugindir,
name_prefix: '', name_prefix: '',
vs_module_defs: 'python.def'
) )

View File

@@ -57,5 +57,4 @@ shared_module('sysinfo', sysinfo_sources,
install: true, install: true,
install_dir: plugindir, install_dir: plugindir,
name_prefix: '', name_prefix: '',
vs_module_defs: 'sysinfo.def',
) )

View File

@@ -5,5 +5,4 @@ shared_module('upd', 'upd.c',
install: true, install: true,
install_dir: plugindir, install_dir: plugindir,
name_prefix: '', name_prefix: '',
vs_module_defs: 'upd.def',
) )

View File

@@ -3,5 +3,4 @@ shared_module('winamp', 'winamp.c',
install: true, install: true,
install_dir: plugindir, install_dir: plugindir,
name_prefix: '', name_prefix: '',
vs_module_defs: 'winamp.def',
) )

View File

@@ -69,16 +69,7 @@ int fe_input_add (int sok, int flags, void *func, void *data);
void fe_input_remove (int tag); void fe_input_remove (int tag);
void fe_idle_add (void *func, void *data); void fe_idle_add (void *func, void *data);
void fe_set_topic (struct session *sess, char *topic, char *stripped_topic); void fe_set_topic (struct session *sess, char *topic, char *stripped_topic);
typedef enum void fe_set_tab_color (struct session *sess, int col);
{
FE_COLOR_NONE = 0,
FE_COLOR_NEW_DATA = 1,
FE_COLOR_NEW_MSG = 2,
FE_COLOR_NEW_HILIGHT = 3,
FE_COLOR_FLAG_NOOVERRIDE = 8,
} tabcolor;
#define FE_COLOR_ALLFLAGS (FE_COLOR_FLAG_NOOVERRIDE)
void fe_set_tab_color (struct session *sess, tabcolor col);
void fe_flash_window (struct session *sess); void fe_flash_window (struct session *sess);
void fe_update_mode_buttons (struct session *sess, char mode, char sign); void fe_update_mode_buttons (struct session *sess, char mode, char sign);
void fe_update_channel_key (struct session *sess); void fe_update_channel_key (struct session *sess);

View File

@@ -47,6 +47,7 @@ if host_machine.system() == 'windows'
] ]
common_sysinfo_deps += [ common_sysinfo_deps += [
cc.find_library('wbemuuid'), # sysinfo cc.find_library('wbemuuid'), # sysinfo
cc.find_library('wbemcore'),
] ]
common_sources += 'sysinfo/win32/backend.c' common_sources += 'sysinfo/win32/backend.c'

View File

@@ -1579,26 +1579,9 @@ cmd_execw (struct session *sess, char *tbuf, char *word[], char *word_eol[])
EMIT_SIGNAL (XP_TE_NOCHILD, sess, NULL, NULL, NULL, NULL, 0); EMIT_SIGNAL (XP_TE_NOCHILD, sess, NULL, NULL, NULL, NULL, 0);
return FALSE; return FALSE;
} }
if (strcmp (word[2], "--") == 0) len = strlen(word_eol[2]);
{ temp = g_strconcat (word_eol[2], "\n", NULL);
len = strlen(word_eol[3]); PrintText(sess, temp);
temp = g_strconcat (word_eol[3], "\n", NULL);
PrintText(sess, temp);
}
else
{
if (strcmp (word[2], "-q") == 0)
{
len = strlen(word_eol[3]);
temp = g_strconcat (word_eol[3], "\n", NULL);
}
else
{
len = strlen(word_eol[2]);
temp = g_strconcat (word_eol[2], "\n", NULL);
PrintText(sess, temp);
}
}
write(sess->running_exec->myfd, temp, len + 1); write(sess->running_exec->myfd, temp, len + 1);
g_free(temp); g_free(temp);
@@ -2169,6 +2152,7 @@ cmd_gui (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{ {
case 0x058b836e: fe_ctrl_gui (sess, 8, 0); break; /* APPLY */ case 0x058b836e: fe_ctrl_gui (sess, 8, 0); break; /* APPLY */
case 0xac1eee45: fe_ctrl_gui (sess, 7, 2); break; /* ATTACH */ case 0xac1eee45: fe_ctrl_gui (sess, 7, 2); break; /* ATTACH */
case 0x05a72f63: fe_ctrl_gui (sess, 4, atoi (word[3])); break; /* COLOR */
case 0xb06a1793: fe_ctrl_gui (sess, 7, 1); break; /* DETACH */ case 0xb06a1793: fe_ctrl_gui (sess, 7, 1); break; /* DETACH */
case 0x05cfeff0: fe_ctrl_gui (sess, 3, 0); break; /* FLASH */ case 0x05cfeff0: fe_ctrl_gui (sess, 3, 0); break; /* FLASH */
case 0x05d154d8: fe_ctrl_gui (sess, 2, 0); break; /* FOCUS */ case 0x05d154d8: fe_ctrl_gui (sess, 2, 0); break; /* FOCUS */
@@ -2182,12 +2166,6 @@ cmd_gui (struct session *sess, char *tbuf, char *word[], char *word_eol[])
else else
return FALSE; return FALSE;
break; break;
case 0x05a72f63: /* COLOR */
if (!g_ascii_strcasecmp (word[4], "-NOOVERRIDE"))
fe_ctrl_gui (sess, 4, FE_COLOR_FLAG_NOOVERRIDE | atoi (word[3]));
else
fe_ctrl_gui (sess, 4, atoi (word[3]));
break;
default: default:
return FALSE; return FALSE;
} }
@@ -3898,6 +3876,34 @@ cmd_wallchop (struct session *sess, char *tbuf, char *word[],
return TRUE; return TRUE;
} }
static int
cmd_wallchan (struct session *sess, char *tbuf, char *word[],
char *word_eol[])
{
GSList *list;
if (*word_eol[2])
{
list = sess_list;
while (list)
{
sess = list->data;
if (sess->type == SESS_CHANNEL)
{
message_tags_data no_tags = MESSAGE_TAGS_DATA_INIT;
inbound_chanmsg (sess->server, NULL, sess->channel,
sess->server->nick, word_eol[2], TRUE, FALSE,
&no_tags);
sess->server->p_message (sess->server, sess->channel, word_eol[2]);
}
list = list->next;
}
return TRUE;
}
return FALSE;
}
static int static int
cmd_hop (struct session *sess, char *tbuf, char *word[], char *word_eol[]) cmd_hop (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{ {
@@ -3994,7 +4000,7 @@ const struct commands xc_cmds[] = {
N_("EXECKILL [-9], kills a running exec in the current session. If -9 is given the process is SIGKILL'ed")}, N_("EXECKILL [-9], kills a running exec in the current session. If -9 is given the process is SIGKILL'ed")},
#ifndef __EMX__ #ifndef __EMX__
{"EXECSTOP", cmd_execs, 0, 0, 1, N_("EXECSTOP, sends the process SIGSTOP")}, {"EXECSTOP", cmd_execs, 0, 0, 1, N_("EXECSTOP, sends the process SIGSTOP")},
{"EXECWRITE", cmd_execw, 0, 0, 1, N_("EXECWRITE [-q|--], sends data to the processes stdin; use -q flag to quiet/suppress output at text box; use -- flag to stop interpreting arguments as flags, needed if -q itself would occur as data")}, {"EXECWRITE", cmd_execw, 0, 0, 1, N_("EXECWRITE, sends data to the processes stdin")},
#endif #endif
#endif #endif
#if 0 #if 0
@@ -4009,9 +4015,8 @@ const struct commands xc_cmds[] = {
{"GETINT", cmd_getint, 0, 0, 1, "GETINT <default> <command> <prompt>"}, {"GETINT", cmd_getint, 0, 0, 1, "GETINT <default> <command> <prompt>"},
{"GETSTR", cmd_getstr, 0, 0, 1, "GETSTR <default> <command> <prompt>"}, {"GETSTR", cmd_getstr, 0, 0, 1, "GETSTR <default> <command> <prompt>"},
{"GHOST", cmd_ghost, 1, 0, 1, N_("GHOST <nick> [password], Kills a ghosted nickname")}, {"GHOST", cmd_ghost, 1, 0, 1, N_("GHOST <nick> [password], Kills a ghosted nickname")},
{"GUI", cmd_gui, 0, 0, 1, "GUI [APPLY|ATTACH|DETACH|SHOW|HIDE|FOCUS|FLASH|ICONIFY]\n" {"GUI", cmd_gui, 0, 0, 1, "GUI [APPLY|ATTACH|DETACH|SHOW|HIDE|FOCUS|FLASH|ICONIFY|COLOR <n>]\n"
" GUI [MSGBOX <text>|MENU TOGGLE]\n" " GUI [MSGBOX <text>|MENU TOGGLE]"},
" GUI COLOR <n> [-NOOVERRIDE]"},
{"HELP", cmd_help, 0, 0, 1, 0}, {"HELP", cmd_help, 0, 0, 1, 0},
{"HOP", cmd_hop, 1, 1, 1, {"HOP", cmd_hop, 1, 1, 1,
N_("HOP <nick>, gives chanhalf-op status to the nick (needs chanop)")}, N_("HOP <nick>, gives chanhalf-op status to the nick (needs chanop)")},
@@ -4136,6 +4141,8 @@ const struct commands xc_cmds[] = {
{"USERLIST", cmd_userlist, 1, 1, 1, 0}, {"USERLIST", cmd_userlist, 1, 1, 1, 0},
{"VOICE", cmd_voice, 1, 1, 1, {"VOICE", cmd_voice, 1, 1, 1,
N_("VOICE <nick>, gives voice status to someone (needs chanop)")}, N_("VOICE <nick>, gives voice status to someone (needs chanop)")},
{"WALLCHAN", cmd_wallchan, 1, 1, 1,
N_("WALLCHAN <message>, writes the message to all channels")},
{"WALLCHOP", cmd_wallchop, 1, 1, 1, {"WALLCHOP", cmd_wallchop, 1, 1, 1,
N_("WALLCHOP <message>, sends the message to all chanops on the current channel")}, N_("WALLCHOP <message>, sends the message to all chanops on the current channel")},
{0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0}

View File

@@ -198,7 +198,7 @@ timer_cb (char *word[], char *word_eol[], void *userdata)
offset += 2; offset += 2;
} }
timeout = g_ascii_strtod (word[2 + offset], NULL); timeout = atof (word[2 + offset]);
command = word_eol[3 + offset]; command = word_eol[3 + offset];
if (timeout < 0.1 || timeout * 1000 > INT_MAX || !command[0]) if (timeout < 0.1 || timeout * 1000 > INT_MAX || !command[0])

View File

@@ -627,7 +627,7 @@ process_numeric (session * sess, int n,
case 320: /* :is an identified user */ case 320: /* :is an identified user */
if (!serv->skip_next_whois) if (!serv->skip_next_whois)
EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS_ID, whois_sess, word[4], EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS_ID, whois_sess, word[4],
word_eol[5][0] == ':' ? word_eol[5] + 1 : word_eol[5], NULL, NULL, 0, word_eol[5] + 1, NULL, NULL, 0,
tags_data->timestamp); tags_data->timestamp);
break; break;

View File

@@ -1559,7 +1559,7 @@ server_connect (server *serv, char *hostname, int port, int no_login)
if (!hostname[0]) if (!hostname[0])
return; return;
if (port < 1 || port > 65535) if (port < 0)
{ {
/* use default port for this server type */ /* use default port for this server type */
port = 6667; port = 6667;
@@ -1567,8 +1567,8 @@ server_connect (server *serv, char *hostname, int port, int no_login)
if (serv->use_ssl) if (serv->use_ssl)
port = 6697; port = 6697;
#endif #endif
g_debug ("Attempted to connect to invalid port, assuming default port %d", port);
} }
port &= 0xffff; /* wrap around */
if (serv->connected || serv->connecting || serv->recondelay_tag) if (serv->connected || serv->connecting || serv->recondelay_tag)
server_disconnect (sess, TRUE, -1); server_disconnect (sess, TRUE, -1);

View File

@@ -187,9 +187,6 @@ static const struct defaultserver def[] =
{"Interlinked", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {"Interlinked", 0, 0, 0, LOGIN_SASL, 0, TRUE},
{0, "irc.interlinked.me"}, {0, "irc.interlinked.me"},
{"Irc-Nerds", 0, 0, 0, LOGIN_SASL, 0, TRUE},
{0, "irc.irc-nerds.net"},
{"IRC4Fun", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {"IRC4Fun", 0, 0, 0, LOGIN_SASL, 0, TRUE},
{0, "irc.irc4fun.net"}, {0, "irc.irc4fun.net"},

View File

@@ -84,8 +84,7 @@ sysinfo_get_cpu_arch (void)
GetNativeSystemInfo (&si); GetNativeSystemInfo (&si);
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64)
{ {
return cpu_arch = 64; return cpu_arch = 64;
} }
@@ -107,8 +106,7 @@ sysinfo_get_build_arch (void)
GetSystemInfo (&si); GetSystemInfo (&si);
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64)
{ {
return build_arch = 64; return build_arch = 64;
} }

View File

@@ -664,13 +664,13 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
return; return;
if (sess == current_tab) if (sess == current_tab)
fe_set_tab_color (sess, FE_COLOR_NONE); fe_set_tab_color (sess, 0);
else if (sess->tab_state & TAB_STATE_NEW_HILIGHT) else if (sess->tab_state & TAB_STATE_NEW_HILIGHT)
fe_set_tab_color (sess, FE_COLOR_NEW_HILIGHT); fe_set_tab_color (sess, 3);
else if (sess->tab_state & TAB_STATE_NEW_MSG) else if (sess->tab_state & TAB_STATE_NEW_MSG)
fe_set_tab_color (sess, FE_COLOR_NEW_MSG); fe_set_tab_color (sess, 2);
else else
fe_set_tab_color (sess, FE_COLOR_NEW_DATA); fe_set_tab_color (sess, 1);
} }
void void
@@ -1054,46 +1054,6 @@ osx_show_uri (const char *url)
#endif #endif
static inline char *
escape_uri (const char *uri)
{
return g_uri_escape_string(uri, G_URI_RESERVED_CHARS_GENERIC_DELIMITERS G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS, FALSE);
}
static inline gboolean
uri_contains_forbidden_characters (const char *uri)
{
while (*uri)
{
/* This is not an exhaustive list, the full URI has segments that allow characters like "[]:" for example. */
if (strchr ("`<> ${}\"+", *uri) != NULL || (*uri & 0x80) /* non-ascii */)
return TRUE;
uri++;
}
return FALSE;
}
static char *
maybe_escape_uri (const char *uri)
{
/* The only way to know if a string has already been escaped or not
* is by fulling parsing each segement but we can try some more simple heuristics. */
/* If we find characters that should clearly be escaped. */
if (uri_contains_forbidden_characters (uri))
return escape_uri (uri);
/* If it fails to be unescaped then it was not escaped. */
char *unescaped = g_uri_unescape_string (uri, NULL);
if (!unescaped)
return escape_uri (uri);
g_free (unescaped);
/* At this point it is probably safe to pass through as-is. */
return g_strdup (uri);
}
static void static void
fe_open_url_inner (const char *url) fe_open_url_inner (const char *url)
{ {
@@ -1111,8 +1071,8 @@ fe_open_url_inner (const char *url)
#elif defined(__APPLE__) #elif defined(__APPLE__)
osx_show_uri (url); osx_show_uri (url);
#else #else
char *escaped_url = maybe_escape_uri (url); char *escaped_url = g_uri_escape_string (url, G_URI_RESERVED_CHARS_GENERIC_DELIMITERS G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS,
g_debug ("Opening URL \"%s\" (%s)", escaped_url, url); FALSE);
gtk_show_uri (NULL, escaped_url, GDK_CURRENT_TIME, NULL); gtk_show_uri (NULL, escaped_url, GDK_CURRENT_TIME, NULL);
g_free (escaped_url); g_free (escaped_url);
#endif #endif

View File

@@ -175,26 +175,20 @@ fe_flash_window (session *sess)
/* set a tab plain, red, light-red, or blue */ /* set a tab plain, red, light-red, or blue */
void void
fe_set_tab_color (struct session *sess, tabcolor col) fe_set_tab_color (struct session *sess, int col)
{ {
struct session *server_sess = sess->server->server_session; struct session *server_sess = sess->server->server_session;
int col_noflags = (col & ~FE_COLOR_ALLFLAGS);
int col_shouldoverride = !(col & FE_COLOR_FLAG_NOOVERRIDE);
if (sess->res->tab && sess->gui->is_tab && (col == 0 || sess != current_tab)) if (sess->res->tab && sess->gui->is_tab && (col == 0 || sess != current_tab))
{ {
switch (col_noflags) switch (col)
{ {
case 0: /* no particular color (theme default) */ case 0: /* no particular color (theme default) */
sess->tab_state = TAB_STATE_NONE; sess->tab_state = TAB_STATE_NONE;
chan_set_color (sess->res->tab, plain_list); chan_set_color (sess->res->tab, plain_list);
break; break;
case 1: /* new data has been displayed (dark red) */ case 1: /* new data has been displayed (dark red) */
if (col_shouldoverride || !((sess->tab_state & TAB_STATE_NEW_MSG) sess->tab_state = TAB_STATE_NEW_DATA;
|| (sess->tab_state & TAB_STATE_NEW_HILIGHT))) { chan_set_color (sess->res->tab, newdata_list);
sess->tab_state = TAB_STATE_NEW_DATA;
chan_set_color (sess->res->tab, newdata_list);
}
if (chan_is_collapsed (sess->res->tab) if (chan_is_collapsed (sess->res->tab)
&& !((server_sess->tab_state & TAB_STATE_NEW_MSG) && !((server_sess->tab_state & TAB_STATE_NEW_MSG)
@@ -207,10 +201,8 @@ fe_set_tab_color (struct session *sess, tabcolor col)
break; break;
case 2: /* new message arrived in channel (light red) */ case 2: /* new message arrived in channel (light red) */
if (col_shouldoverride || !(sess->tab_state & TAB_STATE_NEW_HILIGHT)) { sess->tab_state = TAB_STATE_NEW_MSG;
sess->tab_state = TAB_STATE_NEW_MSG; chan_set_color (sess->res->tab, newmsg_list);
chan_set_color (sess->res->tab, newmsg_list);
}
if (chan_is_collapsed (sess->res->tab) if (chan_is_collapsed (sess->res->tab)
&& !(server_sess->tab_state & TAB_STATE_NEW_HILIGHT) && !(server_sess->tab_state & TAB_STATE_NEW_HILIGHT)
@@ -548,7 +540,7 @@ mg_focus (session *sess)
/* when called via mg_changui_new, is_tab might be true, but /* when called via mg_changui_new, is_tab might be true, but
sess->res->tab is still NULL. */ sess->res->tab is still NULL. */
if (sess->res->tab) if (sess->res->tab)
fe_set_tab_color (sess, FE_COLOR_NONE); fe_set_tab_color (sess, 0);
} }
static int static int

View File

@@ -18,7 +18,6 @@
#include "config.h" #include "config.h"
#include <string.h>
#include <gio/gio.h> #include <gio/gio.h>
static GDBusProxy *fdo_notifications; static GDBusProxy *fdo_notifications;

View File

@@ -623,7 +623,7 @@ fe_cleanup (void)
{ {
} }
void void
fe_set_tab_color (struct session *sess, tabcolor col) fe_set_tab_color (struct session *sess, int col)
{ {
} }
void void

52
win32/AppxManifest.xml.in Normal file
View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:uap10="http://schemas.microsoft.com/appx/manifest/uap/windows10/10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap uap3 uap10 rescap">
<Identity Name="39215TingPing.HexChat" Publisher="CN=0330FC06-4EE0-4AAB-8FB9-F9B6C1FA037F" Version="<#= [string]::Join('.', $versionParts) #>.0" ProcessorArchitecture="x86" />
<Properties>
<DisplayName>HexChat</DisplayName>
<PublisherDisplayName>TingPing</PublisherDisplayName>
<Description>Chat Client</Description>
<Logo>Assets\StoreLogo.png</Logo>
<uap10:PackageIntegrity>
<uap10:Content Enforcement="on" />
</uap10:PackageIntegrity>
</Properties>
<Resources>
<Resource Language="en-us" />
<Resource uap:Scale="100" />
<Resource uap:Scale="125" />
<Resource uap:Scale="150" />
<Resource uap:Scale="200" />
<Resource uap:Scale="400" />
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.1" />
<PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.24217.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
<Applications>
<Application Id="HexChat" Executable="hexchat.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements DisplayName="HexChat" Description="HexChat" BackgroundColor="transparent" Square150x150Logo="Assets\AppMedTile.png" Square44x44Logo="Assets\AppList.png">
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.protocol">
<uap3:Protocol Name="irc" Parameters="--url=&quot;%1&quot;">
<uap:DisplayName>IRC</uap:DisplayName>
<uap:Logo>Assets\irc.png</uap:Logo>
</uap3:Protocol>
</uap3:Extension>
<uap3:Extension Category="windows.protocol">
<uap3:Protocol Name="ircs" Parameters="--url=&quot;%1&quot;">
<uap:DisplayName>IRCS</uap:DisplayName>
<uap:Logo>Assets\irc.png</uap:Logo>
</uap3:Protocol>
</uap3:Extension>
</Extensions>
</Application>
</Applications>
</Package>

BIN
win32/Assets/AppList.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
win32/Assets/AppMedTile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
win32/Assets/StoreLogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
win32/Assets/irc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -56,6 +56,7 @@
<None Include="$(HexChatBin)thememan.exe" /> <None Include="$(HexChatBin)thememan.exe" />
<None Include="changelog.url" /> <None Include="changelog.url" />
<None Include="readme.url" /> <None Include="readme.url" />
<None Include="..\Assets\*" />
<None Include="$(DepsRoot)\bin\lua51.dll" /> <None Include="$(DepsRoot)\bin\lua51.dll" />
<None Include="$(DepsRoot)\bin\girepository-1.0-1.dll" /> <None Include="$(DepsRoot)\bin\girepository-1.0-1.dll" />