286 Commits

Author SHA1 Message Date
Sébastien Helleu
ed9104fbea irc: fix parsing of CAP message when there is no prefix (closes #1707) 2021-10-09 11:27:51 +02:00
Sébastien Helleu
ad5fa7c99f core: add command /toggle 2021-10-01 22:55:38 +02:00
Sébastien Helleu
a6826af796 core: add creation of user variables in evaluated expressions with ${define:name,value} 2021-09-20 21:15:28 +02:00
Sébastien Helleu
5b3929b321 api: add split of string and shell arguments in evaluation of expressions
Split of string: ${split:number,separators,flags,xxx}
Split of shell arguments: ${split_shell:number,xxx}
2021-09-06 13:32:04 +02:00
Sébastien Helleu
5fb7ebdfce irc: fix send of empty JOIN when connecting to a server with only parted channels (closes #1638) 2021-09-03 13:43:07 +02:00
Sébastien Helleu
2de272ee6c api: add "${re:repl_index}" to get the index of replacement in function string_eval_expression 2021-08-29 10:40:52 +02:00
Sébastien Helleu
8e676edd1a irc: save CLIENTTAGDENY from message 005 in server, do not send typing messages if "typing" client tag is denied 2021-08-08 18:37:15 +02:00
Sébastien Helleu
20866a0457 core: fix decoding of attributes in basic ANSI colors (closes #1678) 2021-08-06 20:33:31 +02:00
Sébastien Helleu
791b910a77 irc: fix SASL authentication when AUTHENTICATE message is received with a server name (closes #1679) 2021-08-03 19:58:13 +02:00
Sébastien Helleu
d89c4f559c api: add random integer number in evaluation of expressions with "random:min,max" 2021-08-03 19:46:41 +02:00
Sébastien Helleu
7c83ee02f2 tests: add tests on typing plugin functions 2021-07-04 13:27:33 +02:00
Sébastien Helleu
dccf605e66 typing: add typing plugin 2021-07-04 13:27:32 +02:00
Sébastien Helleu
8a11a18dc5 api: add function file_copy (issue #1667) 2021-07-03 16:04:50 +02:00
Sébastien Helleu
a48a615613 api: remember insertion order in hashtables 2021-06-26 21:37:02 +02:00
Sébastien Helleu
22a7e18842 irc: add support of capability "message-tags" (closes #1654) 2021-06-24 21:04:52 +02:00
Sébastien Helleu
b1cf12700d irc: add keys/values with tags in output of irc_message_parse_to_hashtable (issue #1654)
Key is "tag_xxx" (where "xxx" is the name of tag) and value is the unescaped
tag value.
2021-06-24 21:02:03 +02:00
Sébastien Helleu
8ea1ee06e5 irc: add support of TAGMSG messages (issue #1654) 2021-06-24 21:01:22 +02:00
Sébastien Helleu
23c46c3f2b irc: escape/unescape IRC message tags values (issue #1654)
Spec: https://ircv3.net/specs/extensions/message-tags#escaping-values
2021-06-24 20:59:21 +02:00
Sébastien Helleu
60b9e36ae2 core: fix function string_match with joker in the string if multiple words matched in input string
Before fix:

  string_match("script.color.text_description", "*script*color*", 0) => 0

After fix:

  string_match("script.color.text_description", "*script*color*", 0) => 1
2021-06-22 21:54:16 +02:00
Sébastien Helleu
3d3cdf3884 tests: fix modifier name in comment 2021-06-21 19:58:53 +02:00
Sébastien Helleu
ef318cb70c irc: enable all capabilities by default (supported by both server and WeeChat) (closes #320)
Capabilities can be excluded with the format: "*,!account-*,!extended-join".
2021-06-19 18:22:49 +02:00
Sébastien Helleu
0ceccb9798 tests: fix tests on signal_search_number 2021-06-16 12:34:30 +02:00
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