Commit Graph

1152 Commits

Author SHA1 Message Date
Patrick Griffis
4188f26ab9 Improve CTCP notice handling
Cutting off all text after \001 can result in users hiding text
so lets only bother handling it if it is a valid CTCP message
(starting and ending with \001).
2017-10-07 17:31:53 -04:00
Joseph Bisch
07f1fc60da Use g_utf8_make_valid if available for cleaner utf8 handling (#2065) 2017-10-02 15:11:42 -04:00
Joseph Bisch
0c494a9c24 Fix rfc_ncasecmp handling of n reaching 0
If n becomes 0 at the same time that the end of either s1 or s2 are
reached, the next iteration of the while loop wouldn't happen, so we
wouldn't correctly return 0.
2017-09-21 21:34:14 -04:00
Patrick Griffis
053003f490 Handle leading spaces when matching extra alerts
It is common for users to set "foo, bar" and the leading space
has caused issues in the past so lets just ignore that.
2017-09-19 20:26:28 -04:00
Joseph Bisch
4a09ce6fc3 Fix rfc_{n,}casecmp functions (#2058)
rfc_casecmp was broken because reaching terminator for str1 was used as
a terminal condition and str2 may be shorter than str1, resulting in an
oob read condition for str2.

rfc_ncasecmp was broken because it checked if n characters were checked
or if BOTH pointers reached their terminator, however the strings may
be different lengths and also less than n characters in length, meaning
that they don't both reach their terminators at the same time,
resulting in an oob read condition.
2017-09-19 14:31:48 -04:00
Joseph Bisch
f4a592c4f0 Fix oob read caused by ptr[0] being NULL in inbound_notice
If ptr[0] is NULL, then strchr may return a pointer to the NULL
terminator for serv->nick_prefixes, making the if statement true, which
then leads to the pointer increment leaving ptr oob. Now we check to
ensure ptr[0] != NULL.

From the Linux manpages for strchr:
The terminating null byte is considered part of the string, so that if c is
       specified as '\0', these functions return a pointer to the terminator.
2017-09-18 22:01:48 -04:00
Patrick Griffis
d99cd18fb9 Improve detection of system tray support
Closes #2045
2017-08-31 10:16:03 -04:00
torhus
281038e725 UI text consistency, capitalization etc. 2017-08-19 16:49:30 -04:00
torhus
da0635c960 Adjust use of ellipsis (...) in menus according to Gnome HIG (#2035)
* Adjust use of ellipses (...) in menus according to Gnome HIG

https://developer.gnome.org/hig/stable/writing-style.html.en
2017-08-18 15:59:31 -04:00
Mark Jansen
0dccd8d373 servlist: skip empty lines.
Fixes #1999
2017-07-16 17:26:33 -04:00
Patrick Griffis
ad359d7a04 Better handle channels with / in them with doat command
/doat #foo/bar/freenode would work for example.
2017-07-04 13:53:15 -04:00
Patrick Griffis
de157fcffd build: Fix building plugins in cygwin 2017-06-26 16:41:10 -04:00
Patrick Griffis
806a0da258 Fix skipping autoconnect when passed 1 URL 2017-06-22 13:19:43 -04:00
Patrick Griffis
2d184c0967 Fix crash on coloring NULL nicks
Fixes #2014
2017-06-18 06:31:34 -04:00
Patrick Griffis
ce91bebc39 Fix OpenSSL 1.1 deprecations 2017-06-15 00:26:43 -04:00
Patrick Griffis
628100c19f build: Replace Autotools with Meson
Quick rundown of benefits:

- Much faster:
  - Autotools (with autogen): 22 seconds
  - Meson: 7 seconds
  - Meson (with ccache): 2 seconds

- Simpler:
  - ~1000 lines smaller
  - Single simple language

- Potentially better Windows (Visual Studio) support

What is not done:

- Complete Windows support
- OSX support (easy)

Closes #2013
Closes #1937
Closes #1803
2017-06-13 23:54:51 -04:00
Patrick Griffis
2edf50d4dd Actually respect away_omit_alerts for custom sounds...
Probably should think before merging things.
2017-06-10 16:28:48 -04:00
YuGiOhJCJ
2dd5f8788c Disable custom sounds when away_omit_alerts enabled
Closes #2012
2017-06-10 16:18:55 -04:00
Shengyu Zhang
99bdc4f251 Fix email address pattern, it can starts with digit 2017-03-10 12:28:03 -05:00
Patrick Griffis
7d78c6bca0 Better handle mode numerics starting with :
These are still awful but until we have a real parser..

Fixes inspircd/inspircd#1295
2017-02-18 21:45:38 -05:00
Patrick Griffis
b1e963f563 servlist: Use SSL with OFTC by default
They now use Lets Encrypt which should be trusted.
2017-01-07 20:50:09 -05:00
Patrick Griffis
525a3bcc02 Increase default scrollback size to 5k
This is totally reasonable for a modern computer.
2017-01-05 17:58:06 -05:00
Florian Stinglmayr
d583ca7d92 Use AC_CHECK_FUNCS to find functions not in LibreSSL
LibreSSL might not have all functions of OpenSSL 1.1.0 so use
AC_CHECK_FUNCS to find them first before using them.

Closes #1899
Fixes #1898
2016-12-13 17:12:04 -05:00
Patrick Griffis
26acd02e9f Enable input_filter_beep by default
This just allows for spam.
2016-12-04 05:02:15 -05:00
Patrick Griffis
e7da3a052d Avoid mixed declaration 2016-12-04 04:44:10 -05:00
Patrick Griffis
b6426a1e9f Fix printing invalid utf8 from /exec output
This could possibly cause a crash.

On a related note exec_data() and exec_handle_colors() could probably
use a pass cleaning up to ensure they "do the right thing".
2016-12-04 04:39:06 -05:00
Mattia Rizzolo
f2d93f5abe properly clean the autogenerated org.hexchat.service.service 2016-12-01 18:20:48 -05:00
Patrick Griffis
3118df2042 Fix timers being incorrectly removed
Possibly fixing #1866
2016-11-30 00:52:48 -05:00
Mattia Rizzolo
c7849a8921 Fix typos s/Recieved/Received/ 2016-11-28 15:17:36 -05:00
Patrick Griffis
13f6d9265a Respect plugin hook changing tab color
Fixup to 241dd69b08
2016-11-11 20:02:24 -05:00
Patrick Griffis
241dd69b08 Further tab color improvements
- Combine the three properties into a single one
- Finally fully fix the handling with plugins handling events

TODO: Look into lastact handling of these, seems wrong
2016-11-11 19:27:57 -05:00
Patrick Griffis
539949973c More fixes for tab color handling with plugins
Part 2 of 03767ee0f9

So how the colors work should be pretty straight forward:

- A message comes in and is handled, this sets the state flags:
    nick_said, msg_said, new_data. These map to tab colors.
- This state is reset under one of these conditions:
  - It is commited to the UI when actually printed on unfocused tab
  - Event is interupted by a plugin hook
  - The tab focus is changed
2016-11-11 01:25:12 -05:00
Patrick Griffis
85bdb06cad Convert doat to an internal command
- Trivial plugin
- Useful for many users
- Was under a dumb license
2016-11-09 17:29:23 +01:00
Patrick Griffis
a0e80ebda2 Final fixup of OpenSSL 1.1.0 changes 2016-10-23 03:34:15 -04:00
Patrick Griffis
1186236ac1 ssl: Fix building with older OpenSSL too 2016-10-23 01:09:27 -04:00
Patrick Griffis
217fa9d0f9 ssl: More OpenSSL 1.1.0 fixes 2016-10-23 00:58:28 -04:00
Patrick Griffis
e7101ebcae Default net_ping_timeout to 60 2016-10-22 06:51:11 -04:00
d-browne
ebc40fe9c7 Added MHOP command 2016-10-11 09:58:56 -04:00
Patrick Griffis
2a81b98e7b Don't abort if translated text event fails
At least try the untranslated one...

Also while at it don't present a ton of dialogs to the user
about this failure, they wouldn't even know what to do with
that information.
2016-10-10 14:11:08 -04:00
gaffatape
492c209d07 Don't update usercount if doing nameslist 2016-10-08 14:55:58 -04:00
gaffatape
29b5785bb4 Update usercount in inbound_nameslist_end 2016-10-08 14:55:58 -04:00
Rainer Müller
c79ce843f4 build: Reorder includes to avoid installed plugin header
When hexchat is already installed into a non-default prefix, a new build
could pick up ${prefix}/include/hexchat-plugin.h from the installed
version instead of the local header, as configuration variables such as
$(GLIB_CFLAGS) would point to -I${prefix}/include.

Reordering the includes and moving -I arguments to CPPFLAGS prevents
this, as it ensures the local directories are always searched first.

This was no problem when compiling for /usr or /usr/local as these
directories in the compiler search path are always searched last.

Closes #1822
2016-09-26 19:16:42 -04:00
Patrick Griffis
15600f405f Sanitize network name for scrollback files
This prevents using invalid chars on Windows or creating directories
2016-09-11 15:50:19 -04:00
Patrick Griffis
d1bd441a9a plugin: Add chanmodes to channels list 2016-09-03 15:47:37 -04:00
Patrick Griffis
3131661f9e dbus: Remove dbus-python example in favor of GDBus 2016-08-27 23:11:29 -04:00
Patrick Griffis
ec4d3de9d2 dbus-client: Rewrite with GDBus
This is just a direct port and should change no logic
2016-08-27 23:04:20 -04:00
Patrick Griffis
439ff094ce Fix building against openssl 1.1.0
Fixes #1759
2016-08-27 22:57:09 -04:00
Patrick Griffis
dc09f2c75d Remove unused preference
I can't really think of a reason this would be needed
and since it doesn't do anything, and didn't since xchat,
 might as well remove it.
2016-08-20 23:24:19 -04:00
Patrick Griffis
034624983b plugin: Fix return value of hexchat_pluginpref_get_int()
On failure it should always return -1, atoi() returns 0.

Fixes #1785
2016-08-05 20:56:16 -04:00
Patrick Griffis
03767ee0f9 Kill fe_set_hilight()
It just duplicates functionality and this fixes:

- alert_taskbar chanopt not being respected
- tab color being incorrect when highlight print events are eaten
2016-07-24 18:08:09 -04:00
Daniel Boland
ba87247781 dcc: Improve handling multiple resumable offers
Multiple offers for the same file are resumable. Attempts to resume more
than one of the offers causes the other offers to start a new file.

Closes #1764
Fixes #1763
2016-07-20 14:11:01 -04:00
Eleni Maria Stea
f845af0370 dbus-client: Fix missing include
Fix "Implicit declaration of function exit" compile error

Closes #1770
2016-07-20 14:04:30 -04:00
Ben Gamari
9e11280e52 dcc: Introduce dcc_type and dcc_state enums
Closes #1705
2016-06-30 15:51:10 -04:00
Hubert Terlecki
77dccacd02 dcc: Fix resuming with DCC GET
Fixes #1746
Closes #1747
2016-06-30 08:45:01 -04:00
Ben Gamari
6b2cc1d28b cfgfiles: Reinitialize timers on net_ping_timeout change
This ensures that changes will take effect without a restart.
2016-06-29 15:42:11 -04:00
Ben Gamari
a970c1ae2e cfgfiles: Introduce an after_update callback
This allows individual preferences to take action when their value is
changed.

Signed-off-by: Ben Gamari <ben@smart-cactus.org>
2016-06-29 15:42:11 -04:00
Ben Gamari
215a164e57 Ensure that timers are freed and activated when necessary 2016-06-29 15:42:11 -04:00
Ben Gamari
9e4c2ddc47 Apply timeout changes made in preferences dialog
Just involves a bit of refactoring.
2016-06-29 15:42:11 -04:00
Ben Gamari
bcbe42dd7a Introduce and use fe_timeout_add_seconds
This should allow the operating system to be a bit more lax about
timeouts, allowing more efficient power management.
2016-06-29 15:42:11 -04:00
Ben Gamari
25e197a6c8 dcc: Disable timeout timer when not in use
This should mean that hexchat never *needs* to wake-up unless prompted
by socket activity (assuming that the lag-o-meter is not enabled).
2016-06-29 15:42:11 -04:00
Ben Gamari
7dca220486 Refactor timer handling
This allows us to omit the lagometer timer in the event that it is not
enabled, bringing the baseline wake-up rate down to 1Hz from 2Hz, which
could bring considerable power savings on mobile devices.
2016-06-29 15:24:03 -04:00
Adrien Saladin
111ba3750f Mask nickserv ghost password
Closes #1750
2016-06-29 15:19:28 -04:00
Arnavion
16ba39d9fa Forcibly reset iconv converter after every conversion.
Despite what g_convert_with_iconv's docs say, it does not reset the converter on a failed conversion (iconv returns -1).

Fixes #1758
2016-06-24 12:09:35 -07:00
Arnavion
4ed1acfd52 Use constant instead of literal. 2016-06-24 12:05:37 -07:00
Erik de Castro Lopo
c698e13c0d Couple of minor const correctness fixes 2016-05-28 16:52:26 +10:00
Erik de Castro Lopo
10e429b85d Remove two un-needed type casts 2016-05-28 16:35:45 +10:00
TingPing
3c329727c7 servlist: Default to UTF-8 on PTNet
Fixes #1697
2016-05-03 20:16:49 -04:00
Arnavion
fe9da9314c Fixed warning from MSVC that not all branches return a value. 2016-04-27 11:39:29 -07:00
Patrick Griffis
5b097f560d More minor scrollback loading improvements 2016-04-26 12:06:28 -04:00
Patrick Griffis
44aa999598 Fix challengeauth lower casing username 2016-04-13 18:47:51 -04:00
Patrick Griffis
a3e1a287ac Bump glib requirement to 2.34
This is still rather old but does drop Ubuntu 12.04 support.
2016-04-07 18:27:37 -07:00
Patrick Griffis
fb7f27fcdd lua: Build on win32 2016-04-03 12:02:04 -07:00
Patrick Griffis
9402a31111 Improve help message for /close
Closes #1397
2016-03-30 08:58:25 -04:00
Patrick Griffis
f656569eb9 plugin: Fix padding for chanopts in channel flags
This is an API break but it didn't really work
properly before anyway.

Fixes #1666
2016-03-30 08:28:51 -04:00
LemonBoy
0635e91dd6 Don't flush the chanopt_list when saving it
Closes #1665
Fixes #1134
2016-03-30 08:11:07 -04:00
Scott Scheiner
356241bdfb url: Add support for ts3server:// uris
Closes #1659
2016-03-30 08:05:32 -04:00
Patrick Griffis
60b3b43f3e Translate chanopt output 2016-03-28 21:31:35 -04:00
Patrick Griffis
6cbcc73a79 chanopt: Ensure values are 0-2
If chanopt was set to any other value it would overwrite
other values in the plugin API for channel flags.
2016-03-28 21:19:39 -04:00
Patrick Griffis
dd080fa6f3 Fix building on old glib 2016-03-28 01:36:02 -04:00
Patrick Griffis
bcb4eec754 identd: Fix ipv6 support on Windows 2016-03-28 01:28:56 -04:00
Patrick Griffis
795e97f428 identd: Fix respecting USE_GLOBAL network flag 2016-03-28 00:31:00 -04:00
Patrick Griffis
77ac0863f8 identd: Respond for INVALID-PORT and NO-USER errors 2016-03-27 23:44:05 -04:00
Patrick Griffis
963ba2bf2d identd: Ensure connection is closed 2016-03-27 23:18:24 -04:00
Patrick Griffis
c280029436 servlist: Update DALnet default login type 2016-03-25 18:44:16 -04:00
Patrick Griffis
47b357b2e1 Only intercept QuakeNet challengeauth when enabled 2016-03-24 15:42:49 -04:00
Patrick Griffis
c1a94e2879 servlist: Add GlobalGamers
Closes #1334
2016-03-20 20:47:52 -04:00
Patrick Griffis
7c078db879 Fix loading encoding from network list on connect
- Fix setting new encoding when switching networks
- Ignore ports when looking for network by hostname
- Only set UTF-8 when nothing explicitly set

Fixes #1628
2016-03-11 02:15:42 -05:00
Patrick Griffis
ebb0fd6905 identd: Fix leak 2016-03-09 00:38:56 -05:00
Patrick Griffis
94a7fbae02 Fix possible overflow 2016-02-19 09:41:24 -05:00
Patrick Griffis
bae1ebce2f Update network list
- Remove dead ones
- Use SASL and TLS when possible
- Make note of self-signed ones
- Add LibraIRC

Closes #1039
Closes #1512
Closes #1473
2016-02-19 09:39:16 -05:00
Insu Yun
50463ca832 Properly handle missing SSL certificate
According to OpenSSL document
(https://www.openssl.org/docs/manmaster/ssl/SSL_get_verify_result.html),
when using SSL_get_verify_result(), the existence of certificate
needs to be checked. However, in current code, it does not.
Therefore, certificate existence check is required for correctly
handling the exception.

Closes #1549
2016-02-19 07:26:50 -05:00
Patrick Griffis
aab881fda2 Fix strict prototype warnings 2016-02-18 08:57:22 -05:00
Patrick Griffis
650bddcfd1 Improve scrollback file handling
- Properly use filesystem encoding
- Validate utf8 when loading (hopefully fixing crashes)
- Use Gio
- Handle Windows line endings
- Remove dead code
- Fix respecting max length of scrollback files
2016-01-31 15:31:15 -05:00
Patrick Griffis
4362085847 Remove DH-AES/DH-BLOWFISH mechanisms and misc cleanup
- AES and Blowfish mechanisms are deemed insecure and servers
  have removed support for them
- Remove attempts to retry since we only support one mech
- Handle SASL 3.2's new syntax for supported mechs
2016-01-29 17:41:08 -05:00
Patrick Griffis
6b62c4738d Add support for twitch.tv/membership 2016-01-29 15:28:34 -05:00
Patrick Griffis
8da205b0a8 Add support for chghost 2016-01-29 15:28:33 -05:00
Patrick Griffis
981d55e84c Add support for CAP 3.2 2016-01-29 15:28:33 -05:00
Patrick Griffis
35d238ad3a Properly handle a few args optionally starting with :
This is a pervasive problem that will likely show up in
other events also.

Closes #1460
2016-01-28 22:49:23 -05:00
Patrick Griffis
2c8729becd Handle PING and AUTHENTICATE with a prefix
Not the ideal solution..

Closes #1566
2016-01-28 22:38:36 -05:00
Patrick Griffis
35f97b65c1 Sanitize server name for log files
It could contain invalid chars or log to an arbitrary directory
2016-01-28 16:22:04 -05:00