264 Commits

Author SHA1 Message Date
Sébastien Helleu
70b66c4f6b irc: add command /setname, add support of message and capability "setname" (closes #1653) 2021-06-15 18:56:41 +02:00
Sébastien Helleu
b8baee1c06 irc: add support of FAIL/WARN/NOTE messages (issue #1653)
Spec: https://ircv3.net/specs/extensions/standard-replies
2021-06-15 18:49:49 +02:00
Sébastien Helleu
5cffb7179f api: add function crypto_hmac (issue #1628) 2021-06-01 20:39:04 +02:00
Sébastien Helleu
6ac6cf7293 tests: add test of base64 encode/decode with NUL char in string 2021-06-01 20:39:04 +02:00
Sébastien Helleu
18c82fc5c7 tests: replace freenode by libera in tests 2021-05-25 13:38:12 +02:00
Sébastien Helleu
a071ee5012 tests: remove dependency on French locale in eval tests 2021-05-16 20:17:07 +02:00
Sébastien Helleu
cf7ac76de9 tests: add missing include of locale.h in eval tests 2021-05-16 19:09:18 +02:00
Sébastien Helleu
215f12d859 tests: remove commented includes 2021-05-16 19:08:35 +02:00
Sébastien Helleu
89e43eaf40 core: set server name when connecting to server with TLS (SNI extension) only if it's not an IPV4/IPv6 (closes #1635) 2021-05-16 14:52:11 +02:00
Sébastien Helleu
e03642e9df tests: add tests on translation in evaluated expressions 2021-05-16 14:09:07 +02:00
Sébastien Helleu
0f9640a5f3 core: split WeeChat home in 4 directories, use XDG directories by default (issue #1285)
The 4 directories (which can be the same):

- config: configuration files, certificates
- data: log/upgrade files, local plugins, scripts, xfer files
- cache: script repository, scripts downloaded (temporary location)
- runtime: FIFO pipe, relay UNIX sockets
2021-05-11 21:06:34 +02:00
Sébastien Helleu
4c5fcb743b core: move home directory functions from weechat.c to wee-dir.c (issue #1285) 2021-05-11 21:06:32 +02:00
Sébastien Helleu
269576eea2 core: move directory/file functions from wee-util.c to wee-dir.c (issue #1285) 2021-05-11 21:06:29 +02:00
Sébastien Helleu
ae39b7ce61 tests: fix if/else blocks in trigger tests 2021-04-11 10:42:24 +02:00
Sébastien Helleu
e58c827c91 trigger: add tests on main trigger functions 2021-04-11 09:20:49 +02:00
Sébastien Helleu
3bf585ba04 core: evaluate left/right part of comparison after split on the comparison operator in ${if:xxx} (closes #1627)
To force evaluation of the expression before doing the comparison (less safe),
the "${eval_cond:xxx}" can be used.

With the old behavior we had:

    >> ${if:a==b}
    == [0]
    >> ${if:${raw:a==b}}
    == [0]
    >> ${if:${eval_cond:${raw:a==b}}}
    == [0]

And with the new behavior, we have:

    >> ${if:a==b}
    == [0]
    >> ${if:${raw:a==b}}
    == [1]
    >> ${if:${eval_cond:${raw:a==b}}}
    == [0]
2021-04-04 14:44:18 +02:00
Sébastien Helleu
8ee7d46605 api: add support of pointer names in function string_eval_expression (direct and in hdata)
These two formats are now supported, if "pointer_name" is present in the
"pointers" hashtable:

* "${pointer_name}": value of pointer (example: "0x1234abcd")
* ${buffer[pointer_name].full_name}: use of a pointer name instead of pointer
  value or list name
2021-03-17 21:57:16 +01:00
Sébastien Helleu
c54cadace5 tests: use macros UINT32_C and UINT64_C for integer constants of type uint32_t and uint64_t
This fixes the following compiler warnings: "integer constant is so large that
it is unsigned".
2021-03-17 21:56:43 +01:00
Sébastien Helleu
0dc7fbcb0c core: add options to customize commands on system signals, quit by default on SIGHUP when not running headless (closes #1595)
New options to customize behavior on signals received, with the default
behavior:

- weechat.signal.sighup: quit in normal mode, reload config in headless
- weechat.signal.sigquit: quit
- weechat.signal.sigterm: quit
- weechat.signal.sigusr1: no command executed by default
- weechat.signal.sigusr2: no command executed by default

The signals SIGUSR1 and SIGUSR2 are introduced by this commit, so it's now
possible to run commands when they are received.

The SIGHUP signal makes now WeeChat quit, it was the behavior before version
2.9 of WeeChat (see commit de1e61f7cd50cbd1a99777fe6611642a51abf5f6).
2021-03-16 18:47:31 +01:00
Sébastien Helleu
a93e598c35 core: add raw string in evaluation of expressions with "raw:xxx" (closes #1611) 2021-02-05 20:07:16 +01:00
Sébastien Helleu
a34959a619 irc: add info "irc_is_message_ignored" 2021-02-03 18:30:32 +01:00
Sébastien Helleu
efc7a588d6 core: update copyright dates 2021-01-02 21:34:16 +01:00
Sébastien Helleu
d413ccdf4f core: add indentation and colors in /eval debug output 2021-01-01 17:08:59 +01:00
Sébastien Helleu
2ad3da03a2 core: display more verbose debug with two "-d" in command /eval
Now a single -d in command /eval shows less debug messages than previous
versions.

To get the same debug messages than previous versions, two -d must be used.
2020-12-31 20:37:43 +01:00
Sébastien Helleu
ee9aa28a8c core: do not remove quotes in arguments of command /eval (closes #1601)
Now, /eval -n -c "a" == "a" returns True instead of False.

When quotes were removed, the condition evaluated was: a" == "a (which is
False).
2020-12-25 00:21:03 +01:00
Sébastien Helleu
b626df72fb core: add evaluation of conditions in evaluation of expressions with "eval_cond:" (closes #1582) 2020-11-14 09:28:46 +01:00
Sébastien Helleu
bb82dbc0ec tests: add missing braces around if/else in macro WEE_NICK_STRDUP_FOR_COLOR (issue #1565) 2020-10-04 08:53:08 +02:00
Sébastien Helleu
f8403c76db api: add optional list of colors in infos "nick_color" and "nick_color_name" (closes #1565) 2020-10-04 08:46:36 +02:00
Sébastien Helleu
657e659c42 core: add argument "num_colors" in function gui_nick_hash_color, add tests on nick functions (issue #1565)
Functions tested:

- gui_nick_hash_djb2_64
- gui_nick_hash_djb2_32
- gui_nick_hash_sum_64
- gui_nick_hash_sum_32
- gui_nick_get_forced_color
- gui_nick_strdup_for_color
- gui_nick_find_color
- gui_nick_find_color_name
2020-10-04 08:46:25 +02:00
Sébastien Helleu
1c5e5824e7 tests: run callback when resetting options in tests 2020-10-03 14:40:59 +02:00
Sébastien Helleu
cfd221014c api: add argument "bytes" in function string_dyn_concat 2020-08-23 23:27:57 +02:00
Sébastien Helleu
268aa631c6 api: add function string_color_code_size (issue #1547) 2020-08-22 08:55:16 +02:00
Sébastien Helleu
d15db0ecbb core: set "notify_level" to 3 if there is a highlight in the line (closes #1529) 2020-08-15 14:02:40 +02:00
Sébastien Helleu
0cc5df6649 irc: send all channels in a single JOIN command when reconnecting to the server (closes #1551) 2020-08-05 20:05:36 +02:00
Sébastien Helleu
36c55f6973 tests: fix name of some unit tests 2020-08-05 07:28:30 +02:00
Sébastien Helleu
8cf56dfdf9 tests: add tests on GUI line functions
Functions tested:

- gui_line_lines_alloc
- gui_line_lines_free
- gui_line_tags_alloc
- gui_line_tags_free
- gui_line_is_displayed
- gui_line_has_tag_no_filter
- gui_line_search_tag_starting_with
- gui_line_get_nick_tag
2020-08-04 23:42:20 +02:00
Sébastien Helleu
5b151d1639 irc: check that the first nick char is not a prefix char or chantype in function irc_nick_is_nick 2020-06-21 10:22:37 +02:00
Sébastien Helleu
4a42cda3a5 irc: change default chantypes from "#&+!" to "#&"
The default chantypes was conflicting with
irc_server_prefix_chars_default ("@+").
2020-06-21 10:22:04 +02:00
Sébastien Helleu
9446610452 tests: add test of function irc_nick_is_nick with invalid UTF-8 string 2020-06-20 17:44:48 +02:00
Sébastien Helleu
12051a506d irc: add support of UTF8MAPPING, add support of optional server in info "irc_is_nick" (closes #1528) 2020-06-20 17:28:28 +02:00
Sébastien Helleu
bf964de939 tests: add tests on IRC function irc_channel_is_channel 2020-06-20 12:04:40 +02:00
Sébastien Helleu
e41eeaf203 tests: add tests on IRC command ACCOUNT with colon before the account name 2020-06-16 08:07:55 +02:00
Sébastien Helleu
8818fbb233 tests: fix memory leak in test of function string_hex_dump 2020-05-31 14:51:41 +02:00
Sébastien Helleu
aaa49d3188 tests: add tests on function string_input_for_buffer with custom command chars 2020-05-21 10:06:51 +02:00
Sébastien Helleu
f4913d0a6b tests: add tests on function string_is_command_char with custom command chars 2020-05-21 10:06:42 +02:00
Sébastien Helleu
99b13aa671 tests: add test on function string_base64_decode with truncated base64 string 2020-05-21 09:56:35 +02:00
Sébastien Helleu
a997893cfe tests: add test on function string_base16_decode with a char >= 0xA0 2020-05-21 09:55:40 +02:00
Sébastien Helleu
66d4590dab core: add base 16/32/64 encoding/decoding in evaluation of expressions 2020-05-21 09:36:35 +02:00
Sébastien Helleu
1994d5641d core: move functions string_base_encode and string_base_decode from plugin-api.c to wee-string.c 2020-05-21 00:02:24 +02:00
Sébastien Helleu
0ac936a5cf core: return -1 in case of error in functions string_base16_decode and string_base64_decode 2020-05-21 00:01:35 +02:00