From 706f9bca82d463f6f1bd17d5dc609807e4a1e8a9 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sat, 2 Sep 2017 17:52:25 -0400 Subject: python: Rewrite with CFFI --- src/common/meson.build | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/common') diff --git a/src/common/meson.build b/src/common/meson.build index a0d6ce2b..09c10daf 100644 --- a/src/common/meson.build +++ b/src/common/meson.build @@ -93,10 +93,6 @@ endif if get_option('with-plugin') common_deps += libgmodule_dep - common_cflags += '-DHEXCHATLIBDIR="@0@"'.format(join_paths(get_option('prefix'), - get_option('libdir'), - 'hexchat/plugins')) - install_headers('hexchat-plugin.h') endif -- cgit 1.4.1 From 804f959a1d0c9bfe88166a7541af4371460b468b Mon Sep 17 00:00:00 2001 From: linuxdaemon Date: Wed, 30 Jan 2019 18:46:13 -0600 Subject: Remove : from various trailing parameters (#2301) Partial fix for #2271 This isn't an exhaustive list, but it's everything I could find. The bug still exists in the parser though, this is just a workaround for the moment --- src/common/modes.c | 4 +++- src/common/proto-irc.c | 8 ++++---- src/common/proto-irc.h | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/common') diff --git a/src/common/modes.c b/src/common/modes.c index c65bf279..3c0ac8ab 100644 --- a/src/common/modes.c +++ b/src/common/modes.c @@ -735,6 +735,8 @@ handle_mode (server * serv, char *word[], char *word_eol[], if (!(*word[i + offset])) break; num_args++; + if (word[i + offset][0] == ':') + break; } /* count the number of modes (without the -/+ chars */ @@ -765,7 +767,7 @@ handle_mode (server * serv, char *word[], char *word_eol[], if ((all_modes_have_args || mode_has_arg (serv, sign, *modes)) && arg < (num_args + 1)) { arg++; - argstr = word[arg + offset]; + argstr = STRIP_COLON(word, word_eol, arg+offset); } handle_single_mode (&mr, sign, *modes, nick, chan, argstr, numeric_324 || prefs.hex_irc_raw_modes, diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index 776d1434..497cb6ca 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -714,7 +714,7 @@ process_numeric (session * sess, int n, break; case 333: - inbound_topictime (serv, word[4], word[5], atol (word[6]), tags_data); + inbound_topictime (serv, word[4], word[5], atol (STRIP_COLON(word, word_eol, 6)), tags_data); break; #if 0 @@ -726,7 +726,7 @@ process_numeric (session * sess, int n, #endif case 341: /* INVITE ACK */ - EMIT_SIGNAL_TIMESTAMP (XP_TE_UINVITE, sess, word[4], word[5], + EMIT_SIGNAL_TIMESTAMP (XP_TE_UINVITE, sess, word[4], STRIP_COLON(word, word_eol, 5), serv->servername, NULL, 0, tags_data->timestamp); break; @@ -1142,7 +1142,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], { case WORDL('A','C','C','O'): - inbound_account (serv, nick, word[3], tags_data); + inbound_account (serv, nick, STRIP_COLON(word, word_eol, 3), tags_data); return; case WORDL('A', 'U', 'T', 'H'): @@ -1150,7 +1150,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], return; case WORDL('C', 'H', 'G', 'H'): - inbound_user_info (sess, NULL, word[3], word[4], NULL, nick, NULL, + inbound_user_info (sess, NULL, word[3], STRIP_COLON(word, word_eol, 4), NULL, nick, NULL, NULL, 0xff, tags_data); return; diff --git a/src/common/proto-irc.h b/src/common/proto-irc.h index a7b4029c..6c075795 100644 --- a/src/common/proto-irc.h +++ b/src/common/proto-irc.h @@ -28,6 +28,8 @@ (time_t)0, /* timestamp */ \ } +#define STRIP_COLON(word, word_eol, idx) (word)[(idx)][0] == ':' ? (word_eol)[(idx)]+1 : (word)[(idx)] + /* Message tag information that might be passed along with a server message * * See http://ircv3.atheme.org/specification/capability-negotiation-3.1 -- cgit 1.4.1 From ba72cc7b6dad98daddd0bf5b9adc220983760234 Mon Sep 17 00:00:00 2001 From: Jared Shields Date: Sun, 21 Apr 2019 08:33:24 -0700 Subject: Update servlist.c Update servlist.c --- src/common/servlist.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/common') diff --git a/src/common/servlist.c b/src/common/servlist.c index 449f982b..641bf494 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -166,9 +166,6 @@ static const struct defaultserver def[] = /* irc. points to chat. but many users and urls still reference it */ {0, "irc.freenode.net"}, - {"Furnet", 0, 0, 0, 0, 0, TRUE}, - {0, "irc.furnet.org"}, - {"GalaxyNet", 0}, {0, "irc.galaxynet.org"}, -- cgit 1.4.1 From 87470f30a9644bc58a5a50705ba2bb5f857b93ac Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 22 Nov 2018 02:19:52 +0100 Subject: servlist: add hackint irc network - requires the use of TLS to connect on port 6697 - supports and encourages authentication via SASL PLAIN and EXTERNAL --- src/common/servlist.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common') diff --git a/src/common/servlist.c b/src/common/servlist.c index 641bf494..e1088a53 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -193,6 +193,11 @@ static const struct defaultserver def[] = #endif {0, "irc.globalgamers.net"}, +#ifdef USE_OPENSSL + {"hackint", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "irc.hackint.org"}, +#endif + {"Hashmark", 0}, {0, "irc.hashmark.net"}, -- cgit 1.4.1 From ed1d5061a46a62401285e43894cb96989b2cbc60 Mon Sep 17 00:00:00 2001 From: Stepan Broz Date: Tue, 21 May 2019 16:02:30 +0200 Subject: Make dcc_ip being a per-server value. Moved dcc_ip from prefs to sess->server. --- src/common/dcc.c | 8 ++++---- src/common/dcc.h | 2 +- src/common/hexchat.h | 5 ++++- src/common/inbound.c | 2 +- src/common/outbound.c | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src/common') diff --git a/src/common/dcc.c b/src/common/dcc.c index 51f6d661..df129e68 100644 --- a/src/common/dcc.c +++ b/src/common/dcc.c @@ -1618,13 +1618,13 @@ dcc_accept (GIOChannel *source, GIOCondition condition, struct DCC *dcc) } guint32 -dcc_get_my_address (void) /* the address we'll tell the other person */ +dcc_get_my_address (session *sess) /* the address we'll tell the other person */ { struct hostent *dns_query; guint32 addr = 0; - if (prefs.hex_dcc_ip_from_server && prefs.dcc_ip) - addr = prefs.dcc_ip; + if (prefs.hex_dcc_ip_from_server && sess->server->dcc_ip) + addr = sess->server->dcc_ip; else if (prefs.hex_dcc_ip[0]) { dns_query = gethostbyname ((const char *) prefs.hex_dcc_ip); @@ -1710,7 +1710,7 @@ dcc_listen_init (struct DCC *dcc, session *sess) /*if we have a dcc_ip, we use that, so the remote client can connect*/ /*else we try to take an address from hex_dcc_ip*/ /*if something goes wrong we tell the client to connect to our LAN ip*/ - dcc->addr = dcc_get_my_address (); + dcc->addr = dcc_get_my_address (sess); /*if nothing else worked we use the address we bound to*/ if (dcc->addr == 0) diff --git a/src/common/dcc.h b/src/common/dcc.h index 379385e6..74028205 100644 --- a/src/common/dcc.h +++ b/src/common/dcc.h @@ -124,7 +124,7 @@ void dcc_chat (session *sess, char *nick, int passive); void handle_dcc (session *sess, char *nick, char *word[], char *word_eol[], const message_tags_data *tags_data); void dcc_show_list (session *sess); -guint32 dcc_get_my_address (void); +guint32 dcc_get_my_address (session *sess); void dcc_get_with_destfile (struct DCC *dcc, char *utf8file); #endif diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 8c4a6a41..0fd98598 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -313,7 +313,6 @@ struct hexchatprefs /* these are the private variables */ guint32 local_ip; - guint32 dcc_ip; unsigned int wait_on_exit; /* wait for logs to be flushed to disk IF we're connected */ @@ -482,6 +481,10 @@ typedef struct server int proxy_sok4; int proxy_sok6; int id; /* unique ID number (for plugin API) */ + + /* dcc_ip moved from haxchatprefs to make it per-server */ + guint32 dcc_ip; + #ifdef USE_OPENSSL SSL_CTX *ctx; SSL *ssl; diff --git a/src/common/inbound.c b/src/common/inbound.c index fb8eb511..9c77b231 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1420,7 +1420,7 @@ inbound_foundip (session *sess, char *ip, const message_tags_data *tags_data) HostAddr = gethostbyname (ip); if (HostAddr) { - prefs.dcc_ip = ((struct in_addr *) HostAddr->h_addr)->s_addr; + sess->server->dcc_ip = ((struct in_addr *) HostAddr->h_addr)->s_addr; EMIT_SIGNAL_TIMESTAMP (XP_TE_FOUNDIP, sess->server->server_session, inet_ntoa (*((struct in_addr *) HostAddr->h_addr)), NULL, NULL, NULL, 0, tags_data->timestamp); diff --git a/src/common/outbound.c b/src/common/outbound.c index 96fb7fe4..614aad38 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -3287,7 +3287,7 @@ cmd_send (struct session *sess, char *tbuf, char *word[], char *word_eol[]) if (!word[2][0]) return FALSE; - addr = dcc_get_my_address (); + addr = dcc_get_my_address (sess); if (addr == 0) { /* use the one from our connected server socket */ -- cgit 1.4.1 From 8bb768ef93daf14a4d8637484f39da14ce00d9e8 Mon Sep 17 00:00:00 2001 From: Stepan Broz Date: Wed, 22 May 2019 13:54:54 +0200 Subject: Fix a typo-error in src/common/hexchat.h:485 "haxchatprefs" -> "hexchatprefs" --- src/common/hexchat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 0fd98598..16f10ded 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -482,7 +482,7 @@ typedef struct server int proxy_sok6; int id; /* unique ID number (for plugin API) */ - /* dcc_ip moved from haxchatprefs to make it per-server */ + /* dcc_ip moved from hexchatprefs to make it per-server */ guint32 dcc_ip; #ifdef USE_OPENSSL -- cgit 1.4.1 From 92014628d1cc06334a9ca8c91a7184d50f5ab9a0 Mon Sep 17 00:00:00 2001 From: nia Date: Wed, 17 Jul 2019 11:55:07 +0100 Subject: build: Make generated headers a dependency for users of common. --- src/common/meson.build | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/meson.build b/src/common/meson.build index 09c10daf..492227b2 100644 --- a/src/common/meson.build +++ b/src/common/meson.build @@ -105,6 +105,7 @@ hexchat_common = static_library('hexchatcommon', ) hexchat_common_dep = declare_dependency( + sources: [textevents] + marshal, link_with: hexchat_common, include_directories: common_includes, compile_args: common_cflags, -- cgit 1.4.1 From 7d9f3acfc905ca5d0c9747699eb21d2d95fbf821 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sun, 24 Nov 2019 13:01:48 -0800 Subject: Fix capability negotiation ending before sasl finishes with multi-line cap Closes #2398 --- src/common/hexchat.h | 1 + src/common/inbound.c | 21 ++++++++++++++++----- src/common/inbound.h | 2 +- src/common/proto-irc.c | 3 ++- 4 files changed, 20 insertions(+), 7 deletions(-) (limited to 'src/common') diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 16f10ded..c64e44a0 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -578,6 +578,7 @@ typedef struct server unsigned int sasl_mech; /* mechanism for sasl auth */ unsigned int sent_capend:1; /* have sent CAP END yet */ unsigned int waiting_on_cap:1; /* waiting on another line of CAP LS */ + unsigned int waiting_on_sasl:1; /* waiting on sasl */ #ifdef USE_OPENSSL unsigned int use_ssl:1; /* is server SSL capable? */ unsigned int accept_invalid_cert:1;/* ignore result of server's cert. verify */ diff --git a/src/common/inbound.c b/src/common/inbound.c index 9c77b231..eb7054f2 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1768,7 +1768,6 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str, { char buffer[500]; /* buffer for requesting capabilities and emitting the signal */ gboolean want_cap = FALSE; /* format the CAP REQ string based on previous capabilities being requested or not */ - gboolean want_sasl = FALSE; /* CAP END shouldn't be sent when SASL is requested, it needs further responses */ char **extensions; int i; @@ -1816,7 +1815,7 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str, serv->sasl_mech = sasl_mech; } want_cap = TRUE; - want_sasl = TRUE; + serv->waiting_on_sasl = TRUE; g_strlcat (buffer, "sasl ", sizeof(buffer)); continue; } @@ -1842,7 +1841,7 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str, tags_data->timestamp); tcp_sendf (serv, "%s\r\n", g_strchomp (buffer)); } - if (!want_sasl && !serv->waiting_on_cap) + if (!serv->waiting_on_sasl && !serv->waiting_on_cap) { /* if we use SASL, CAP END is dealt via raw numerics */ serv->sent_capend = TRUE; @@ -1851,13 +1850,25 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str, } void -inbound_cap_nak (server *serv, const message_tags_data *tags_data) +inbound_cap_nak (server *serv, char *extensions_str, const message_tags_data *tags_data) { - if (!serv->waiting_on_cap && !serv->sent_capend) + char **extensions; + int i; + + extensions = g_strsplit (extensions_str, " ", 0); + for (i=0; extensions[i]; i++) + { + if (!g_strcmp0 (extensions[i], "sasl")) + serv->waiting_on_sasl = FALSE; + } + + if (!serv->waiting_on_cap && !serv->waiting_on_sasl && !serv->sent_capend) { serv->sent_capend = TRUE; tcp_send_len (serv, "CAP END\r\n", 9); } + + g_strfreev (extensions); } void diff --git a/src/common/inbound.h b/src/common/inbound.h index 83e78d5d..6e7c171f 100644 --- a/src/common/inbound.h +++ b/src/common/inbound.h @@ -92,7 +92,7 @@ void inbound_cap_ack (server *serv, char *nick, char *extensions, const message_tags_data *tags_data); void inbound_cap_ls (server *serv, char *nick, char *extensions, const message_tags_data *tags_data); -void inbound_cap_nak (server *serv, const message_tags_data *tags_data); +void inbound_cap_nak (server *serv, char *extensions, const message_tags_data *tags_data); void inbound_cap_list (server *serv, char *nick, char *extensions, const message_tags_data *tags_data); void inbound_cap_del (server *serv, char *nick, char *extensions, diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index 497cb6ca..59a60a8f 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -957,6 +957,7 @@ process_numeric (session * sess, int n, EMIT_SIGNAL_TIMESTAMP (XP_TE_SASLRESPONSE, serv->server_session, word[1], word[2], word[3], ++word_eol[4], 0, tags_data->timestamp); + serv->waiting_on_sasl = FALSE; if (!serv->sent_capend) { serv->sent_capend = TRUE; @@ -1330,7 +1331,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], } else if (strncasecmp (word[4], "NAK", 3) == 0) { - inbound_cap_nak (serv, tags_data); + inbound_cap_nak (serv, word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5], tags_data); } else if (strncasecmp (word[4], "LIST", 4) == 0) { -- cgit 1.4.1 From 202393a77c4f73234949e000001ac1a346695121 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Fri, 20 Dec 2019 22:18:51 -0800 Subject: Follow more modern conventions for USER message Closes #2399 --- src/common/proto-irc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index 59a60a8f..dcb4e8cd 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -60,8 +60,8 @@ irc_login (server *serv, char *user, char *realname) tcp_sendf (serv, "NICK %s\r\n" - "USER %s %s %s :%s\r\n", - serv->nick, user, user, serv->servername, realname); + "USER %s 0 * :%s\r\n", + serv->nick, user, realname); } static void -- cgit 1.4.1 From 9c44d7baf400e2addebfb5343c99cf753cebf7eb Mon Sep 17 00:00:00 2001 From: James Clarke Date: Wed, 1 Jan 2020 20:37:39 +0000 Subject: Avoid prioritising MODE queries for channels with hyphens in their name If a user has a large number of channels containing hyphens in their names, the initial MODE queries will have the same high priority as any PINGs, and so will block the PINGs from being sent, causing the connection to time out due to a lack of PONGs received. --- src/common/server.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'src/common') diff --git a/src/common/server.c b/src/common/server.c index 3db0a963..f7fa8b96 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -200,13 +200,35 @@ tcp_send_len (server *serv, char *buf, int len) } else { - /* WHO/MODE get the lowest priority */ - if (g_ascii_strncasecmp (dbuf + 1, "WHO ", 4) == 0 || - /* but only MODE queries, not changes */ - (g_ascii_strncasecmp (dbuf + 1, "MODE", 4) == 0 && - strchr (dbuf, '-') == NULL && - strchr (dbuf, '+') == NULL)) + /* WHO gets the lowest priority */ + if (g_ascii_strncasecmp (dbuf + 1, "WHO ", 4) == 0) dbuf[0] = 0; + /* as do MODE queries (but not changes) */ + else if (g_ascii_strncasecmp (dbuf + 1, "MODE ", 5) == 0) + { + char *mode_str, *mode_str_end, *loc; + /* skip spaces before channel/nickname */ + for (mode_str = dbuf + 5; *mode_str == ' '; ++mode_str); + /* skip over channel/nickname */ + mode_str = strchr (mode_str, ' '); + if (mode_str) + { + /* skip spaces before mode string */ + for (; *mode_str == ' '; ++mode_str); + /* find spaces after end of mode string */ + mode_str_end = strchr (mode_str, ' '); + /* look for +/- within the mode string */ + loc = strchr (mode_str, '-'); + if (loc && (!mode_str_end || loc < mode_str_end)) + goto keep_priority; + loc = strchr (mode_str, '+'); + if (loc && (!mode_str_end || loc < mode_str_end)) + goto keep_priority; + } + dbuf[0] = 0; +keep_priority: + ; + } } serv->outbound_queue = g_slist_append (serv->outbound_queue, dbuf); -- cgit 1.4.1 From 37192a913603c11ac652fa8fc3a74dc281542e4d Mon Sep 17 00:00:00 2001 From: kelek- Date: Sat, 22 Apr 2017 19:46:04 +0200 Subject: Updated the maximum length of the socks5 user and password to comply to RFC 1929, where both the password and the username length is definied as a maximum of 255 --- src/common/hexchat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/hexchat.h b/src/common/hexchat.h index c64e44a0..a9e22372 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -301,8 +301,8 @@ struct hexchatprefs char hex_irc_user_name[127]; char hex_net_bind_host[127]; char hex_net_proxy_host[64]; - char hex_net_proxy_pass[32]; - char hex_net_proxy_user[32]; + char hex_net_proxy_pass[256]; + char hex_net_proxy_user[256]; char hex_stamp_log_format[64]; char hex_stamp_text_format[64]; char hex_text_background[PATHLEN + 1]; -- cgit 1.4.1 From 7b950eb0218a19620b9b885818ac031d29ecab09 Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sat, 11 Apr 2020 13:01:35 +0300 Subject: Fixed proxy user/password buffer overflow By using a dedicated buffer for sending the username and password for the SOCKS5 proxy, there will be no overflow when copying them to the buffer. And therefore, RFC 1929 is fully supported. --- src/common/server.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/common') diff --git a/src/common/server.c b/src/common/server.c index f7fa8b96..c6fa1ced 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -1116,6 +1116,7 @@ traverse_socks5 (int print_fd, int sok, char *serverAddr, int port) if (auth) { int len_u=0, len_p=0; + unsigned char *u_p_buf; /* authentication sub-negotiation (RFC1929) */ if (buf[1] != 2) /* UPA not supported by server */ @@ -1124,18 +1125,22 @@ traverse_socks5 (int print_fd, int sok, char *serverAddr, int port) return 1; } - memset (buf, 0, sizeof(buf)); - /* form the UPA request */ len_u = strlen (prefs.hex_net_proxy_user); len_p = strlen (prefs.hex_net_proxy_pass); - buf[0] = 1; - buf[1] = len_u; - memcpy (buf + 2, prefs.hex_net_proxy_user, len_u); - buf[2 + len_u] = len_p; - memcpy (buf + 3 + len_u, prefs.hex_net_proxy_pass, len_p); - send (sok, buf, 3 + len_u + len_p, 0); + packetlen = 2 + len_u + 1 + len_p; + u_p_buf = g_malloc0 (packetlen); + + u_p_buf[0] = 1; + u_p_buf[1] = len_u; + memcpy (u_p_buf + 2, prefs.hex_net_proxy_user, len_u); + u_p_buf[2 + len_u] = len_p; + memcpy (u_p_buf + 3 + len_u, prefs.hex_net_proxy_pass, len_p); + + send (sok, u_p_buf, packetlen, 0); + g_free(u_p_buf); + if ( recv (sok, buf, 2, 0) != 2 ) goto read_error; if ( buf[1] != 0 ) -- cgit 1.4.1 From 082f2f8cebde50fa7e02763e6f0f6c07fbd0dbe3 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 18 Apr 2020 12:54:45 +0200 Subject: Remove Moznet Mozilla's Moznet no longer exists. They migrated to Matrix. --- src/common/servlist.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/common') diff --git a/src/common/servlist.c b/src/common/servlist.c index e1088a53..8b718a92 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -248,9 +248,6 @@ static const struct defaultserver def[] = {"MIXXnet", 0}, {0, "irc.mixxnet.net"}, - {"Moznet", 0, 0, 0, 0, 0, TRUE}, - {0, "irc.mozilla.org"}, - {"ObsidianIRC", 0}, /* Self signed */ {0, "irc.obsidianirc.net"}, -- cgit 1.4.1 From 82a424fc8a0377ec0d0981f5e6f9d23233a1aba3 Mon Sep 17 00:00:00 2001 From: delthas Date: Sun, 19 Apr 2020 20:31:38 +0200 Subject: win32: Fix undefined symbol for builds with -with-plugin=false Windows builds without plugins can use notification-windows.c, which uses module_load in its notification_backend_init function. module_load was previously guarded with a USE_PLUGIN ifdef, but we do need this function for Windows builds even if plugins are disabled. This fixes a critical build issue for all Windows builds without plugins. --- src/common/plugin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/plugin.c b/src/common/plugin.c index 1db11f35..6b2ffd0c 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -355,7 +355,8 @@ plugin_kill_all (void) } } -#ifdef USE_PLUGIN +#if defined(USE_PLUGIN) || defined(WIN32) +/* used for loading plugins, and in fe-gtk/notifications/notification-windows.c */ GModule * module_load (char *filename) @@ -384,6 +385,10 @@ module_load (char *filename) return handle; } +#endif + +#ifdef USE_PLUGIN + /* load a plugin from a filename. Returns: NULL-success or an error string */ char * -- cgit 1.4.1 From f9adf88eca7698d19e83c8b525828efe661ac733 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 14 May 2020 23:15:14 -0700 Subject: Remove 2ch from network list It split into multiple networks; Both are very small and can't even match our modern guidelines like supporting TLS. I'll just use this as an opportunity to clean up the list a bit. Closes #2465 --- src/common/servlist.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/common') diff --git a/src/common/servlist.c b/src/common/servlist.c index 8b718a92..f4921a07 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -54,11 +54,6 @@ static const struct defaultserver def[] = /* Invalid hostname in cert */ {0, "irc.2600.net"}, - {"2ch", 0, 0, "iso-2022-jp", 0, 0}, - {0, "irc.2ch.sc"}, - {0, "irc.nurs.or.jp"}, - {0, "irc.juggler.jp"}, - {"AccessIRC", 0}, /* Self signed */ {0, "irc.accessirc.net"}, -- cgit 1.4.1 From 53952feddd026ba62f517a50be36040d16828166 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Tue, 26 May 2020 16:49:33 -0700 Subject: Fix parsing of 313 Closes #2472 --- src/common/proto-irc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index dcb4e8cd..69501ee3 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -621,7 +621,7 @@ process_numeric (session * sess, int n, case 319: if (!serv->skip_next_whois) EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS2, whois_sess, word[4], - word_eol[5] + 1, NULL, NULL, 0, + word_eol[5][0] == ':' ? word_eol[5] + 1 : word_eol[5], NULL, NULL, 0, tags_data->timestamp); break; -- cgit 1.4.1 From 2f376953f3fd7d358aa25bf29c01d70a57d40e0c Mon Sep 17 00:00:00 2001 From: Jan Harasym Date: Mon, 1 Jun 2020 02:59:06 +0200 Subject: Add "DarkScience" to default server list. (#2474) --- src/common/servlist.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/common') diff --git a/src/common/servlist.c b/src/common/servlist.c index f4921a07..e44a3f2d 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -120,6 +120,13 @@ static const struct defaultserver def[] = {"DarkMyst", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {0, "irc.darkmyst.org"}, +#ifdef USE_OPENSSL + {"darkscience", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "irc.darkscience.net"}, + {0, "irc.drk.sc"}, + {0, "irc.darkscience.ws"}, +#endif + {"Dark-Tou-Net", 0}, {0, "irc.d-t-net.de"}, -- cgit 1.4.1 From aec72593f265b09bc53291d00300490a5d0d9911 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 21 Jul 2020 14:59:42 +0000 Subject: SASL EXTERNAL doesn't necessitate a certificate --- src/common/inbound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/inbound.c b/src/common/inbound.c index eb7054f2..7ac3c71a 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1805,7 +1805,7 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str, /* if the SASL password is set AND auth mode is set to SASL, request SASL auth */ if (!g_strcmp0 (extension, "sasl") && ((serv->loginmethod == LOGIN_SASL && strlen (serv->password) != 0) - || (serv->loginmethod == LOGIN_SASLEXTERNAL && serv->have_cert))) + || serv->loginmethod == LOGIN_SASLEXTERNAL)) { if (value) { -- cgit 1.4.1 From 453cb7ca79ace05f53667e523dc534bdeb7ddee0 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Thu, 17 Sep 2020 15:50:28 -0700 Subject: Increase max number of words a line can be split into This may have unintended side-effects but 32 is a very low value and I was seeing real world bugs being caused by this. Specifically an ISUPPORT line with more features than this could store. --- plugins/lua/lua.c | 14 ++++++++------ plugins/perl/perl.c | 4 +++- src/common/hexchat.h | 2 +- src/common/plugin.c | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'src/common') diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c index 941342bb..8d6b730e 100644 --- a/plugins/lua/lua.c +++ b/plugins/lua/lua.c @@ -35,6 +35,8 @@ #include +#define WORD_ARRAY_LEN 48 + static char plugin_name[] = "Lua"; static char plugin_description[] = "Lua scripting interface"; static char plugin_version[16] = "1.3"; @@ -275,13 +277,13 @@ static int api_command_closure(char *word[], char *word_eol[], void *udata) base = lua_gettop(L); lua_rawgeti(L, LUA_REGISTRYINDEX, info->ref); lua_newtable(L); - for(i = 1; i < 32 && *word_eol[i]; i++) + for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++) { lua_pushstring(L, word[i]); lua_rawseti(L, -2, i); } lua_newtable(L); - for(i = 1; i < 32 && *word_eol[i]; i++) + for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++) { lua_pushstring(L, word_eol[i]); lua_rawseti(L, -2, i); @@ -462,13 +464,13 @@ static int api_server_closure(char *word[], char *word_eol[], void *udata) base = lua_gettop(L); lua_rawgeti(L, LUA_REGISTRYINDEX, info->ref); lua_newtable(L); - for(i = 1; i < 32 && *word_eol[i]; i++) + for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++) { lua_pushstring(L, word[i]); lua_rawseti(L, -2, i); } lua_newtable(L); - for(i = 1; i < 32 && *word_eol[i]; i++) + for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++) { lua_pushstring(L, word_eol[i]); lua_rawseti(L, -2, i); @@ -521,13 +523,13 @@ static int api_server_attrs_closure(char *word[], char *word_eol[], hexchat_even base = lua_gettop(L); lua_rawgeti(L, LUA_REGISTRYINDEX, info->ref); lua_newtable(L); - for(i = 1; i < 32 && *word_eol[i]; i++) + for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++) { lua_pushstring(L, word[i]); lua_rawseti(L, -2, i); } lua_newtable(L); - for(i = 1; i < 32 && *word_eol[i]; i++) + for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++) { lua_pushstring(L, word_eol[i]); lua_rawseti(L, -2, i); diff --git a/plugins/perl/perl.c b/plugins/perl/perl.c index ab06dc96..cb563b38 100644 --- a/plugins/perl/perl.c +++ b/plugins/perl/perl.c @@ -283,6 +283,8 @@ list_item_to_sv ( hexchat_list *list, const char *const *fields ) return sv_2mortal (newRV_noinc ((SV *) hash)); } +#define WORD_ARRAY_LEN 48 + static AV * array2av (char *array[]) { @@ -293,7 +295,7 @@ array2av (char *array[]) for ( count = 1; - count < 32 && array[count] != NULL && array[count][0] != 0; + count < WORD_ARRAY_LEN && array[count] != NULL && array[count][0] != 0; count++ ) { temp = newSVpv (array[count], 0); diff --git a/src/common/hexchat.h b/src/common/hexchat.h index a9e22372..73430f0f 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -75,7 +75,7 @@ #define DOMAINLEN 100 #define NICKLEN 64 /* including the NULL, so 63 really */ #define CHANLEN 300 -#define PDIWORDS 32 +#define PDIWORDS 48 #define USERNAMELEN 10 #define HIDDEN_CHAR 8 /* invisible character for xtext */ diff --git a/src/common/plugin.c b/src/common/plugin.c index 6b2ffd0c..5c09e921 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -662,11 +662,11 @@ plugin_emit_print (session *sess, char *word[], time_t server_time) int plugin_emit_dummy_print (session *sess, char *name) { - char *word[32]; + char *word[PDIWORDS]; int i; word[0] = name; - for (i = 1; i < 32; i++) + for (i = 1; i < PDIWORDS; i++) word[i] = "\000"; return plugin_hook_run (sess, name, word, NULL, NULL, HOOK_PRINT); -- cgit 1.4.1 From 7a275812c0002fe10db5c60e29a34ba6ce4cede1 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Mon, 21 Sep 2020 11:22:50 -0700 Subject: Revert word array length change It turns out that the rfc sets a limit of 15 arguments and the server (irccloud) sending that many in ISUPPORT was updated to split it into multiple lines. --- plugins/lua/lua.c | 2 +- plugins/perl/perl.c | 2 +- src/common/hexchat.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common') diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c index 8d6b730e..d73fbb23 100644 --- a/plugins/lua/lua.c +++ b/plugins/lua/lua.c @@ -35,7 +35,7 @@ #include -#define WORD_ARRAY_LEN 48 +#define WORD_ARRAY_LEN 32 static char plugin_name[] = "Lua"; static char plugin_description[] = "Lua scripting interface"; diff --git a/plugins/perl/perl.c b/plugins/perl/perl.c index cb563b38..6f30400c 100644 --- a/plugins/perl/perl.c +++ b/plugins/perl/perl.c @@ -283,7 +283,7 @@ list_item_to_sv ( hexchat_list *list, const char *const *fields ) return sv_2mortal (newRV_noinc ((SV *) hash)); } -#define WORD_ARRAY_LEN 48 +#define WORD_ARRAY_LEN 32 static AV * array2av (char *array[]) diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 73430f0f..f7cacfcc 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -75,7 +75,7 @@ #define DOMAINLEN 100 #define NICKLEN 64 /* including the NULL, so 63 really */ #define CHANLEN 300 -#define PDIWORDS 48 +#define PDIWORDS 32 #define USERNAMELEN 10 #define HIDDEN_CHAR 8 /* invisible character for xtext */ -- cgit 1.4.1 From 964ae72fa8c770ae45c995fbdc38cae4c7ece5a3 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Wed, 3 Mar 2021 15:39:02 -0600 Subject: Better handle various ctime() calls failing --- src/common/inbound.c | 6 ++++-- src/common/proto-irc.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/inbound.c b/src/common/inbound.c index 7ac3c71a..71c60357 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -815,7 +815,9 @@ inbound_topictime (server *serv, char *chan, char *nick, time_t stamp, if (!sess) sess = serv->server_session; - tim[24] = 0; /* get rid of the \n */ + if (tim != NULL) + tim[24] = 0; /* get rid of the \n */ + EMIT_SIGNAL_TIMESTAMP (XP_TE_TOPICDATE, sess, chan, nick, tim, NULL, 0, tags_data->timestamp); } @@ -1489,7 +1491,7 @@ inbound_banlist (session *sess, time_t stamp, char *chan, char *mask, server *serv = sess->server; char *nl; - if (stamp <= 0) + if (stamp <= 0 || time_str == NULL) { time_str = ""; } diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index 69501ee3..fa2d822b 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -454,7 +454,8 @@ channel_date (session *sess, char *chan, char *timestr, { time_t timestamp = (time_t) atol (timestr); char *tim = ctime (×tamp); - tim[24] = 0; /* get rid of the \n */ + if (tim != NULL) + tim[24] = 0; /* get rid of the \n */ EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDATE, sess, chan, tim, NULL, NULL, 0, tags_data->timestamp); } @@ -602,7 +603,8 @@ process_numeric (session * sess, int n, else { tim = ctime (×tamp); - tim[19] = 0; /* get rid of the \n */ + if (tim != NULL) + tim[19] = 0; /* get rid of the \n */ EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS4T, whois_sess, word[4], outbuf, tim, NULL, 0, tags_data->timestamp); } -- cgit 1.4.1 From cc049161378988fdb468cab1a9c00dc28b835b1f Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Mon, 1 Mar 2021 21:55:08 +1100 Subject: url.c: add gemini & gopher parsing --- src/common/url.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common') diff --git a/src/common/url.c b/src/common/url.c index a741fb04..6a1d09e8 100644 --- a/src/common/url.c +++ b/src/common/url.c @@ -518,6 +518,8 @@ struct { "pop", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH }, { "nfs", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH }, { "smb", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH }, + { "gopher", "/", URI_AUTHORITY | URI_PATH }, + { "gemini", "/", URI_AUTHORITY | URI_PATH }, { "ssh", "", URI_AUTHORITY | URI_OPT_USERINFO }, { "sip", "", URI_AUTHORITY | URI_USERINFO }, { "sips", "", URI_AUTHORITY | URI_USERINFO }, -- cgit 1.4.1 From a25f2381689d2c2279a0e43b33f6c0ec8305a096 Mon Sep 17 00:00:00 2001 From: Panagiotis Vasilopoulos Date: Wed, 19 May 2021 16:25:16 +0300 Subject: Add Libera Chat to network list --- src/common/servlist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/common') diff --git a/src/common/servlist.c b/src/common/servlist.c index e44a3f2d..33bd80f2 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -239,6 +239,9 @@ static const struct defaultserver def[] = /* Self signed */ {0, "irc.librairc.net"}, + {"Libera Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "irc.libera.chat"}, + #ifdef USE_OPENSSL {"LinkNet", 0}, {0, "irc.link-net.org/+7000"}, -- cgit 1.4.1 From 65edc9ad9a561e0d3aec9fde23b8c810272890d3 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 19 May 2021 21:18:58 -0400 Subject: add tilde.chat https://tilde.chat --- src/common/servlist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/common') diff --git a/src/common/servlist.c b/src/common/servlist.c index 33bd80f2..e0191a7b 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -344,6 +344,9 @@ static const struct defaultserver def[] = {"Techtronix", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {0, "irc.techtronix.net"}, + + {"tilde.chat", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "irc.tilde.chat"}, {"TURLINet", 0, 0, 0, 0, 0, TRUE}, /* Other servers use CP1251 and invalid certs */ -- cgit 1.4.1 From e4fd69e3d4ec2eb707a693ea69b8e14181249d0a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 23 May 2021 19:12:10 +0100 Subject: 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(-) (limited to 'src/common') 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) -- cgit 1.4.1 From c06f6f2565513089462ba2c627457e66ff637be9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 24 May 2021 01:32:00 +0100 Subject: 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(-) (limited to 'src/common') 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 -- cgit 1.4.1 From 939ec7a16e205e974cfe1a97c2ff4974e763c7fa Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sun, 12 Apr 2020 10:32:31 +0300 Subject: 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(-) (limited to 'src/common') 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 -- cgit 1.4.1 From c64dda4deae6edd676dfe4145adeb4fdf11be53a Mon Sep 17 00:00:00 2001 From: Miguel Date: Mon, 24 May 2021 02:42:07 +0100 Subject: Update ptnet servers (#2205) Co-authored-by: Elias --- src/common/servlist.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/common') 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"}, -- cgit 1.4.1 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: Add the official EU server to hackint network (#2495) --- src/common/servlist.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') 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}, -- cgit 1.4.1 From 37118a4d2b70c11a76c732346975c2745d3cc4c6 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 24 May 2021 02:53:28 +0100 Subject: 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(-) (limited to 'src/common') 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); */ } -- cgit 1.4.1 From ad20708766c2ab11fe6eb23042883d3802d02145 Mon Sep 17 00:00:00 2001 From: Filippo Cortigiani Date: Mon, 24 May 2021 04:12:20 +0200 Subject: Added SimosNap to server list (#2349) --- src/common/servlist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/common') 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"}, -- cgit 1.4.1 From d3545f37cd5f551ed8bc0ab7b20e5c8140adc0a6 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sun, 23 May 2021 21:15:43 -0500 Subject: Change default network to Libera.Chat --- src/common/servlist.c | 4 ++-- src/fe-gtk/joind.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common') 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"); } -- cgit 1.4.1 From 0a85d79dff820e97c5db1ad365f0360738875bdc Mon Sep 17 00:00:00 2001 From: cranberry Date: Mon, 24 May 2021 04:16:39 +0200 Subject: Adding LibertaCasa + TripSit to servlist.c (#2538) --- src/common/servlist.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/common') 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"}, -- cgit 1.4.1 From e03fab07ed77db699abbde01e2b872019df07b80 Mon Sep 17 00:00:00 2001 From: BakasuraRCE Date: Wed, 29 Jul 2020 09:47:05 -0500 Subject: 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(-) (limited to 'src/common') 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 */ -- cgit 1.4.1 From da26097aab554c44540c25f0741dc19f6e92cc41 Mon Sep 17 00:00:00 2001 From: BakasuraRCE Date: Wed, 29 Jul 2020 09:50:12 -0500 Subject: 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(-) (limited to 'src/common') 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; + } + + submenu = menu_quick_sub(_("_Extra Alerts"), menu, NULL, XCMENU_MNEMONIC, -1); + + 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, prefs.hex_input_tray_chans); + mg_perchan_menu_item(_("Blink Tray _Icon"), submenu, &sess->alert_tray, hex_tray); - mg_perchan_menu_item (_("Blink Task _Bar"), submenu, &sess->alert_taskbar, prefs.hex_input_flash_chans); + 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; + + 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 (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")); + 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; + + 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 (hexchat_get_prefs (ph, "input_balloon_priv", NULL, &priv) == 3 && priv && should_alert ()) + if (alert) { const char *network = hexchat_get_info (ph, "network"); if (!network) -- cgit 1.4.1 From 7121bb6e823dd6b5507fa892a501fda33104cb68 Mon Sep 17 00:00:00 2001 From: BakasuraRCE Date: Wed, 29 Jul 2020 09:52:50 -0500 Subject: plugin interface: :lipstick: --- src/common/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') 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; -- cgit 1.4.1 From 076b2c1c7332e82028811d92a7f7f4b091be0163 Mon Sep 17 00:00:00 2001 From: Andrew Rodland Date: Sun, 23 May 2021 22:19:28 -0400 Subject: 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(-) (limited to 'src/common') 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); -- cgit 1.4.1 From cdfc3b9ea93ac0f5eb3a2b16c80854931db3d881 Mon Sep 17 00:00:00 2001 From: Xandrah Date: Mon, 24 May 2021 04:46:00 +0100 Subject: 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(+) (limited to 'src/common') 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} }; -- cgit 1.4.1 From 7f8b0a19cff46f7d27451fb9942eea5018f0c5b5 Mon Sep 17 00:00:00 2001 From: dimitrisdm <30384086+dimitrisdm@users.noreply.github.com> Date: Mon, 24 May 2021 21:26:06 +0300 Subject: Add ACN IRC Network (#2524) Website: https://irc.acn.gr Round-Robin DNS: global.acn.gr Ports: 6667 - 6697(ssl only). --- src/common/servlist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/common') diff --git a/src/common/servlist.c b/src/common/servlist.c index d65582cd..79a5694b 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -58,6 +58,9 @@ static const struct defaultserver def[] = /* Self signed */ {0, "irc.accessirc.net"}, + {"ACN", 0, 0, 0, LOGIN_SASL, 0, TRUE}, + {0, "global.acn.gr"}, + {"AfterNET", 0, 0, 0, LOGIN_SASL, 0, TRUE}, {0, "irc.afternet.org"}, -- cgit 1.4.1