Compare commits
23 Commits
znc
...
no-fontconfig
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f4b6c0bb5 | |||
| c0769397d5 | |||
| c9b63f7f9b | |||
| ebaaf466bf | |||
| 4b6215051f | |||
| f83d78dd28 | |||
| 9fb4eb5107 | |||
| 3c89de48a8 | |||
| 6653582f0a | |||
| abaed2bda4 | |||
| e8fb2dde56 | |||
| 25c6638ce4 | |||
| ce4e129849 | |||
| ecd1aa226a | |||
| 760d18b6e7 | |||
| f389257403 | |||
| 84df81f336 | |||
| a9a6cbda4e | |||
| 7a4a0243bd | |||
| e209e55e59 | |||
| ad2300f236 | |||
| 80bdd9ce11 | |||
| 5f99d34c3b |
+6
-2
@@ -1,5 +1,7 @@
|
||||
language: c
|
||||
compiler: gcc
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
before_script:
|
||||
- sudo apt-get update
|
||||
- sudo apt-get build-dep -qq xchat
|
||||
@@ -7,9 +9,11 @@ before_script:
|
||||
script:
|
||||
- ./autogen.sh
|
||||
- ./configure --enable-textfe --with-theme-manager
|
||||
- make V=1
|
||||
- make V=1 -j$(nproc)
|
||||
notifications:
|
||||
irc:
|
||||
channels: "chat.freenode.net#hexchat-devel"
|
||||
template: "Build #%{build_number} (%{commit}) by %{author}: %{message}"
|
||||
on_success: change
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
+5
-2
@@ -255,8 +255,11 @@ if test "$perl" = yes; then
|
||||
original_ldflags="$LDFLAGS"
|
||||
CFLAGS="$PERL_CFLAGS"
|
||||
LDFLAGS="$PERL_LDFLAGS"
|
||||
AC_TRY_LINK([#include <EXTERN.h>
|
||||
#include <perl.h>], [], perl_is_usable=yes, perl_is_usable=no)
|
||||
AC_TRY_LINK([
|
||||
#define PERL_NO_INLINE_FUNCTIONS
|
||||
#include <EXTERN.h>
|
||||
#include <perl.h>
|
||||
], [], perl_is_usable=yes, perl_is_usable=no)
|
||||
CFLAGS="$original_cflags"
|
||||
LDFLAGS="$original_ldflags"
|
||||
if test x$perl_is_usable = xno ; then
|
||||
|
||||
@@ -15,4 +15,4 @@ CLEANFILES = hexchat.pm.h irc.pm.h
|
||||
hexchat.pm.h irc.pm.h: lib/HexChat.pm lib/Xchat.pm lib/HexChat/Embed.pm \
|
||||
lib/HexChat/List/Network.pm lib/HexChat/List/Network/Entry.pm \
|
||||
lib/HexChat/List/Network/AutoJoin.pm lib/IRC.pm
|
||||
perl generate_header
|
||||
cd $(srcdir); perl generate_header
|
||||
|
||||
@@ -414,6 +414,9 @@ Util_BuildEOLList(char *word[])
|
||||
PyObject *list;
|
||||
int listsize = 31;
|
||||
int i;
|
||||
char *accum = NULL;
|
||||
char *last = NULL;
|
||||
|
||||
/* Find the last valid array member; there may be intermediate NULLs that
|
||||
* would otherwise cause us to drop some members. */
|
||||
while (listsize > 0 &&
|
||||
@@ -424,10 +427,9 @@ Util_BuildEOLList(char *word[])
|
||||
PyErr_Print();
|
||||
return NULL;
|
||||
}
|
||||
char *accum = NULL;
|
||||
char *last = NULL;
|
||||
for (i = listsize; i > 0; i--) {
|
||||
char *part = word[i];
|
||||
PyObject *uni_part;
|
||||
if (accum == NULL) {
|
||||
accum = g_strdup (part);
|
||||
} else if (part != NULL && part[0] != 0) {
|
||||
@@ -443,7 +445,7 @@ Util_BuildEOLList(char *word[])
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
PyObject *uni_part = PyUnicode_FromString(accum);
|
||||
uni_part = PyUnicode_FromString(accum);
|
||||
PyList_SetItem(list, i - 1, uni_part);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,8 +53,9 @@ void get_hwmon_chip_name(char *name)
|
||||
void get_hwmon_temp(unsigned int *value, unsigned int *sensor)
|
||||
{
|
||||
char buffer[bsize];
|
||||
FILE *fp;
|
||||
snprintf(buffer, bsize, "/sys/class/hwmon/hwmon0/device/temp%i_input", *sensor);
|
||||
FILE *fp = fopen(buffer, "r");
|
||||
fp = fopen(buffer, "r");
|
||||
if(fp != NULL) {
|
||||
if(fgets(buffer, bsize, fp) != NULL)
|
||||
*value = atoi(buffer);
|
||||
|
||||
@@ -32,12 +32,12 @@ float percentage(unsigned long long *free, unsigned long long *total)
|
||||
|
||||
char *pretty_freespace(const char *desc, unsigned long long *free_k, unsigned long long *total_k)
|
||||
{
|
||||
char *result, **quantity;
|
||||
char *quantities[] = { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", 0 };
|
||||
char *result, **quantity;
|
||||
double free_space, total_space;
|
||||
free_space = *free_k;
|
||||
total_space = *total_k;
|
||||
result = malloc(bsize * sizeof(char));
|
||||
char *quantities[] = { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", 0 };
|
||||
if (total_space == 0)
|
||||
{
|
||||
snprintf(result, bsize, "%s: none", desc);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "match.h"
|
||||
#include "hwmon.h"
|
||||
#include "xsys.h"
|
||||
#include "parse.h"
|
||||
|
||||
int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned int *count)
|
||||
{
|
||||
|
||||
@@ -115,9 +115,10 @@ void pci_find_fullname(char *fullname, char *vendor, char *device)
|
||||
char devicename[bsize/2] = "";
|
||||
char *position;
|
||||
int cardfound = 0;
|
||||
FILE *fp;
|
||||
|
||||
sysinfo_get_pciids (buffer);
|
||||
FILE *fp = fopen (buffer, "r");
|
||||
fp = fopen (buffer, "r");
|
||||
|
||||
if(fp == NULL) {
|
||||
snprintf(fullname, bsize, "%s:%s", vendor, device);
|
||||
|
||||
@@ -750,7 +750,7 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
|
||||
if (!g_ascii_strcasecmp ("HELP", word[2+offset]))
|
||||
{
|
||||
hexchat_printf (ph, sysinfo_help);
|
||||
hexchat_printf (ph, "%s", sysinfo_help);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
else if (!g_ascii_strcasecmp ("LIST", word[2+offset]))
|
||||
@@ -870,7 +870,7 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
}
|
||||
else
|
||||
{
|
||||
hexchat_printf (ph, sysinfo_help);
|
||||
hexchat_printf (ph, "%s", sysinfo_help);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
}
|
||||
@@ -878,11 +878,11 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
int
|
||||
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
||||
{
|
||||
char buffer[bsize];
|
||||
ph = plugin_handle;
|
||||
*plugin_name = name;
|
||||
*plugin_desc = desc;
|
||||
*plugin_version = version;
|
||||
char buffer[bsize];
|
||||
|
||||
hexchat_hook_command (ph, "SYSINFO", HEXCHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
|
||||
hexchat_hook_command (ph, "NETDATA", HEXCHAT_PRI_NORM, netdata_cb, NULL, NULL);
|
||||
|
||||
+2
-2
@@ -128,7 +128,7 @@ print_version (char *word[], char *word_eol[], void *userdata)
|
||||
|
||||
if (!g_ascii_strcasecmp ("HELP", word[2]))
|
||||
{
|
||||
hexchat_printf (ph, upd_help);
|
||||
hexchat_printf (ph, "%s", upd_help);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
else if (!g_ascii_strcasecmp ("SET", word[2]))
|
||||
@@ -200,7 +200,7 @@ print_version (char *word[], char *word_eol[], void *userdata)
|
||||
}
|
||||
else
|
||||
{
|
||||
hexchat_printf (ph, upd_help);
|
||||
hexchat_printf (ph, "%s", upd_help);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
noinst_LIBRARIES = libhexchatcommon.a
|
||||
|
||||
AM_CPPFLAGS = $(COMMON_CFLAGS)
|
||||
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)
|
||||
|
||||
EXTRA_DIST = \
|
||||
cfgfiles.h \
|
||||
|
||||
@@ -57,10 +57,6 @@ list_addentry (GSList ** list, char *cmd, char *name)
|
||||
size_t name_len;
|
||||
size_t cmd_len = 1;
|
||||
|
||||
/* remove <2.8.0 stuff */
|
||||
if (!strcmp (cmd, "away") && !strcmp (name, "BACK"))
|
||||
return;
|
||||
|
||||
if (cmd)
|
||||
cmd_len = strlen (cmd) + 1;
|
||||
name_len = strlen (name) + 1;
|
||||
@@ -1315,7 +1311,7 @@ cmd_set (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_open_file (char *file, int flags, int mode, int xof_flags)
|
||||
hexchat_open_file (const char *file, int flags, int mode, int xof_flags)
|
||||
{
|
||||
char *buf;
|
||||
int fd;
|
||||
|
||||
@@ -48,7 +48,7 @@ void list_loadconf (char *file, GSList ** list, char *defaultconf);
|
||||
int list_delentry (GSList ** list, char *name);
|
||||
void list_addentry (GSList ** list, char *cmd, char *name);
|
||||
int cmd_set (session *sess, char *tbuf, char *word[], char *word_eol[]);
|
||||
int hexchat_open_file (char *file, int flags, int mode, int xof_flags);
|
||||
int hexchat_open_file (const char *file, int flags, int mode, int xof_flags);
|
||||
FILE *hexchat_fopen_file (const char *file, const char *mode, int xof_flags);
|
||||
|
||||
#define XOF_DOMODE 1
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -142,7 +142,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
||||
@@ -15,7 +15,7 @@ BUILT_SOURCES = \
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
AM_CPPFLAGS = $(COMMON_CFLAGS) $(DBUS_CFLAGS)
|
||||
AM_CPPFLAGS = $(COMMON_CFLAGS) $(DBUS_CFLAGS) -I$(top_srcdir)/src/common
|
||||
|
||||
noinst_PROGRAMS = example
|
||||
example_SOURCES = example.c
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include "dbus-client.h"
|
||||
#include "../hexchat.h"
|
||||
#include "../hexchatc.h"
|
||||
#include "hexchat.h"
|
||||
#include "hexchatc.h"
|
||||
|
||||
#define DBUS_SERVICE "org.hexchat.service"
|
||||
#define DBUS_REMOTE "/org/hexchat/Remote"
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <dbus/dbus-glib-lowlevel.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include "../hexchat-plugin.h"
|
||||
#include "hexchat-plugin.h"
|
||||
#include "dbus-plugin.h"
|
||||
|
||||
#define PNAME _("remote access")
|
||||
#define PDESC _("plugin for remote access using DBUS")
|
||||
|
||||
@@ -33,7 +33,7 @@ guint command_id;
|
||||
guint server_id;
|
||||
|
||||
static void
|
||||
write_error (char *message,
|
||||
write_error (const char *message,
|
||||
GError **error)
|
||||
{
|
||||
if (error == NULL || *error == NULL) {
|
||||
|
||||
@@ -55,11 +55,6 @@
|
||||
#include <glib-object.h> /* for g_type_init() */
|
||||
#endif
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
#include <openssl/ssl.h> /* SSL_() */
|
||||
#include "ssl.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_MSPROXY
|
||||
#include "msproxy.h"
|
||||
#endif
|
||||
@@ -118,10 +113,6 @@ struct session *current_tab;
|
||||
struct session *current_sess = 0;
|
||||
struct hexchatprefs prefs;
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
SSL_CTX *ctx = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef USE_LIBPROXY
|
||||
pxProxyFactory *libproxy_factory;
|
||||
#endif
|
||||
@@ -1114,11 +1105,6 @@ main (int argc, char *argv[])
|
||||
px_proxy_factory_free(libproxy_factory);
|
||||
#endif
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
if (ctx)
|
||||
_SSL_context_free (ctx);
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
WSACleanup ();
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "../../config.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gstdio.h>
|
||||
@@ -502,6 +502,7 @@ typedef struct server
|
||||
struct msproxy_state_t msp_state;
|
||||
int id; /* unique ID number (for plugin API) */
|
||||
#ifdef USE_OPENSSL
|
||||
SSL_CTX *ctx;
|
||||
SSL *ssl;
|
||||
int ssl_do_connect_tag;
|
||||
#else
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
int main(void)
|
||||
{
|
||||
char name[512];
|
||||
char num[512];
|
||||
|
||||
+8
-20
@@ -293,26 +293,20 @@ notify_set_offline_list (server * serv, char *users, int quiet,
|
||||
struct notify_per_server *servnot;
|
||||
char nick[NICKLEN];
|
||||
char *token, *chr;
|
||||
int pos;
|
||||
|
||||
token = strtok (users, ",");
|
||||
while (token != NULL)
|
||||
{
|
||||
chr = strchr (token, '!');
|
||||
if (!chr)
|
||||
goto end;
|
||||
if (chr != NULL)
|
||||
*chr = '\0';
|
||||
|
||||
pos = chr - token;
|
||||
if (pos + 1 >= sizeof(nick))
|
||||
goto end;
|
||||
|
||||
memset (nick, 0, sizeof(nick));
|
||||
strncpy (nick, token, pos);
|
||||
g_strlcpy (nick, token, sizeof(nick));
|
||||
|
||||
servnot = notify_find (serv, nick);
|
||||
if (servnot)
|
||||
notify_announce_offline (serv, servnot, nick, quiet, tags_data);
|
||||
end:
|
||||
|
||||
token = strtok (NULL, ",");
|
||||
}
|
||||
}
|
||||
@@ -324,26 +318,20 @@ notify_set_online_list (server * serv, char *users,
|
||||
struct notify_per_server *servnot;
|
||||
char nick[NICKLEN];
|
||||
char *token, *chr;
|
||||
int pos;
|
||||
|
||||
token = strtok (users, ",");
|
||||
while (token != NULL)
|
||||
{
|
||||
chr = strchr (token, '!');
|
||||
if (!chr)
|
||||
goto end;
|
||||
if (chr != NULL)
|
||||
*chr = '\0';
|
||||
|
||||
pos = chr - token;
|
||||
if (pos + 1 >= sizeof(nick))
|
||||
goto end;
|
||||
|
||||
memset (nick, 0, sizeof(nick));
|
||||
strncpy (nick, token, pos);
|
||||
g_strlcpy (nick, token, sizeof(nick));
|
||||
|
||||
servnot = notify_find (serv, nick);
|
||||
if (servnot)
|
||||
notify_announce_online (serv, servnot, nick, tags_data);
|
||||
end:
|
||||
|
||||
token = strtok (NULL, ",");
|
||||
}
|
||||
}
|
||||
|
||||
+27
-10
@@ -76,7 +76,6 @@
|
||||
#endif
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
extern SSL_CTX *ctx; /* hexchat.c */
|
||||
/* local variables */
|
||||
static struct session *g_sess = NULL;
|
||||
#endif
|
||||
@@ -724,9 +723,22 @@ ssl_do_connect (server * serv)
|
||||
switch (verify_error)
|
||||
{
|
||||
case X509_V_OK:
|
||||
{
|
||||
X509 *cert = SSL_get_peer_certificate (serv->ssl);
|
||||
int hostname_err;
|
||||
if ((hostname_err = _SSL_check_hostname(cert, serv->hostname)) != 0)
|
||||
{
|
||||
snprintf (buf, sizeof (buf), "* Verify E: Failed to validate hostname? (%d)%s",
|
||||
hostname_err, serv->accept_invalid_cert ? " -- Ignored" : "");
|
||||
if (serv->accept_invalid_cert)
|
||||
EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL, NULL, 0);
|
||||
else
|
||||
goto conn_fail;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* snprintf (buf, sizeof (buf), "* Verify OK (?)"); */
|
||||
/* EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL, NULL, 0); */
|
||||
break;
|
||||
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
|
||||
case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
|
||||
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
|
||||
@@ -745,6 +757,7 @@ ssl_do_connect (server * serv)
|
||||
snprintf (buf, sizeof (buf), "%s.? (%d)",
|
||||
X509_verify_cert_error_string (verify_error),
|
||||
verify_error);
|
||||
conn_fail:
|
||||
EMIT_SIGNAL (XP_TE_CONNFAIL, serv->server_session, buf, NULL, NULL,
|
||||
NULL, 0);
|
||||
|
||||
@@ -861,8 +874,8 @@ server_connect_success (server *serv)
|
||||
|
||||
/* it'll be a memory leak, if connection isn't terminated by
|
||||
server_cleanup() */
|
||||
serv->ssl = _SSL_socket (ctx, serv->sok);
|
||||
if ((err = _SSL_set_verify (ctx, ssl_cb_verify, NULL)))
|
||||
serv->ssl = _SSL_socket (serv->ctx, serv->sok);
|
||||
if ((err = _SSL_set_verify (serv->ctx, ssl_cb_verify, NULL)))
|
||||
{
|
||||
EMIT_SIGNAL (XP_TE_CONNFAIL, serv->server_session, err, NULL,
|
||||
NULL, NULL, 0);
|
||||
@@ -1666,9 +1679,9 @@ server_connect (server *serv, char *hostname, int port, int no_login)
|
||||
session *sess = serv->server_session;
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
if (!ctx && serv->use_ssl)
|
||||
if (!serv->ctx && serv->use_ssl)
|
||||
{
|
||||
if (!(ctx = _SSL_context_init (ssl_cb_info, FALSE)))
|
||||
if (!(serv->ctx = _SSL_context_init (ssl_cb_info, FALSE)))
|
||||
{
|
||||
fprintf (stderr, "_SSL_context_init failed\n");
|
||||
exit (1);
|
||||
@@ -1711,18 +1724,18 @@ server_connect (server *serv, char *hostname, int port, int no_login)
|
||||
/* first try network specific cert/key */
|
||||
cert_file = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "certs" G_DIR_SEPARATOR_S "%s.pem",
|
||||
get_xdir (), server_get_network (serv, TRUE));
|
||||
if (SSL_CTX_use_certificate_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
|
||||
if (SSL_CTX_use_certificate_file (serv->ctx, cert_file, SSL_FILETYPE_PEM) == 1)
|
||||
{
|
||||
if (SSL_CTX_use_PrivateKey_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
|
||||
if (SSL_CTX_use_PrivateKey_file (serv->ctx, cert_file, SSL_FILETYPE_PEM) == 1)
|
||||
serv->have_cert = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* if that doesn't exist, try <config>/certs/client.pem */
|
||||
cert_file = g_build_filename (get_xdir (), "certs", "client.pem", NULL);
|
||||
if (SSL_CTX_use_certificate_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
|
||||
if (SSL_CTX_use_certificate_file (serv->ctx, cert_file, SSL_FILETYPE_PEM) == 1)
|
||||
{
|
||||
if (SSL_CTX_use_PrivateKey_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
|
||||
if (SSL_CTX_use_PrivateKey_file (serv->ctx, cert_file, SSL_FILETYPE_PEM) == 1)
|
||||
serv->have_cert = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2047,6 +2060,10 @@ server_free (server *serv)
|
||||
free (serv->encoding);
|
||||
if (serv->favlist)
|
||||
g_slist_free_full (serv->favlist, (GDestroyNotify) servlist_favchan_free);
|
||||
#ifdef USE_OPENSSL
|
||||
if (serv->ctx)
|
||||
_SSL_context_free (serv->ctx);
|
||||
#endif
|
||||
|
||||
fe_server_callback (serv);
|
||||
|
||||
|
||||
+222
-11
@@ -25,6 +25,7 @@
|
||||
#include "inet.h" /* make it first to avoid macro redefinitions */
|
||||
#include <openssl/ssl.h> /* SSL_() */
|
||||
#include <openssl/err.h> /* ERR_() */
|
||||
#include <openssl/x509v3.h>
|
||||
#ifdef WIN32
|
||||
#include <openssl/rand.h> /* RAND_seed() */
|
||||
#endif
|
||||
@@ -33,10 +34,14 @@
|
||||
#include <string.h> /* strncpy() */
|
||||
#include "ssl.h" /* struct cert_info */
|
||||
|
||||
#ifndef HAVE_SNPRINTF
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#define snprintf g_snprintf
|
||||
#include <gio/gio.h>
|
||||
#include "util.h"
|
||||
|
||||
/* If openssl was built without ec */
|
||||
#ifndef SSL_OP_SINGLE_ECDH_USE
|
||||
#define SSL_OP_SINGLE_ECDH_USE 0
|
||||
#endif
|
||||
|
||||
/* globals */
|
||||
@@ -55,7 +60,7 @@ __SSL_fill_err_buf (char *funcname)
|
||||
|
||||
err = ERR_get_error ();
|
||||
ERR_error_string (err, buf);
|
||||
snprintf (err_buf, sizeof (err_buf), "%s: %s (%d)\n", funcname, buf, err);
|
||||
g_snprintf (err_buf, sizeof (err_buf), "%s: %s (%d)\n", funcname, buf, err);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +89,11 @@ _SSL_context_init (void (*info_cb_func), int server)
|
||||
|
||||
SSL_CTX_set_session_cache_mode (ctx, SSL_SESS_CACHE_BOTH);
|
||||
SSL_CTX_set_timeout (ctx, 300);
|
||||
SSL_CTX_set_options (ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3
|
||||
|SSL_OP_NO_COMPRESSION
|
||||
|SSL_OP_SINGLE_DH_USE|SSL_OP_SINGLE_ECDH_USE
|
||||
|SSL_OP_NO_TICKET
|
||||
|SSL_OP_CIPHER_SERVER_PREFERENCE);
|
||||
|
||||
/* used in SSL_connect(), SSL_accept() */
|
||||
SSL_CTX_set_info_callback (ctx, info_cb_func);
|
||||
@@ -111,8 +121,8 @@ ASN1_TIME_snprintf (char *buf, int buf_len, ASN1_TIME * tm)
|
||||
buf[0] = 0;
|
||||
if (expires != NULL)
|
||||
{
|
||||
memset (buf, 0, buf_len);
|
||||
strncpy (buf, expires, 24);
|
||||
/* expires is not \0 terminated */
|
||||
safe_strcpy (buf, expires, MIN(24, buf_len));
|
||||
}
|
||||
BIO_free (inMem);
|
||||
}
|
||||
@@ -174,17 +184,17 @@ _SSL_get_cert_info (struct cert_info *cert_info, SSL * ssl)
|
||||
|
||||
peer_pkey = X509_get_pubkey (peer_cert);
|
||||
|
||||
strncpy (cert_info->algorithm,
|
||||
safe_strcpy (cert_info->algorithm,
|
||||
(alg == NID_undef) ? "Unknown" : OBJ_nid2ln (alg),
|
||||
sizeof (cert_info->algorithm));
|
||||
cert_info->algorithm_bits = EVP_PKEY_bits (peer_pkey);
|
||||
strncpy (cert_info->sign_algorithm,
|
||||
safe_strcpy (cert_info->sign_algorithm,
|
||||
(sign_alg == NID_undef) ? "Unknown" : OBJ_nid2ln (sign_alg),
|
||||
sizeof (cert_info->sign_algorithm));
|
||||
/* EVP_PKEY_bits(ca_pkey)); */
|
||||
cert_info->sign_algorithm_bits = 0;
|
||||
strncpy (cert_info->notbefore, notBefore, sizeof (cert_info->notbefore));
|
||||
strncpy (cert_info->notafter, notAfter, sizeof (cert_info->notafter));
|
||||
safe_strcpy (cert_info->notbefore, notBefore, sizeof (cert_info->notbefore));
|
||||
safe_strcpy (cert_info->notafter, notAfter, sizeof (cert_info->notafter));
|
||||
|
||||
EVP_PKEY_free (peer_pkey);
|
||||
|
||||
@@ -213,9 +223,9 @@ _SSL_get_cipher_info (SSL * ssl)
|
||||
|
||||
|
||||
c = SSL_get_current_cipher (ssl);
|
||||
strncpy (chiper_info.version, SSL_CIPHER_get_version (c),
|
||||
safe_strcpy (chiper_info.version, SSL_CIPHER_get_version (c),
|
||||
sizeof (chiper_info.version));
|
||||
strncpy (chiper_info.chiper, SSL_CIPHER_get_name (c),
|
||||
safe_strcpy (chiper_info.chiper, SSL_CIPHER_get_name (c),
|
||||
sizeof (chiper_info.chiper));
|
||||
SSL_CIPHER_get_bits (c, &chiper_info.chiper_bits);
|
||||
|
||||
@@ -331,3 +341,204 @@ _SSL_close (SSL * ssl)
|
||||
SSL_free (ssl);
|
||||
ERR_remove_state (0); /* free state buffer */
|
||||
}
|
||||
|
||||
/* Hostname validation code based on OpenBSD's libtls. */
|
||||
|
||||
static int
|
||||
_SSL_match_hostname (const char *cert_hostname, const char *hostname)
|
||||
{
|
||||
const char *cert_domain, *domain, *next_dot;
|
||||
|
||||
if (g_ascii_strcasecmp (cert_hostname, hostname) == 0)
|
||||
return 0;
|
||||
|
||||
/* Wildcard match? */
|
||||
if (cert_hostname[0] == '*')
|
||||
{
|
||||
/*
|
||||
* Valid wildcards:
|
||||
* - "*.domain.tld"
|
||||
* - "*.sub.domain.tld"
|
||||
* - etc.
|
||||
* Reject "*.tld".
|
||||
* No attempt to prevent the use of eg. "*.co.uk".
|
||||
*/
|
||||
cert_domain = &cert_hostname[1];
|
||||
/* Disallow "*" */
|
||||
if (cert_domain[0] == '\0')
|
||||
return -1;
|
||||
/* Disallow "*foo" */
|
||||
if (cert_domain[0] != '.')
|
||||
return -1;
|
||||
/* Disallow "*.." */
|
||||
if (cert_domain[1] == '.')
|
||||
return -1;
|
||||
next_dot = strchr (&cert_domain[1], '.');
|
||||
/* Disallow "*.bar" */
|
||||
if (next_dot == NULL)
|
||||
return -1;
|
||||
/* Disallow "*.bar.." */
|
||||
if (next_dot[1] == '.')
|
||||
return -1;
|
||||
|
||||
domain = strchr (hostname, '.');
|
||||
|
||||
/* No wildcard match against a hostname with no domain part. */
|
||||
if (domain == NULL || strlen(domain) == 1)
|
||||
return -1;
|
||||
|
||||
if (g_ascii_strcasecmp (cert_domain, domain) == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
_SSL_check_subject_altname (X509 *cert, const char *host)
|
||||
{
|
||||
STACK_OF(GENERAL_NAME) *altname_stack = NULL;
|
||||
GInetAddress *addr;
|
||||
GSocketFamily family;
|
||||
int type = GEN_DNS;
|
||||
int count, i;
|
||||
int rv = -1;
|
||||
|
||||
altname_stack = X509_get_ext_d2i (cert, NID_subject_alt_name, NULL, NULL);
|
||||
if (altname_stack == NULL)
|
||||
return -1;
|
||||
|
||||
addr = g_inet_address_new_from_string (host);
|
||||
if (addr != NULL)
|
||||
{
|
||||
family = g_inet_address_get_family (addr);
|
||||
if (family == G_SOCKET_FAMILY_IPV4 || family == G_SOCKET_FAMILY_IPV6)
|
||||
type = GEN_IPADD;
|
||||
}
|
||||
|
||||
count = sk_GENERAL_NAME_num(altname_stack);
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
GENERAL_NAME *altname;
|
||||
|
||||
altname = sk_GENERAL_NAME_value (altname_stack, i);
|
||||
|
||||
if (altname->type != type)
|
||||
continue;
|
||||
|
||||
if (type == GEN_DNS)
|
||||
{
|
||||
unsigned char *data;
|
||||
int format;
|
||||
|
||||
format = ASN1_STRING_type (altname->d.dNSName);
|
||||
if (format == V_ASN1_IA5STRING)
|
||||
{
|
||||
data = ASN1_STRING_data (altname->d.dNSName);
|
||||
|
||||
if (ASN1_STRING_length (altname->d.dNSName) != (int)strlen(data))
|
||||
{
|
||||
g_warning("NUL byte in subjectAltName, probably a malicious certificate.\n");
|
||||
rv = -2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (_SSL_match_hostname (data, host) == 0)
|
||||
{
|
||||
rv = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
g_warning ("unhandled subjectAltName dNSName encoding (%d)\n", format);
|
||||
|
||||
}
|
||||
else if (type == GEN_IPADD)
|
||||
{
|
||||
unsigned char *data;
|
||||
const guint8 *addr_bytes;
|
||||
int datalen, addr_len;
|
||||
|
||||
datalen = ASN1_STRING_length (altname->d.iPAddress);
|
||||
data = ASN1_STRING_data (altname->d.iPAddress);
|
||||
|
||||
addr_bytes = g_inet_address_to_bytes (addr);
|
||||
addr_len = (int)g_inet_address_get_native_size (addr);
|
||||
|
||||
if (datalen == addr_len && memcmp (data, addr_bytes, addr_len) == 0)
|
||||
{
|
||||
rv = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (addr != NULL)
|
||||
g_object_unref (addr);
|
||||
sk_GENERAL_NAME_free (altname_stack);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int
|
||||
_SSL_check_common_name (X509 *cert, const char *host)
|
||||
{
|
||||
X509_NAME *name;
|
||||
char *common_name = NULL;
|
||||
int common_name_len;
|
||||
int rv = -1;
|
||||
GInetAddress *addr;
|
||||
|
||||
name = X509_get_subject_name (cert);
|
||||
if (name == NULL)
|
||||
return -1;
|
||||
|
||||
common_name_len = X509_NAME_get_text_by_NID (name, NID_commonName, NULL, 0);
|
||||
if (common_name_len < 0)
|
||||
return -1;
|
||||
|
||||
common_name = calloc (common_name_len + 1, 1);
|
||||
if (common_name == NULL)
|
||||
return -1;
|
||||
|
||||
X509_NAME_get_text_by_NID (name, NID_commonName, common_name, common_name_len + 1);
|
||||
|
||||
/* NUL bytes in CN? */
|
||||
if (common_name_len != (int)strlen(common_name))
|
||||
{
|
||||
g_warning ("NUL byte in Common Name field, probably a malicious certificate.\n");
|
||||
rv = -2;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((addr = g_inet_address_new_from_string (host)) != NULL)
|
||||
{
|
||||
/*
|
||||
* We don't want to attempt wildcard matching against IP
|
||||
* addresses, so perform a simple comparison here.
|
||||
*/
|
||||
if (g_strcmp0 (common_name, host) == 0)
|
||||
rv = 0;
|
||||
else
|
||||
rv = -1;
|
||||
|
||||
g_object_unref (addr);
|
||||
}
|
||||
else if (_SSL_match_hostname (common_name, host) == 0)
|
||||
rv = 0;
|
||||
|
||||
out:
|
||||
free(common_name);
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
_SSL_check_hostname (X509 *cert, const char *host)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = _SSL_check_subject_altname (cert, host);
|
||||
if (rv == 0 || rv == -2)
|
||||
return rv;
|
||||
|
||||
return _SSL_check_common_name (cert, host);
|
||||
}
|
||||
+2
-2
@@ -37,7 +37,7 @@ struct cert_info {
|
||||
|
||||
struct chiper_info {
|
||||
char version[16];
|
||||
char chiper[24];
|
||||
char chiper[48];
|
||||
int chiper_bits;
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ char *_SSL_set_verify (SSL_CTX *ctx, void *(verify_callback), char *cacert);
|
||||
int SSL_get_fd(SSL *);
|
||||
*/
|
||||
void _SSL_close (SSL * ssl);
|
||||
|
||||
int _SSL_check_hostname(X509 *cert, const char *host);
|
||||
int _SSL_get_cert_info (struct cert_info *cert_info, SSL * ssl);
|
||||
struct chiper_info *_SSL_get_cipher_info (SSL * ssl);
|
||||
|
||||
|
||||
+8
-1
@@ -2300,7 +2300,14 @@ sound_play (const char *file, gboolean quiet)
|
||||
if (g_access (wavfile, R_OK) == 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
PlaySound (wavfile, NULL, SND_NODEFAULT|SND_FILENAME|SND_ASYNC);
|
||||
gunichar2 *wavfile_utf16 = g_utf8_to_utf16 (wavfile, -1, NULL, NULL, NULL);
|
||||
|
||||
if (wavfile_utf16 != NULL)
|
||||
{
|
||||
PlaySoundW (wavfile_utf16, NULL, SND_NODEFAULT | SND_FILENAME | SND_ASYNC);
|
||||
|
||||
g_free (wavfile_utf16);
|
||||
}
|
||||
#else
|
||||
#ifdef USE_LIBCANBERRA
|
||||
if (ca_con == NULL)
|
||||
|
||||
+3
-3
@@ -415,8 +415,8 @@ regex_match (const GRegex *re, const char *word, int *start, int *end)
|
||||
}
|
||||
|
||||
/* Miscellaneous description --- */
|
||||
#define DOMAIN "[_a-z0-9][-_a-z0-9]*(\\.[-_a-z0-9]+)*"
|
||||
#define TLD "\\.[a-z][-a-z0-9]*[a-z]"
|
||||
#define DOMAIN "[_\\pL\\pN][-_\\pL\\pN]*(\\.[-_\\pL\\pN]+)*"
|
||||
#define TLD "\\.[\\pL][-\\pL\\pN]*[\\pL]"
|
||||
#define IPADDR "[0-9]{1,3}(\\.[0-9]{1,3}){3}"
|
||||
#define IPV6GROUP "([0-9a-f]{0,4})"
|
||||
#define IPV6ADDR "((" IPV6GROUP "(:" IPV6GROUP "){7})" \
|
||||
@@ -429,7 +429,7 @@ regex_match (const GRegex *re, const char *word, int *start, int *end)
|
||||
#define OPT_PORT "(" PORT ")?"
|
||||
|
||||
static GRegex *
|
||||
make_re (char *grist)
|
||||
make_re (const char *grist)
|
||||
{
|
||||
GRegex *ret;
|
||||
GError *err = NULL;
|
||||
|
||||
+3
-3
@@ -1526,7 +1526,7 @@ canonalize_key (char *key)
|
||||
}
|
||||
|
||||
int
|
||||
portable_mode ()
|
||||
portable_mode (void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if ((_access( "portable-mode", 0 )) != -1)
|
||||
@@ -1543,7 +1543,7 @@ portable_mode ()
|
||||
}
|
||||
|
||||
int
|
||||
unity_mode ()
|
||||
unity_mode (void)
|
||||
{
|
||||
#ifdef G_OS_UNIX
|
||||
const char *env = g_getenv("XDG_CURRENT_DESKTOP");
|
||||
@@ -1671,7 +1671,7 @@ encode_sasl_pass_blowfish (char *user, char *pass, char *data)
|
||||
memset (encrypted_pass, 0, pass_len);
|
||||
plain_pass = (char*)malloc (pass_len);
|
||||
memset (plain_pass, 0, pass_len);
|
||||
memcpy (plain_pass, pass, pass_len);
|
||||
memcpy (plain_pass, pass, strlen(pass));
|
||||
out_ptr = (char*)encrypted_pass;
|
||||
in_ptr = (char*)plain_pass;
|
||||
|
||||
|
||||
+2
-2
@@ -73,8 +73,8 @@ guint32 str_hash (const char *key);
|
||||
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 unity_mode ();
|
||||
int portable_mode (void);
|
||||
int unity_mode (void);
|
||||
char *encode_sasl_pass_plain (char *user, char *pass);
|
||||
char *encode_sasl_pass_blowfish (char *user, char *pass, char *data);
|
||||
char *encode_sasl_pass_aes (char *user, char *pass, char *data);
|
||||
|
||||
@@ -62,12 +62,13 @@ cv_tabs_sizerequest (GtkWidget *viewport, GtkRequisition *requisition, chanview
|
||||
static void
|
||||
cv_tabs_sizealloc (GtkWidget *widget, GtkAllocation *allocation, chanview *cv)
|
||||
{
|
||||
GdkWindow *parent_win;
|
||||
GtkAdjustment *adj;
|
||||
GtkWidget *inner;
|
||||
gint viewport_size;
|
||||
|
||||
inner = ((tabview *)cv)->inner;
|
||||
GdkWindow *parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
|
||||
parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
|
||||
|
||||
if (cv->vertical)
|
||||
{
|
||||
|
||||
+73
-32
@@ -656,10 +656,11 @@ void
|
||||
fe_beep (session *sess)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (!PlaySound ("Notification.IM", NULL, SND_ALIAS|SND_ASYNC))
|
||||
/* Play the "Instant Message Notification" system sound
|
||||
*/
|
||||
if (!PlaySoundW (L"Notification.IM", NULL, SND_ALIAS | SND_ASYNC))
|
||||
{
|
||||
/* This is really just a fallback attempt, may or may not work on new Windows releases, especially on x64.
|
||||
* You should set up the "Instant Message Notification" system sound instead, supported on Vista and up.
|
||||
/* The user does not have the "Instant Message Notification" sound set. Fall back to system beep.
|
||||
*/
|
||||
Beep (1000, 50);
|
||||
}
|
||||
@@ -983,23 +984,84 @@ fe_set_inputbox_contents (session *sess, char *text)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
static char *
|
||||
url_escape_hostname (const char *url)
|
||||
{
|
||||
char *host_start, *host_end, *ret, *hostname;
|
||||
|
||||
host_start = strstr (url, "://");
|
||||
if (host_start != NULL)
|
||||
{
|
||||
*host_start = '\0';
|
||||
host_start += 3;
|
||||
host_end = strchr (host_start, '/');
|
||||
|
||||
if (host_end != NULL)
|
||||
{
|
||||
*host_end = '\0';
|
||||
host_end++;
|
||||
}
|
||||
|
||||
hostname = g_hostname_to_ascii (host_start);
|
||||
if (host_end != NULL)
|
||||
ret = g_strdup_printf ("%s://%s/%s", url, hostname, host_end);
|
||||
else
|
||||
ret = g_strdup_printf ("%s://%s", url, hostname);
|
||||
|
||||
g_free (hostname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return g_strdup (url);
|
||||
}
|
||||
|
||||
static void
|
||||
osx_show_uri (const char *url)
|
||||
{
|
||||
char *escaped_url, *encoded_url, *open, *cmd;
|
||||
|
||||
escaped_url = url_escape_hostname (url);
|
||||
encoded_url = g_filename_from_utf8 (escaped_url, -1, NULL, NULL, NULL);
|
||||
if (encoded_url)
|
||||
{
|
||||
open = g_find_program_in_path ("open");
|
||||
cmd = g_strjoin (" ", open, encoded_url, NULL);
|
||||
|
||||
hexchat_exec (cmd);
|
||||
|
||||
g_free (encoded_url);
|
||||
g_free (cmd);
|
||||
}
|
||||
|
||||
g_free (escaped_url);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
fe_open_url_inner (const char *url)
|
||||
{
|
||||
#ifdef WIN32
|
||||
ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL);
|
||||
#elif defined __APPLE__
|
||||
/* on Mac you can just 'open http://foo.bar/' */
|
||||
gchar open[512];
|
||||
g_snprintf (open, sizeof(open), "%s %s", g_find_program_in_path ("open"), url, NULL);
|
||||
hexchat_exec (open);
|
||||
gunichar2 *url_utf16 = g_utf8_to_utf16 (url, -1, NULL, NULL, NULL);
|
||||
|
||||
if (url_utf16 == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ShellExecuteW (0, L"open", url_utf16, NULL, NULL, SW_SHOWNORMAL);
|
||||
|
||||
g_free (url_utf16);
|
||||
#elif defined(__APPLE__)
|
||||
osx_show_uri (url);
|
||||
#else
|
||||
gtk_show_uri (NULL, url, GDK_CURRENT_TIME, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
fe_open_url_locale (const char *url)
|
||||
void
|
||||
fe_open_url (const char *url)
|
||||
{
|
||||
int url_type = url_check_word (url);
|
||||
char *uri;
|
||||
@@ -1041,27 +1103,6 @@ fe_open_url_locale (const char *url)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fe_open_url (const char *url)
|
||||
{
|
||||
char *loc;
|
||||
|
||||
if (prefs.utf8_locale)
|
||||
{
|
||||
fe_open_url_locale (url);
|
||||
return;
|
||||
}
|
||||
|
||||
/* the OS expects it in "locale" encoding. This makes it work on
|
||||
unix systems that use ISO-8859-x and Win32. */
|
||||
loc = g_locale_from_utf8 (url, -1, 0, 0, 0);
|
||||
if (loc)
|
||||
{
|
||||
fe_open_url_locale (loc);
|
||||
g_free (loc);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fe_server_event (server *serv, int type, int arg)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DisableSpecificWarnings>4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
@@ -81,7 +81,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
||||
@@ -441,7 +441,8 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
|
||||
{
|
||||
if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) &&
|
||||
(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) &&
|
||||
prefs.hex_gui_tray_minimize && !unity_mode ())
|
||||
prefs.hex_gui_tray_minimize && prefs.hex_gui_tray &&
|
||||
!unity_mode ())
|
||||
{
|
||||
tray_toggle_visibility (TRUE);
|
||||
gtk_window_deiconify (wid);
|
||||
|
||||
@@ -186,9 +186,10 @@ fe_tray_set_balloon (const char *title, const char *text)
|
||||
|
||||
if (!notify_is_initted())
|
||||
{
|
||||
GList* server_caps;
|
||||
notify_init(PACKAGE_NAME);
|
||||
|
||||
GList* server_caps = notify_get_server_caps ();
|
||||
server_caps = notify_get_server_caps ();
|
||||
if (g_list_find_custom (server_caps, "body-markup", (GCompareFunc)strcmp))
|
||||
{
|
||||
notify_text_strip_flags |= STRIP_ESCMARKUP;
|
||||
|
||||
+5
-2
@@ -484,7 +484,10 @@ gtk_xtext_adjustment_set (xtext_buffer *buf, int fire_signal)
|
||||
adj->page_increment = adj->page_size;
|
||||
|
||||
if (adj->value > adj->upper - adj->page_size)
|
||||
{
|
||||
buf->scrollbar_down = TRUE;
|
||||
adj->value = adj->upper - adj->page_size;
|
||||
}
|
||||
|
||||
if (adj->value < 0)
|
||||
adj->value = 0;
|
||||
@@ -3254,7 +3257,7 @@ gtk_xtext_render_stamp (GtkXText * xtext, textentry * ent,
|
||||
{
|
||||
textentry tmp_ent;
|
||||
int jo, ji, hs;
|
||||
int xsize, y;
|
||||
int xsize, y, emphasis;
|
||||
|
||||
/* trashing ent here, so make a backup first */
|
||||
memcpy (&tmp_ent, ent, sizeof (tmp_ent));
|
||||
@@ -3264,7 +3267,7 @@ gtk_xtext_render_stamp (GtkXText * xtext, textentry * ent,
|
||||
xtext->jump_out_offset = 0;
|
||||
xtext->jump_in_offset = 0;
|
||||
xtext->hilight_start = 0xffff; /* temp disable */
|
||||
int emphasis = 0;
|
||||
emphasis = 0;
|
||||
|
||||
if (xtext->mark_stamp)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -81,7 +81,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_CONSOLE;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
||||
+2
-5
@@ -30,9 +30,9 @@
|
||||
<Python3Path>$(YourPython3Path)\$(PlatformName)</Python3Path>
|
||||
<Python3Lib>python34</Python3Lib>
|
||||
<Python3Output>hcpython3</Python3Output>
|
||||
<Glib>$(DepsRoot)\include\glib-2.0;$(DepsRoot)\lib\glib-2.0\include;$(DepsRoot)\include\libxml2</Glib>
|
||||
<Glib>$(DepsRoot)\include\glib-2.0;$(DepsRoot)\lib\glib-2.0\include</Glib>
|
||||
<Gtk>$(DepsRoot)\include\gtk-2.0;$(DepsRoot)\lib\gtk-2.0\include;$(DepsRoot)\include\atk-1.0;$(DepsRoot)\include\cairo;$(DepsRoot)\include\pango-1.0;$(DepsRoot)\include\gdk-pixbuf-2.0</Gtk>
|
||||
<DepLibs>gtk-win32-2.0.lib;gdk-win32-2.0.lib;atk-1.0.lib;gio-2.0.lib;gdk_pixbuf-2.0.lib;pangowin32-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo.lib;gobject-2.0.lib;gmodule-2.0.lib;glib-2.0.lib;libintl.lib;libxml2.lib;libeay32.lib;ssleay32.lib;wininet.lib;winmm.lib;ws2_32.lib</DepLibs>
|
||||
<DepLibs>gtk-win32-2.0.lib;gdk-win32-2.0.lib;atk-1.0.lib;gio-2.0.lib;gdk_pixbuf-2.0.lib;pangowin32-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo.lib;gobject-2.0.lib;gmodule-2.0.lib;glib-2.0.lib;libintl.lib;libeay32.lib;ssleay32.lib;wininet.lib;winmm.lib;ws2_32.lib</DepLibs>
|
||||
<DataDir>$(SolutionDir)..\data\\</DataDir>
|
||||
<HexChatBuild>$(SolutionDir)..\..\hexchat-build</HexChatBuild>
|
||||
<HexChatBin>$(HexChatBuild)\$(PlatformName)\bin\</HexChatBin>
|
||||
@@ -51,7 +51,6 @@ copy "$(HexChatBin)hexchat-text.exe" "$(HexChatRel)"
|
||||
copy "$(HexChatBin)thememan.exe" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\atk-1.0.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\cairo.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\fontconfig.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\gdk_pixbuf-2.0.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\gdk-win32-2.0.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\gio-2.0.dll" "$(HexChatRel)"
|
||||
@@ -66,10 +65,8 @@ copy "$(DepsRoot)\bin\libeay32.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\libenchant.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\libintl.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\libpng16.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\libxml2.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\pango-1.0.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\pangocairo-1.0.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\pangoft2-1.0.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\pangowin32-1.0.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\pixman-1.dll" "$(HexChatRel)"
|
||||
copy "$(DepsRoot)\bin\ssleay32.dll" "$(HexChatRel)"
|
||||
|
||||
@@ -117,7 +117,6 @@ Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion cr
|
||||
|
||||
Source: "atk-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "cairo.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "fontconfig.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "gdk_pixbuf-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "gdk-win32-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "gio-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
@@ -132,10 +131,8 @@ Source: "libeay32.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "libenchant.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "libintl.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "libxml2.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "pango-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "pangocairo-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "pangoft2-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "pangowin32-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "pixman-1.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
Source: "ssleay32.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
||||
|
||||
Reference in New Issue
Block a user