1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-14 23:24:47 +02:00

Compare commits

..

193 Commits

Author SHA1 Message Date
Sébastien Helleu dc692fd04a core, relay: fix include directory of libzstd 2024-05-26 23:54:34 +02:00
Sébastien Helleu 61e9fcb36b irc: fix crash in split of IRC message containing a newline if the server is not given 2024-05-25 19:54:53 +02:00
Sébastien Helleu 720a7e5a99 python: fix truncation of unsigned long long integer returned by function string_parse_size 2024-02-25 17:10:32 +01:00
Sébastien Helleu 33a6c852b7 tcl: fix truncation of long integer returned by function hdata_long 2024-02-25 16:16:02 +01:00
Sébastien Helleu 53fdd3458b core: add missing mouse events "alt-ctrl-button2" and "alt-ctrl-button3" 2024-02-25 13:46:24 +01:00
Sébastien Helleu 32c66a10a5 script: always display list of scripts when searching scripts with /script search (issue #2077) 2024-02-21 21:39:03 +01:00
Sébastien Helleu 134b639782 script: fix default mouse keys (issue #2076)
Some parameters of command `/script` were renamed in commit
85b5bacfe3 but the default mouse keys were not
changed and still using the old parameters names.
2024-02-21 21:16:25 +01:00
Sébastien Helleu 3ac74b94db trigger: fix memory leak when adding a new trigger with /trigger command 2024-02-10 17:58:24 +01:00
Faisal N Jawdat 769b64fb5b ruby: add detection of Ruby 3.3 2024-02-04 14:14:34 +01:00
Sébastien Helleu 870ae139a8 ci: remove tests on macOS 11 2024-02-04 14:07:08 +01:00
Sébastien Helleu 1eeb76a9ad Version 4.1.4-dev 2024-02-04 14:06:50 +01:00
Sébastien Helleu ad4529dc39 Version 4.1.3 2024-01-20 09:18:02 +01:00
Sébastien Helleu aff7a19339 core: add release notes for next version 2024-01-20 09:12:35 +01:00
Sébastien Helleu 1eed2d0e50 core: add version 4.0.8 in ChangeLog and release notes 2024-01-20 09:11:53 +01:00
Sébastien Helleu 5cb0f201f5 irc: check if arguments are not NULL in some infos
Affected infos:

- irc_server_isupport
- irc_server_isupport_value
- irc_server_cap
- irc_server_cap_value
2024-01-12 18:02:54 +01:00
Sébastien Helleu 4cd22e470c irc: fix info "irc_is_message_ignored" (issue #2059) 2024-01-12 18:02:31 +01:00
Sébastien Helleu 97b9d4b26e irc: fix display of self messages in case of message split failure
When the message sends inconsistent max lengths in message 005, the split of
self message fails and causes a display issue: the channel name is displayed
with the message:

  nick | #channel :this is a test

instead of:

  nick | this is a test
2024-01-05 21:35:29 +01:00
Sébastien Helleu f0394bf486 core: fix crash on plugin reload when using musl libc (issue #2052) 2023-12-15 23:02:27 +01:00
Sébastien Helleu 94616b4294 core: fix infinite loop in display when the chat area is too small (issue #2053) 2023-12-14 23:21:08 +01:00
Sébastien Helleu 1ade7c54a2 Version 4.1.3-dev 2023-12-14 23:20:28 +01:00
Sébastien Helleu 14b8518ae2 Version 4.1.2 2023-12-03 19:17:25 +01:00
Sébastien Helleu 4dbae51568 core: add version 4.0.7 in ChangeLog and release notes 2023-12-03 19:12:59 +01:00
Sébastien Helleu 19a1b4145b irc: remove trailing "\r\n" in signals "irc_out" and "irc_outtags" when messages are queued 2023-11-26 18:57:21 +01:00
Sébastien Helleu f6912518b3 tests: add tests on IRC message 337 2023-11-07 21:59:22 +01:00
Sébastien Helleu 5115bebb27 irc: fix target buffer of IRC message 337 (whois reply: "is hiding their idle time") 2023-11-07 21:50:55 +01:00
Sébastien Helleu ceaaab3866 core: fix value of buffer variable "num_history" when the value defined in option weechat.history.max_commands is reached 2023-11-04 17:02:08 +01:00
Sébastien Helleu 4865087019 relay: close properly connection with the IRC client in case of server disconnection (issue #2038) 2023-11-04 09:05:39 +01:00
Sébastien Helleu 532f2ce683 core: remove incorrect warning when binding keys F10 to F20 (issue #2039) 2023-11-04 08:37:36 +01:00
Sébastien Helleu 67bcbf5256 core, plugins: set error to NULL before calling strtol()
This is not strictly necessary, just in case the function strtol() doesn't
update the pointer.
2023-11-01 14:17:15 +01:00
Sébastien Helleu 08fbfcc203 core: fix memory leak when config version is invalid or not supported 2023-10-30 23:30:01 +01:00
Sébastien Helleu fad3f0c942 core: check that buffer is not NULL in function gui_chat_printf_date_tags_internal 2023-10-30 23:29:25 +01:00
Sébastien Helleu 8c55f87fb2 core: fix use NULL pointer when a config file has no options 2023-10-30 23:29:17 +01:00
Sébastien Helleu 8fae2fd927 logger: remove dead assignment 2023-10-30 23:29:13 +01:00
Sébastien Helleu 53f1eb9b28 xfer: fix use of uninitialized variable when adding a new xfer 2023-10-30 23:29:05 +01:00
Sébastien Helleu 3e78d55495 xfer: fix use of NULL pointer in strrchr() 2023-10-30 23:28:51 +01:00
Sébastien Helleu aa5c03334a core: fix crash when "config_version" is present in a configuration file without a value 2023-10-30 23:28:07 +01:00
Sébastien Helleu 8e6647c7c9 core: display an error on startup if environment variable "HOME" is not set 2023-10-30 23:27:20 +01:00
Sébastien Helleu e140f3cf8e tests: check that environment variable "HOME" is set before using it 2023-10-30 23:26:01 +01:00
Sébastien Helleu 60b2b03f9a ruby: fix use of NULL variable when displaying exception 2023-10-30 23:25:51 +01:00
Sébastien Helleu 1769ce1814 Version 4.1.2-dev 2023-10-30 23:24:34 +01:00
Sébastien Helleu fbd579eb61 ci: uninstall php8.1-imagick before build (issue #2009)
When php imagick is installed and when WeeChat is compiled with gcc, there's a
crash when the php plugin is loaded.  Newer versions of gcc should fix the
issue, but as in CI we can't easily use them, uninstalling imagick avoids the
crash.
2023-10-28 09:21:00 +02:00
Sébastien Helleu 0e97de4293 Version 4.1.1 2023-10-26 21:13:53 +02:00
Sébastien Helleu 097dc1f48f Version 4.1.1-dev 2023-10-26 21:12:39 +02:00
Sébastien Helleu c3dba4496b core: add version 4.0.6 in ChangeLog and release notes 2023-10-26 21:11:07 +02:00
Sébastien Helleu 7d854c84de core: fix crash when a custom bar item name is already used by a default bar item (issue #2034) 2023-10-23 13:11:02 +02:00
Sébastien Helleu a9c410ff23 core: fix random timeouts when a lot of concurrent processes are launched with hook_process (issue #2033) 2023-10-22 21:05:45 +02:00
Sébastien Helleu 8c4ff51beb core: update translations (issue #194, issue #2032) 2023-10-19 23:57:25 +02:00
Sébastien Helleu 6ca604938f irc: revert compute of nick colors to case sensitive way, deprecate again IRC nick color infos (issue #194, issue #2032) 2023-10-19 23:31:49 +02:00
Sébastien Helleu 252f787fcf core: make libintl.h required if CMake option ENABLE_NLS is enabled (issue #2031) 2023-10-15 14:58:26 +02:00
Sébastien Helleu 839148e9d4 core: update French translations 2023-10-15 15:47:04 +02:00
Sébastien Helleu 775b9c9cdf Version 4.1.0 2023-10-15 09:02:57 +02:00
Sébastien Helleu 6bc7d6fad3 debian: update changelog 2023-10-15 08:46:45 +02:00
Sébastien Helleu 9aefe4ae09 core: call curl init and cleanup functions
This is to prevent issues when these functions are not thread-safe.
2023-10-13 23:03:00 +02:00
Trygve Aaberge 13a057f0b2 core: only print hook_url errors when debug is enabled
Errors from hook_url should be handled by the caller, so don't print
them to the core buffer by default. Only print them when
weechat_debug_core is enabled. This was already the behavior for the
timeout error.
2023-10-13 21:52:15 +02:00
Trygve Aaberge 3735397a0f core: add error codes to output in hook_url
When hook_url fails, add an error_code field in the output in addition
to the error field. This is so the caller can get which error happened
programatically, without having to parse the (possibly translated) error
string.

It uses the same error codes as the return_code in hook_process, and in
addition adds 5 for an error from pthread_create and 6 for a timeout
error. If the error is from pthread_create, an additional field
`error_code_pthread` with the error code from pthread_create is added.
If the error is from curl, an additional field `error_code_curl` with
the error code from curl is added.
2023-10-13 09:26:00 +02:00
Trygve Aaberge 57b2efd82b core: run hook_url callback when pthread_create failed 2023-10-13 09:25:39 +02:00
Sébastien Helleu 6468f7761f core: set "error" field of "output" hashtable in hook_url in case of transfer timeout 2023-10-13 08:14:31 +02:00
Nils Görs a83121b847 core: update German translations 2023-10-11 07:52:02 +02:00
Sébastien Helleu 02a05f63d5 core: fix zombie processes remaining after the end of forked processes (closes #1994)
The clean of processes with waitpid() is now delayed after the kill(), so that
there are no more zombies.

In addition, this can be done manually if needed with `/sys waitpid`.
2023-10-10 19:23:43 +02:00
Sébastien Helleu 408901d772 irc: move value -all at the end of completions for command /ignore del 2023-10-09 20:06:52 +02:00
Sébastien Helleu bea9d5a2bf irc: fix memory leak when joining channels with keys 2023-10-07 20:33:42 +02:00
Sébastien Helleu feb5ee8886 core: fix build error if CMake option ENABLE_NLS is turned to off or if required dependencies are not found (closes #2026) 2023-10-05 19:05:02 +02:00
Sébastien Helleu b46ed5a2a2 core: use larger buffer for errors when creating a filter 2023-10-05 19:02:38 +02:00
Nils Görs 1d104bb940 core: update German translations 2023-10-05 08:44:28 +02:00
Sébastien Helleu 4600aeea53 core: update ChangeLog (issue #2024) 2023-10-01 16:43:48 +02:00
Sébastien Helleu 6bd0c63192 core: make zstd dependency optional (closes #2024) 2023-10-01 16:36:32 +02:00
Sébastien Helleu 879a548bea buflist: rename completions with items
Completions renamed:

- "buflist_all_items" -> "buflist_items"
- "buflist_used_items" -> "buflist_items_used"
2023-10-01 12:14:03 +02:00
Sébastien Helleu e928bce76c buflist: add support of item names in command /buflist refresh 2023-10-01 09:58:19 +02:00
LuK1337 8bd4994ccd core, relay: make inet_pton() return value checks more strict
inet_pton() can return values < 0.
2023-09-26 17:48:20 +02:00
Sébastien Helleu 360e971b01 core: add contributor 2023-09-26 17:14:10 +02:00
LuK1337 0bb5998988 core: replace inet_addr() with inet_pton()
man pages as well as rpminspect suggest that we shouldn't be using
inet_addr().
2023-09-26 17:12:03 +02:00
Sébastien Helleu b58f704542 core: update ChangeLog 2023-09-25 13:50:32 +02:00
LuK1337 bcd23ff585 core: fix TOTP moving factor on big-endian systems 2023-09-25 13:48:30 +02:00
LuK1337 169eecb5cf tests: use correct data type method in hdata tests 2023-09-25 13:48:30 +02:00
LuK1337 b433afbd26 tests: cast infolist time variable value to the correct data type 2023-09-25 13:48:30 +02:00
Sébastien Helleu 082ccb05bb core: add version 4.0.5 2023-09-24 10:24:26 +02:00
Sébastien Helleu f72fb3be4b irc: display "owner" for +q and "admin" for +a in output of /names (closes #2020, issue #97) 2023-09-22 23:21:22 +02:00
Sébastien Helleu 7f0efa3a8f core: update translations 2023-09-22 23:12:32 +02:00
Sébastien Helleu c96971eebb script: only check if return value of plugin_script_search_path is NULL (issue #2019) 2023-09-22 22:58:51 +02:00
Sébastien Helleu d6e4e87faf script: fix removal of script in system directory while trying to install a script (closes #2019) 2023-09-22 22:51:44 +02:00
Sébastien Helleu 12106ae7ba script: fix autoload of multiple scripts at once with /script autoload (closes #2018) 2023-09-20 20:05:49 +02:00
Sébastien Helleu 91bb1ebf5d tests: fix condition on libgcrypt version for algorithms sha512-224 and sha512-256 (issue #2008) 2023-09-20 06:56:56 +02:00
Sébastien Helleu 439410a388 doc/api: use a table for file_in/file_out options in function hook_url 2023-09-16 13:00:03 +02:00
Sébastien Helleu 36ab6c3bc7 doc/api: add link to hook_url in hook_process_hashtable for Curl options 2023-09-16 13:00:03 +02:00
Sébastien Helleu f0e4494205 core: properly terminate thread and release memory in url hook 2023-09-16 13:00:03 +02:00
Sébastien Helleu 83dcb84ea6 doc/api: add function hook_url 2023-09-16 13:00:03 +02:00
Sébastien Helleu fb00bc1f4b scripts: add function hook_url in scripting API 2023-09-16 13:00:03 +02:00
Sébastien Helleu 24d2ba3338 script: replace hook_process_hashtable by hook_url to download scripts and list of scripts (closes #1723) 2023-09-16 12:58:57 +02:00
Sébastien Helleu 63922ca038 api: add function hook_url 2023-09-16 10:19:51 +02:00
Sébastien Helleu a5f4c3770b doc/faq: add question about move of WeeChat config to another device 2023-09-16 09:46:50 +02:00
Sébastien Helleu 23d3ce7ad8 doc/faq: add question about keys like Enter and version 4.0.0 2023-09-15 18:57:00 +02:00
Nils Görs f49810ec0e core: update German translations 2023-09-15 12:48:22 +02:00
Sébastien Helleu 85b5bacfe3 script: rename parameters up/down/go to -up/-down/-go in command /script 2023-09-15 08:43:37 +02:00
Sébastien Helleu e62ff286ff xfer: fix crash on /dcc chat 2023-09-14 20:48:58 +02:00
Sébastien Helleu cb680ef9df irc: add option irc.look.open_pv_buffer_echo_msg (issue #2016) 2023-09-14 20:19:05 +02:00
Sébastien Helleu 63fc9aace8 irc: update title in query buffer when remote nick is myself (issue #2016) 2023-09-14 16:15:09 +02:00
Sébastien Helleu a2c3322df7 irc: fix title of query buffer for own messages received (issue #2016) 2023-09-14 15:22:11 +02:00
Sébastien Helleu 049e9d23c5 irc: open a query buffer on PRIVMSG received from self nick when capability echo-message is NOT enabled (issue #2016) 2023-09-14 14:51:50 +02:00
Sébastien Helleu 4c3ab508c7 irc: don't open a new private buffer on /msg command when capability echo-message is enabled (closes #2016) 2023-09-14 11:10:17 +02:00
Sébastien Helleu 747d6122bc core: move ChangeLog entry to the appropriate version 2023-09-14 11:07:42 +02:00
Nils Görs aad846583d core: update German translations 2023-09-14 08:45:01 +02:00
Sébastien Helleu 4e173c1972 irc: fix title of private buffers wrongly set to own address when capability echo-message is enabled (issue #2016) 2023-09-14 08:04:44 +02:00
Sébastien Helleu ef99d544fa core: add algorithms sha512-224, sha512-256, sha3-*, blake2b-* and blake2s-*` in option sec.crypt.hash_algo (closes #2008) 2023-09-13 15:10:19 +02:00
Sébastien Helleu 684bfd64c6 api: add algorithms sha512-224, sha512-256, blake2b-* and blake2s-*` in hash functions (issue #2008) 2023-09-13 15:09:34 +02:00
Nils Görs 29c4aa4620 core: update German translations 2023-09-13 10:19:54 +02:00
Sébastien Helleu d100d62a72 core: translate error messages (issue #2013) 2023-09-12 15:09:00 +02:00
Sébastien Helleu 3021b2f9c5 core: automatically backup config file read if it has an unsupported version (closes #2013) 2023-09-12 14:59:25 +02:00
Sébastien Helleu 6fcdb50dab xfer: fix memory leak on plugin unload 2023-09-12 13:38:14 +02:00
Sébastien Helleu 54a5815105 doc/api: fix return values for callback_read in config_new_section 2023-09-12 13:35:02 +02:00
Sébastien Helleu c4c58e0914 irc: fix unexpected message sent to server when part of the second line of an IRC command (closes #1992) 2023-09-12 08:14:23 +02:00
Sébastien Helleu 8eb2604704 core: add path in message displayed when a config file is updated to a newer version 2023-09-11 22:49:21 +02:00
Sébastien Helleu ddd859886e irc: fix autojoin of channels when private buffers are opened (closes #2012) 2023-09-11 21:41:47 +02:00
Sébastien Helleu ae50f6688e irc: reset filter and sort when /list buffer is closed (issue #1972) 2023-09-11 16:40:45 +02:00
Nils Görs 6170ebd396 core: update German translations 2023-09-11 11:21:54 +02:00
Sébastien Helleu 82372115ae core: display a message when a configuration file is updated to a newer version 2023-09-11 09:53:17 +02:00
Nils Görs 71dfbdc419 core: update German translations 2023-09-11 08:44:14 +02:00
Sébastien Helleu 79d0a134e3 buflist: add missing items buflist4 and buflist5 in help on command/options and user's guide 2023-09-11 07:55:54 +02:00
Nils Görs 3882b2e881 core: update German translations 2023-09-09 21:03:38 +02:00
Sébastien Helleu 6b356d4208 doc/user: add missing actions on script buffer 2023-09-09 11:26:04 +02:00
Sébastien Helleu a2e9c74b50 doc/user: add missing key alt+L (input L) on script buffer 2023-09-09 11:10:50 +02:00
Sébastien Helleu d9555cc567 scripts: add functions config_enum and config_enum_default in scripting API (issue #1973) 2023-09-09 08:54:33 +02:00
Sébastien Helleu 9fada89f96 doc/user: add missing actions p and v on fset buffer 2023-09-08 20:22:59 +02:00
Sébastien Helleu 46b76af645 xfer: display an error message when opening file for read or write fails (issue #2010) 2023-09-08 13:06:28 +02:00
Sébastien Helleu b30b492e66 core: update translations 2023-09-08 13:02:36 +02:00
Sébastien Helleu 2c251cd285 script: fix up/down keys on /script buffer
Regression was introduced in commit 817d1eaf8e.
2023-09-08 10:47:46 +02:00
Nils Görs 7fd20269e7 core: update German translations 2023-09-08 07:56:48 +02:00
Sébastien Helleu 374262a8d7 core: add completion "eval_variables", used in completion of /eval 2023-09-07 11:38:26 +02:00
Sébastien Helleu 89739421cf core: fix comment on function eval_replace_vars_cb 2023-09-07 11:30:54 +02:00
Sébastien Helleu 1be5209e9f core: update translations (issue #2004) 2023-09-06 19:16:06 +02:00
Sébastien Helleu 65e092ab25 core: add contributor (issue #2004) 2023-09-06 19:16:06 +02:00
Sébastien Helleu 5f5f05805f core: update ChangeLog (issue #2004) 2023-09-06 19:16:06 +02:00
Sébastien Helleu 6eb3f5672f xfer: fix code style (issue #2004) 2023-09-06 19:10:47 +02:00
Sébastien Helleu 1f1416dd50 irc: fix code style (issue #2004) 2023-09-06 19:10:41 +02:00
Mario Campos 1ee3bad88b xfer: update command/config docs with passive DCC support. 2023-09-06 14:11:35 +02:00
Mario Campos 7f0f947667 xfer: add passive DCC support.
This commit also includes support for passive DCC RESUME.

There was also a potential segfault with calling `atoi(pos_token)` when `pos_token` is NULL, so `token` is set to be stored as a string. Although it is an integer, we don't need to store it as such. That's really more of an implementation detail.
2023-09-06 14:11:35 +02:00
Mario Campos 23d70b5101 xfer: add and identify active/passive xfer types.
Before making any significant changes, let's identify the existing xfer types by either active or passive.
2023-09-06 14:11:35 +02:00
Mario Campos 2a40743ed0 xfer: reverse DCC parsing from RtL to LtR.
This makes it easier to handle the optional "token" argument at the (right) end, which will be necessary to support passive DCC.

Incidentally, this is RtL parsing order is the reason why you'd get a cryptic "0" address error when attempting to do passive DCC: the "token" argument gets misinterpreted as the "size" argument. Every argument "shifts" over by one, leaving an address (port) of "0".
2023-09-06 14:11:35 +02:00
Sébastien Helleu ac8418de8e irc: remove default CTCP replies FINGER and USERINFO from user's guide (issue #1974) 2023-09-06 14:10:56 +02:00
Sébastien Helleu e1ecf992f3 irc: fix comments on CTCP evaluated variables (issue #1974) 2023-09-06 14:05:10 +02:00
Ivan Pešić cf6ec7657e doc: Update Serbian documentation 2023-09-06 10:25:41 +02:00
Ivan Pešić 75c5ccecfa core: Update Serbian translation 2023-09-06 10:25:41 +02:00
Sébastien Helleu 722cb27d04 core: add note for translators on command arguments (issue #2005)
Only text between angle brackets (eg: "<name>") must be translated.
2023-09-05 13:28:26 +02:00
Sébastien Helleu 13ce1147fc doc: fix alignment of command arguments in auto-generated file when command name contains wide chars 2023-09-01 08:58:36 +02:00
Nils Görs b7cd446822 core: update German translations 2023-09-01 07:29:20 +02:00
Sébastien Helleu 5691518e91 doc/user: add section "buffer" in chapter on WeeChat options (issue #352) 2023-08-30 17:33:50 +02:00
Sébastien Helleu 2b3fb62065 core: do not evaluate properties "key_bind_xxx" and "key_unbind_xxx" in options weechat.buffer.* (issue #352) 2023-08-30 17:25:21 +02:00
Sébastien Helleu c2b6523d9f core: fix style for keys in ChangeLog 2023-08-29 12:32:23 +02:00
Sébastien Helleu 620fce4bba core: add new key ctrl+z in ChangeLog 2023-08-29 12:28:24 +02:00
Sébastien Helleu 8b3311860b api: add support of path to variable and hashtable comparison in function hdata_compare (closes #1066) 2023-08-29 10:22:17 +02:00
Sébastien Helleu 58d61cb153 core: remove unused variable old_value 2023-08-29 09:53:08 +02:00
Sébastien Helleu 32f52ae236 core: check that property is not NULL before calling free 2023-08-29 09:52:17 +02:00
Nils Görs c5ceacd68f core: update German translations 2023-08-28 20:34:03 +02:00
Sébastien Helleu aa4bc616b9 core: add missing include of unistd.h 2023-08-28 17:57:46 +02:00
Sébastien Helleu b203c4109b core: move sys filename and functions 2023-08-28 17:55:54 +02:00
Sébastien Helleu a16b3d25ce core: update translations 2023-08-28 17:47:21 +02:00
Sébastien Helleu cc2b44a8ec core: add key ctrl+z to suspend WeeChat process (closes #985) 2023-08-28 17:39:33 +02:00
Sébastien Helleu 5ecb1adc34 core: add command /sys to show resource limits and usage 2023-08-28 12:30:32 +02:00
Nils Görs d328d7f2b8 core: update German translations 2023-08-27 19:42:31 +02:00
Sébastien Helleu 711d3afa5c script: fix crash when a /script command triggers another /script command (issue #923) 2023-08-27 17:19:01 +02:00
Sébastien Helleu 99822fc5e7 core: ignore key bindings with empty command
This makes possible to disable a key hiding another (because shorter than the
other, and beginning with the same key).

For example if key "meta-a" is set to an empty command, it would not hide any
more the key "meta-a,1" which has a non-empty command.
2023-08-27 14:16:08 +02:00
Sébastien Helleu 181f4c041d core: add support of quotes in commands /key bind and /key bindctxt 2023-08-27 14:15:30 +02:00
Sébastien Helleu 3ca4f2d3e5 irc: add count and mode filter in command /names (closes #98) 2023-08-27 12:26:10 +02:00
Sébastien Helleu 300adb42fa irc: add note about regex and output on server buffer in /help list 2023-08-27 09:59:54 +02:00
Sébastien Helleu e5e027b9fa core: add countdown example in /help repeat (issue #2007) 2023-08-27 08:25:41 +02:00
Sébastien Helleu 9a268ec7cc core: evaluate command given to /repeat with contextual variables (closes #2007) 2023-08-27 08:03:40 +02:00
Nils Görs b0ed5b99e9 core: update German translations 2023-08-27 00:12:07 +02:00
Sébastien Helleu 4a95d78c45 core: add variable ${property} in evaluation of options weechat.buffer.* (issue #352) 2023-08-26 20:04:58 +02:00
Sébastien Helleu dd0c20f6b6 irc: add count for all nick modes in output of /names (closes #97) 2023-08-26 18:57:21 +02:00
Sébastien Helleu 42c925b672 irc: use str_nicks only if not NULL in callback of message 353 2023-08-26 18:56:37 +02:00
Sébastien Helleu ff4596e45c core: add option callbacks in command /debug 2023-08-25 13:35:50 +02:00
Sébastien Helleu cc2bb4b8cf core: add function util_get_microseconds_string 2023-08-25 11:53:23 +02:00
Sébastien Helleu 015ff084e3 core: add microseconds precision in function util_parse_delay 2023-08-25 11:23:41 +02:00
Sébastien Helleu 11943ebaaf tests: add tests on GUI buffer functions
Functions tested:

- gui_buffer_is_reserved_name
- gui_buffer_get_integer
- gui_buffer_get_string
- gui_buffer_get_pointer
2023-08-25 08:16:36 +02:00
Sébastien Helleu 2092715ac7 core: add buffer local keys in completion "buffer_properties_setauto" 2023-08-24 19:20:05 +02:00
Sébastien Helleu 272bcf3c97 core: update ChangeLog (issue #2006) 2023-08-24 19:10:35 +02:00
Trygve Aaberge d14e74ccf6 Add compatibility with Python < 3.10 in weechat.pyi
The | syntax for unions is only supported in Python 3.10 and later.
Since Python 3.8 and 3.9 are still supported upstream for a while and we
had a user reporting on IRC that they couldn't use the stub file since
they are using 3.8, change to the old syntax for unions to support this.

There aren't really any drawbacks of this. It's just a bit more verbose,
and a typing import is necessary, but neither of those really matters in
a generated stub file.
2023-08-24 19:08:00 +02:00
Sébastien Helleu 3a59f2f65e irc: add local key bindings during the /list buffer creation
This allows the user to bind or unbind keys by setting options
"weechat.buffer.irc.list_xxx.key_bind_*" and
"weechat.buffer.irc.list_xxx.key_unbind_*".
2023-08-24 19:03:44 +02:00
Sébastien Helleu 817d1eaf8e script: add local key bindings during the buffer creation
This allows the user to bind or unbind keys by setting options
"weechat.buffer.script.scripts.key_bind_*" and
"weechat.buffer.script.scripts.key_unbind_*".
2023-08-24 19:01:20 +02:00
Sébastien Helleu 6737859330 fset: add local key bindings during the buffer creation
This allows the user to bind or unbind keys by setting options
"weechat.buffer.fset.fset.key_bind_*" and
"weechat.buffer.fset.fset.key_unbind_*".
2023-08-24 19:00:32 +02:00
Sébastien Helleu fd07b2888f fset: fix wrong value type in hashtable used for fset buffer properties 2023-08-24 18:44:50 +02:00
Sébastien Helleu 5d9af29024 api: add infos "nick_color_ignore_case" and "nick_color_name_ignore_case" (issue #194) 2023-08-24 18:19:32 +02:00
Nils Görs 965c6ac2ea doc: update German documentation 2023-08-24 13:50:16 +02:00
Nils Görs d2d3cd1b46 core: update German translations 2023-08-24 13:36:53 +02:00
Sébastien Helleu 0c6bcf3e78 core: update translations (closes #352) 2023-08-24 11:49:46 +02:00
Sébastien Helleu 303fe6744e core: add option setauto in command /buffer (issue #352) 2023-08-24 11:49:29 +02:00
Sébastien Helleu 3aef8b7292 core: add options weechat.buffer.* to save buffer properties set by user (issue #352) 2023-08-24 10:38:47 +02:00
Sébastien Helleu 6aa66b5363 irc: compute color in case insensitive way (closes #194)
Reintroduce infos "irc_nick_color" and "irc_nick_color_name" (that were
marked deprecated since version 1.5).

A server name is added in the two infos and is optional, for backward
compatibility.
2023-08-24 09:24:51 +02:00
Sébastien Helleu c2426e88c9 irc: add functions to convert strings to lower/upper case (following casemapping) (issue #194) 2023-08-24 09:24:42 +02:00
Sébastien Helleu 09eae3e2af irc: add tests on server functions 2023-08-23 15:33:34 +02:00
Sébastien Helleu 25b3f2eae7 irc: fix string comparison when CASEMAPPING is set to "ascii" 2023-08-23 15:33:34 +02:00
Sébastien Helleu 9462c87ce5 tests: add tests on string comparison functions with range of 29 chars 2023-08-23 12:14:07 +02:00
Sébastien Helleu 03927a3283 irc: check that server is not NULL in function irc_server_eval_fingerprint 2023-08-23 12:08:59 +02:00
Sébastien Helleu 7afc43901d irc: move function irc_server_fingerprint_search_algo_with_size 2023-08-23 12:06:59 +02:00
259 changed files with 18361 additions and 5546 deletions
+3 -1
View File
@@ -19,6 +19,7 @@ jobs:
- { name: "gcc", cc: "gcc", cxx: "g++", buildargs: "" }
- { name: "gcc_ninja", cc: "gcc", cxx: "g++", buildargs: "-G Ninja" }
- { name: "gcc_no_nls", cc: "gcc", cxx: "g++", buildargs: "-DENABLE_NLS=OFF -DENABLE_DOC=OFF" }
- { name: "gcc_no_zstd", cc: "gcc", cxx: "g++", buildargs: "-DENABLE_ZSTD=OFF -DENABLE_DOC=OFF" }
- { name: "gcc_coverage", cc: "gcc", cxx: "g++", buildargs: "-DENABLE_CODE_COVERAGE=ON" }
- { name: "clang", cc: "clang", cxx: "clang++", buildargs: "" }
@@ -33,6 +34,8 @@ jobs:
run: |
sudo apt-get update -qq
sudo apt-get --yes --no-install-recommends install ${{ env.WEECHAT_DEPENDENCIES }}
# uninstall php imagick as is causes a crash when loading php plugin (see #2009)
sudo apt-get --yes purge php8.1-imagick
sudo -H pip3 install --ignore-installed msgcheck
- name: Check gettext files
@@ -82,7 +85,6 @@ jobs:
matrix:
os:
- macos-12
- macos-11
config:
- { name: "gcc", cc: "gcc", cxx: "g++" }
- { name: "clang", cc: "clang", cxx: "clang++" }
+2
View File
@@ -81,10 +81,12 @@ Alphabetically:
* Lázaro A.
* Leonid Evdokimov
* Linus Heckemann
* LuK1337
* Maarten de Vries
* Mantas Mikulėnas (grawity)
* Marco Paolone
* Marco Sirabella
* Mario Campos
* Mateusz Poszwa
* Matt Robinson
* Matthew Horan
+11 -15
View File
@@ -99,6 +99,7 @@ option(ENABLE_NCURSES "Compile the Ncurses interface" ON)
option(ENABLE_HEADLESS "Compile the headless binary" ON)
option(ENABLE_NLS "Enable Native Language Support" ON)
option(ENABLE_LARGEFILE "Enable Large File Support" ON)
option(ENABLE_ZSTD "Enable Zstandard compression" ON)
option(ENABLE_ALIAS "Enable Alias plugin" ON)
option(ENABLE_BUFLIST "Enable Buflist plugin" ON)
option(ENABLE_CHARSET "Enable Charset plugin" ON)
@@ -200,20 +201,6 @@ if(ENABLE_LARGEFILE)
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES)
endif()
# Check for Gettext
if(ENABLE_NLS)
find_package(Gettext)
if(GETTEXT_FOUND)
add_definitions(-DENABLE_NLS)
find_package(Intl)
if(Intl_FOUND)
list(APPEND EXTRA_LIBS "${Intl_LIBRARIES}")
endif()
else()
message(SEND_ERROR "Gettext not found")
endif()
endif()
# Check for libgcrypt
find_package(GCRYPT REQUIRED)
add_definitions(-DHAVE_GCRYPT)
@@ -230,7 +217,10 @@ list(APPEND EXTRA_LIBS gnutls)
find_package(ZLIB REQUIRED)
# Check for zstd
pkg_check_modules(LIBZSTD REQUIRED libzstd)
if(ENABLE_ZSTD)
pkg_check_modules(LIBZSTD REQUIRED libzstd)
add_definitions(-DHAVE_ZSTD)
endif()
# Check for iconv
find_package(Iconv)
@@ -258,7 +248,13 @@ endif()
add_subdirectory(icons)
if(ENABLE_NLS)
find_package(Gettext REQUIRED)
add_definitions(-DENABLE_NLS)
find_package(Intl REQUIRED)
list(APPEND EXTRA_LIBS "${Intl_LIBRARIES}")
add_subdirectory(po)
else()
add_custom_target(translations COMMAND true)
endif()
add_subdirectory(src)
+156 -6
View File
@@ -10,18 +10,89 @@ This document lists all the changes for each version. +
For a list of important changes that require manual actions, please look at release notes.
[[v4.1.4]]
== Version 4.1.4 (under dev)
Bug fixes::
* core, relay: fix include directory of libzstd
* core: add missing mouse events "alt-ctrl-button2" and "alt-ctrl-button3"
* irc: fix crash in split of IRC message containing a newline if the server is not given
* python: fix truncation of unsigned long long integer returned by function string_parse_size
* script: always display list of scripts when searching scripts with `/script search` (issue #2077)
* script: fix default mouse keys (issue #2076)
* tcl: fix truncation of long integer returned by function hdata_long
* trigger: fix memory leak when adding a new trigger with `/trigger` command
Build::
* ruby: add detection of Ruby 3.3
[[v4.1.3]]
== Version 4.1.3 (2024-01-20)
Bug fixes::
* core: fix crash on plugin reload when using musl libc (issue #2052)
* core: fix infinite loop in display when the chat area is too small (issue #2053)
* irc: check if arguments are not NULL in some infos
* irc: fix info "irc_is_message_ignored" (issue #2059)
* irc: fix display of self messages when the message split fails due to inconsistent max lengths sent by the server in message 005
[[v4.1.2]]
== Version 4.1.2 (2023-12-03)
Bug fixes::
* core: fix value of buffer variable "num_history" when the value defined in option weechat.history.max_commands is reached
* core: remove incorrect warning when binding keys kbd:[F10] to kbd:[F20] (issue #2039)
* core: fix memory leak when config version is invalid or not supported
* core: fix crash when "config_version" is present in a configuration file without a value
* core: display an error on startup if environment variable "HOME" is not set
* irc: remove trailing "\r\n" in signals "irc_out" and "irc_outtags" when messages are queued
* irc: fix target buffer of IRC message 337 (whois reply: "is hiding their idle time")
* relay: close properly connection with the IRC client in case of server disconnection (issue #2038)
* ruby: fix use of NULL variable when displaying exception
[[v4.1.1]]
== Version 4.1.1 (2023-10-26)
Bug fixes::
* core: fix crash when a custom bar item name is already used by a default bar item (issue #2034)
* core: fix random timeouts when a lot of concurrent processes are launched with hook_process (issue #2033)
* irc: revert compute of nick colors to case sensitive way, deprecate again infos "irc_nick_color" and "irc_nick_color_name" (issue #194, issue #2032)
Build::
* core: make libintl.h required if CMake option ENABLE_NLS is enabled (issue #2031)
[[v4.1.0]]
== Version 4.1.0 (under dev)
== Version 4.1.0 (2023-10-15)
New features::
* core: add completion "eval_variables", used in completion of `/eval`
* core: add command `/sys` to show resource limits/usage and suspend WeeChat process, add key kbd:[Ctrl+z] to suspend WeeChat (issue #985)
* core: ignore key bindings with empty command
* core: add support of quotes in commands `/key bind` and `/key bindctxt`
* core: evaluate command given to `/repeat` with contextual variables (issue #2007)
* core: add option `callbacks` in command `/debug`
* core: add option type "enum" (issue #1973)
* core: add options weechat.buffer.* to save buffer properties set by user, add option `setauto` in command `/buffer` (issue #352)
* core: add parameters and key bindings to move to edges of current area with commands `/cursor go` and `/cursor move` (issue #1282)
* core: add variables "_chat_focused_line_bol" and "_chat_focused_line_eol" in focus data (issue #1955)
* api: add function hook_url, add option `url` in command `/debug` (issue #1723)
* api: add support of path to variable and hashtable comparison in function hdata_compare (issue #1066)
* api: add infos "nick_color_ignore_case" and "nick_color_name_ignore_case" (issue #194)
* api: add info "buffer" (issue #1962)
* buflist: add support of item names in command `/buflist refresh`, add completions "buflist_items" and "buflist_items_used"
* buflist: increase max number of buflist items from 3 to 5 (issue #1703)
* fset: add variable `allowed_values` in options, add options fset.color.allowed_values and fset.color.allowed_values_selected
* fset: allow long type name in type filter
* irc: add count for all nick modes in output of `/names` (issue #97, issue #2020)
* irc: add count and mode filter in command `/names` (issue #98)
* irc: compute color in case insensitive way, reintroduce infos "irc_nick_color" and "irc_nick_color_name", add support of server name (issue #194)
* irc: add buffer for /list reply, add options irc.color.list_buffer_line_selected, irc.color.list_buffer_line_selected_bg, irc.look.list_buffer_sort, irc.look.list_buffer_scroll_horizontal, irc.look.new_list_position, irc.look.list_buffer_topic_strip_colors (issue #1972)
* irc: display commands 716/717 in private buffer (if present) (issue #146)
* irc: create default options irc.ctcp.* when file irc.conf is created (issue #1974)
@@ -29,29 +100,108 @@ New features::
* irc: build dynamically the list of CTCPs supported in reply to "CTCP CLIENTINFO" (issue #1974)
* irc: remove Git revision and compilation date from CTCP VERSION reply (issue #1974)
* irc: remove default CTCP replies FINGER and USERINFO (issue #1974)
* script: allow jump to the last script with command `/script go end`
* irc, xfer: add support of passive DCC (issue #2004, issue #487)
* script: rename parameters up/down/go to -up/-down/-go in command `/script`
* script: allow jump to the last script with command `/script -go end`
* script: allow commands `/script autoload`, `/script noautoload`, `/script toggleautoload` with scripts not present in the repository (issue #1980)
* trigger: add options `-o`, `-ol`, `-i` and `-il` in command `/trigger list` (issue #1953)
Bug fixes::
* core: fix zombie processes after fork (hook process or connect) (issue #1994)
* core: fix generation of TOTP on Big Endian systems (issue #2021)
* core: fix cursor position after `/plugin list -i` or `/plugin list -il`
* core: display focus hashtable for debug even if no key is matching
* fset: add local key bindings during the buffer creation
* fset: remove extra spaces between min and max values when second format is used
* fset: fix mouse actions when second format is used
* fset: apply option fset.color.help_description (issue #1988)
* irc: move value `-all` at the end of completions for command `/ignore del`
* irc: fix memory leak when joining channels with keys
* irc: fix unexpected message sent to server when part of the second line of an IRC command (issue #1992)
* irc: fix display of country code in message 344 received as whois geo info (issue #1736)
* irc: add missing "account-tag" in list of supported capabilities
* irc: add channel in "autojoin" server option only when the channel is actually joined (issue #1990)
* relay: synchronize nick modes with IRC client upon connection (issue #1984)
* script: add local key bindings during the buffer creation
* script: add parameters up/down/go in `/help script` and command completion
* script: fix cursor position after `/script list -i` or `/script list -il`
* script: fix buffer used by command `/script list -i|-il|-o|-ol`
* xfer: display an error message when opening file for read or write fails (issue #2010)
Tests::
* core: add tests on GUI buffer functions
Build::
* core: fix build error if CMake option ENABLE_NLS is turned to off or if required dependencies are not found (issue #2026)
* core, logger, relay: make zstd dependency optional (issue #2024)
[[v4.0.8]]
== Version 4.0.8 (2024-01-20)
Bug fixes::
* core: fix crash on plugin reload when using musl libc (issue #2052)
* core: fix infinite loop in display when the chat area is too small (issue #2053)
* irc: check if arguments are not NULL in some infos
* irc: fix info "irc_is_message_ignored" (issue #2059)
* irc: fix display of self messages when the message split fails due to inconsistent max lengths sent by the server in message 005
[[v4.0.7]]
== Version 4.0.7 (2023-12-03)
Bug fixes::
* core: fix value of buffer variable "num_history" when the value defined in option weechat.history.max_commands is reached
* core: remove incorrect warning when binding keys kbd:[F10] to kbd:[F20] (issue #2039)
* core: fix memory leak when config version is invalid or not supported
* core: fix crash when "config_version" is present in a configuration file without a value
* core: display an error on startup if environment variable "HOME" is not set
* irc: remove trailing "\r\n" in signals "irc_out" and "irc_outtags" when messages are queued
* irc: fix target buffer of IRC message 337 (whois reply: "is hiding their idle time")
* relay: close properly connection with the IRC client in case of server disconnection (issue #2038)
* ruby: fix use of NULL variable when displaying exception
[[v4.0.6]]
== Version 4.0.6 (2023-10-26)
Bug fixes::
* core: fix crash when a custom bar item name is already used by a default bar item (issue #2034)
* core: fix generation of TOTP on Big Endian systems (issue #2021)
* irc: move value `-all` at the end of completions for command `/ignore del`
* irc: fix memory leak when joining channels with keys
Build::
* core: fix build error if CMake option ENABLE_NLS is turned to off or if required dependencies are not found (issue #2026, issue #2031)
[[v4.0.5]]
== Version 4.0.5 (2023-09-24)
New features::
* core: automatically backup config file read if it has an unsupported version (issue #2013)
* core: display a message when a configuration file is updated to a newer version
* python: make stub (weechat.pyi) compatible with Python 3.8 and 3.9 (issue #2006)
Bug fixes::
* irc: add option irc.look.open_pv_buffer_echo_msg to open private buffer on self message when capability echo-message is enabled (issue #2016)
* irc: fix title of private buffers wrongly set to own address when capability echo-message is enabled (issue #2016)
* irc: fix autojoin of channels when private buffers are opened (issue #2012)
* irc: fix string comparison when CASEMAPPING is set to "ascii"
* script: fix removal of script in system directory while trying to install a script (issue #2019)
* script: fix autoload of multiple scripts at once with `/script autoload` (issue #2018)
* script: fix crash when a `/script` command triggers another `/script` command (issue #923)
* xfer: fix memory leak on plugin unload
Tests::
* irc: add tests on server functions
[[v4.0.4]]
== Version 4.0.4 (2023-08-22)
@@ -97,8 +247,8 @@ Bug fixes::
* core: fix renaming of options with command `/item rename` (issue #1978)
* core: don't send "key_pressed" signal again for the same key press (issue #1976)
* core: don't send "key_combo_*" signals for incomplete keys (issue #1976)
* core: add key ctrl-backspace in /help key (issue #1975)
* core: keep keys ctrl-H and ctrl-? (in lower case) if they were manually bound to custom commands in a previous version
* core: add key kbd:[Ctrl+Backspace] in /help key (issue #1975)
* core: keep keys `ctrl-H` and `ctrl-?` (in lower case) if they were manually bound to custom commands in a previous version
Tests::
@@ -134,7 +284,7 @@ New features::
* core: insert multiple pasted lines in input instead of sending immediately, add keys to move and delete in a single line and whole input, add option weechat.look.input_multiline_lead_linebreak (issue #1502, issue #1503, issue #1504)
* core: render newline characters in chat line messages (issue #1908)
* core: don't split on newline characters in printf_date_tags when input_multiline is set (issue #1909)
* core: add key @kbd:[l] in cursor mode to quote line, add variable "_chat_focused_line" in function hashtable sent to hook_focus callback (issue #1913, issue #1914)
* core: add key kbd:[l] (lower `L`) in cursor mode to quote line, add variable "_chat_focused_line" in function hashtable sent to hook_focus callback (issue #1913, issue #1914)
* core: add option `split_return` in command `/input` (issue #1916)
* core: send all command line parameters not beginning with a dash to all plugins
* core: add command `/reset` to reset options to their default values
@@ -1748,7 +1898,7 @@ New features::
* core: add option weechat.look.hotlist_add_conditions, remove option weechat.look.hotlist_add_buffer_if_away
* core: add option weechat.look.hotlist_remove (issue #99)
* core: add options `-beep` and `-current` in command `/print`
* core: add bare display mode for easy text selection and click on URLs, new key: kbd:[Alt+l] (`L`), new option "bare" in command `/window`, new options: weechat.look.bare_display_exit_on_input and weechat.look.bare_display_time_format
* core: add bare display mode for easy text selection and click on URLs, new key: kbd:[Alt+l] (lower `L`), new option "bare" in command `/window`, new options: weechat.look.bare_display_exit_on_input and weechat.look.bare_display_time_format
* core: add signals "key_combo_{default|search|cursor}"
* core: add terabyte unit for size displayed
* core: display a warning in case of inconsistency between the options weechat.look.save_{config|layout}_on_exit
+114 -1
View File
@@ -11,8 +11,57 @@ It is recommended to read it when upgrading to a new stable version. +
For a complete list of changes, please look at ChangeLog.
[[v4.1.4]]
== Version 4.1.4 (under dev)
[[v4.1.4_script_keys]]
=== Script keys
Some arguments to the `/script` command were renamed in version 4.1.0, but the
keys using these arguments were not changed at same time.
They're now using the new arguments by default, but you must reset manually
the keys with the following commands:
----
/reset weechat.key_mouse.@chat(script.scripts):button1
/reset weechat.key_mouse.@chat(script.scripts):button2
/reset weechat.key_mouse.@chat(script.scripts):wheeldown
/reset weechat.key_mouse.@chat(script.scripts):wheelup
----
[[v4.1.3]]
== Version 4.1.3 (2024-01-20)
No release notes.
[[v4.1.2]]
== Version 4.1.2 (2023-12-03)
No release notes.
[[v4.1.1]]
== Version 4.1.1 (2023-10-26)
[[v4.1.1_custom_bar_items]]
=== Custom bar items
Custom bar items must now have a different name than default bar items
(for example the custom bar item name `time` is now forbidden).
If you have such names in your config, WeeChat will now fail to load them
(this should not happen anyway, since such bar items can not be properly used
or can cause a crash of WeeChat).
[[v4.1.1_nick_color_infos]]
=== Nick color infos
The infos irc_nick_color and irc_nick_color_name are deprecated again, and the
algorithm to compute IRC nick colors has been reverted to case sensitive. +
The server name has been removed from arguments.
[[v4.1.0]]
== Version 4.1.0 (under dev)
== Version 4.1.0 (2023-10-15)
[[v4.1.0_cursor_mode_keys]]
=== New keys to move in cursor mode
@@ -59,6 +108,42 @@ back with the two following commands:
They will then be advertised in reply to "CTCP CLIENTINFO", which is now built
dynamically with these options.
[[v4.1.0_nick_color_infos]]
=== Nick color infos
Two infos to get nick colors have been added: nick_color_ignore_case and
nick_color_name_ignore_case. +
They are similar to nick_color and nick_color_name, except they take as second
argument a range of chars to apply on the nick: the nick is converted to lower
case using this range of chars.
The infos irc_nick_color and irc_nick_color_name, that were deprecated since
version 1.5 are now used again, with a change in parameter: the server is now
optional before the nick: "server,nick". +
The nick is first converted to lower case, following the value of CASEMAPPING
on the server, then hashed to compute the color. +
That means the color for a nick is now case insensitive (in the way IRC servers
are case insensitive, so with a limited range of chars only).
If a script was using this info with a comma in nickname (which should not happen
anyway), this is now interpreted as the server name, and the script must be
modified. +
Anyway, it is recommended to always give the server name to respect the
CASEMAPPING of the server and prevent any issue with a comma in the nickname.
For example nick color of "alice" and "ALICE" is now always guaranteed to be the
same:
----
# with server name (recommended)
weechat.info_get("irc_nick_color", "libera,alice") == weechat.info_get("irc_nick_color", "libera,ALICE")
weechat.info_get("irc_nick_color_name", "libera,alice") == weechat.info_get("irc_nick_color_name", "libera,ALICE")
# without server name (allowed but not recommended, kept for compatibility)
weechat.info_get("irc_nick_color", "alice") == weechat.info_get("irc_nick_color", "ALICE")
weechat.info_get("irc_nick_color_name", "alice") == weechat.info_get("irc_nick_color_name", "ALICE")
----
[[v4.1.0_fset_allowed_values]]
=== Allowed values for options on fset buffer
@@ -84,6 +169,34 @@ You can reset it with this command:
/reset weechat.key_mouse.@chat(fset.fset):button1
----
[[v4.0.8]]
== Version 4.0.8 (2024-01-20)
No release notes.
[[v4.0.7]]
== Version 4.0.7 (2023-12-03)
No release notes.
[[v4.0.6]]
== Version 4.0.6 (2023-10-26)
[[v4.0.6_custom_bar_items]]
=== Custom bar items
Custom bar items must now have a different name than default bar items
(for example the custom bar item name `time` is now forbidden).
If you have such names in your config, WeeChat will now fail to load them
(this should not happen anyway, since such bar items can not be properly used
and can cause a crash of WeeChat).
[[v4.0.5]]
== Version 4.0.5 (2023-09-24)
No release notes.
[[v4.0.4]]
== Version 4.0.4 (2023-08-22)
+22 -20
View File
@@ -45,26 +45,28 @@ set(CMAKE_REQUIRED_INCLUDES ${LIBINTL_INCLUDE})
check_include_files(libintl.h HAVE_LIBINTL_H)
if(HAVE_LIBINTL_H)
check_function_exists(dgettext LIBC_HAS_DGETTEXT)
if(LIBC_HAS_DGETTEXT)
set(GETTEXT_FOUND TRUE)
else()
find_library(LIBINTL_LIBRARY NAMES intl
PATHS
/usr/local/lib
/usr/lib
)
if(LIBINTL_LIBRARY)
if(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
set(CMAKE_REQUIRED_LIBRARIES "iconv")
check_library_exists(${LIBINTL_LIBRARY} "libintl_dgettext" "" LIBINTL_HAS_DGETTEXT)
else()
check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT)
endif()
if(LIBINTL_HAS_DGETTEXT)
set(GETTEXT_FOUND TRUE)
endif()
if(NOT HAVE_LIBINTL_H)
message(SEND_ERROR "Header libintl.h not found, required if ENABLE_NLS is enabled")
endif()
check_function_exists(dgettext LIBC_HAS_DGETTEXT)
if(LIBC_HAS_DGETTEXT)
set(GETTEXT_FOUND TRUE)
else()
find_library(LIBINTL_LIBRARY NAMES intl
PATHS
/usr/local/lib
/usr/lib
)
if(LIBINTL_LIBRARY)
if(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
set(CMAKE_REQUIRED_LIBRARIES "iconv")
check_library_exists(${LIBINTL_LIBRARY} "libintl_dgettext" "" LIBINTL_HAS_DGETTEXT)
else()
check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT)
endif()
if(LIBINTL_HAS_DGETTEXT)
set(GETTEXT_FOUND TRUE)
endif()
endif()
endif()
+1 -1
View File
@@ -37,7 +37,7 @@ if(PKG_CONFIG_FOUND)
# set specific search path for macOS
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/ruby/lib/pkgconfig")
endif()
pkg_search_module(RUBY ruby-3.2 ruby-3.1 ruby-3.0 ruby-2.7 ruby-2.6 ruby-2.5 ruby-2.4 ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9 ruby)
pkg_search_module(RUBY ruby-3.3 ruby-3.2 ruby-3.1 ruby-3.0 ruby-2.7 ruby-2.6 ruby-2.5 ruby-2.4 ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9 ruby)
if(RUBY_FOUND AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# FIXME: weird hack: hardcoding the Ruby lib location on macOS
set(RUBY_LDFLAGS "${RUBY_LDFLAGS} -L/usr/local/opt/ruby/lib")
-1
View File
@@ -1,4 +1,3 @@
#cmakedefine HAVE_LIBINTL_H
#cmakedefine HAVE_SYS_RESOURCE_H
#cmakedefine HAVE_FLOCK
#cmakedefine HAVE_LANGINFO_CODESET
+6
View File
@@ -1,3 +1,9 @@
weechat (4.0.5-1) unstable; urgency=medium
* New upstream release
-- Emmanuel Bouthenot <kolter@debian.org> Sun, 24 Sep 2023 07:49:41 +0000
weechat (4.0.2-1) unstable; urgency=medium
* New upstream release (Closes: #1040248)
+42 -28
View File
@@ -613,6 +613,14 @@ Sollte die macOS Terminal Applikation genutzt werden, empfiehlt es sich,
die Option "Use option as meta key" in den Menü-Einstellungen zu aktivieren.
Dadurch kann man die kbd:[Option] Taste als Meta-Taste verwenden.
[[enter_key]]
=== Einige Tasten, einschließlich Enter, funktionieren nicht. Weshalb?
Wenn eine WeeChat Version < 4.0.0 mit Konfigurationsdateien ausgeführt wird,
die von einer Weechat Version ≥ 4.0.0 erstellt wurde, sind die Tastennamen ungültig und viele Tasten funktionieren überhaupt nicht mehr. +
Um dies zu reparieren, muss WeeChat beendet und alle Einträge aus dem Abschnitt `[key*]` innerhalb der weechat.conf entfernt werden.
Wenn WeeChat erneut gestartet wird, wird die Standardtastenbelegung neu erstellt.
[[customize_key_bindings]]
=== Wie kann ich die Tastaturbelegung anpassen?
@@ -993,35 +1001,19 @@ die Buffer-Eigenschaft genutzt werden, um das maximale Hotlist-Level für einige
oder pro Gruppe von Buffern (wie IRC-Server).
Um nun Highlights (Hervorhebungen) für bestimmte Nicks zu deaktivieren, muss
man die entsprechende Eigenschaft auf 2 setzen:
man die entsprechende Eigenschaft auf 2 setzen.
Für den aktuellen Buffer:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
Diese Buffereigenschaft wird aber nicht permanent in der Konfiguration
gespeichert. Um diese Eigenschaften permanent zu verwenden, muss man
das Skript _buffer_autoset.py_ nutzen:
Für alle Kanäle auf dem Server "libera":
----
/script install buffer_autoset.py
/set weechat.buffer.irc.libera.*.hotlist_max_level_nicks_add joe:2,mike:2
----
Um zum Beispiel Highlights (Hervorhebungen) von Nick "mike" im Kanal
#weechat auf dem IRC Server libera zu deaktivieren:
----
/buffer_autoset add irc.libera.#weechat hotlist_max_level_nicks_add mike:2
----
Um dies auf den kompletten libera Server anzuwenden:
----
/buffer_autoset add irc.libera hotlist_max_level_nicks_add mike:2
----
Für weitere Beispiele, siehe `+/help buffer_autoset+`.
[[irc_target_buffer]]
=== Wie kann ich bei zusammengefügten Buffern den Zielbuffer ändern (z.B. bei einem Server-Buffer)?
@@ -1154,10 +1146,8 @@ Damit WeeChat weniger Speicher benötigt, solltest Du folgende Tipps umsetzen:
Man sollte sich die Tipps zum <<memory_usage,Speicherverbrauch>> ansehen
und zusätzlich diese Tipps beherzigen:
// TRANSLATION MISSING
* "nicklist"-Bar sollte versteckt werden: `/bar hide nicklist` (key: kbd:[Alt+Shift+N]).
// TRANSLATION MISSING
* Disable "buflist": `/buflist disable` (key: kbd:[Alt+Shift+B]).
* "nicklist"-Bar sollte versteckt werden: `/bar hide nicklist` (Taste: kbd:[Alt+Shift+N]).
* deaktiviere "buflist": `/buflist disable` (Taste: kbd:[Alt+Shift+B]).
* die Sekundenanzeigen in der Statusbar sollte deaktiviert werden:
`+/set weechat.look.item_time_format "%H:%M"+` (dies ist die Standardeinstellung)
* die Echtzeit Rechtschreibkorrektur sollte deaktiviert werden (falls sie aktiviert wurde):
@@ -1185,9 +1175,7 @@ Deaktiviere die automatische Antwort für alle CTCP Anfragen:
/set irc.ctcp.ping ""
----
// TRANSLATION MISSING
With WeeChat < 4.1.0, other CTCP queries were replied by default and must be
disabled as well:
Mit WeeChat < 4.1.0 wurden andere CTCP-Anfragen standardmäßig beantwortet und müssen ebenfalls deaktiviert werden:
----
/set irc.ctcp.finger ""
@@ -1229,6 +1217,32 @@ Kennwörter (sofern sie nicht mit dem Befehl `/secure` in _sec.conf_ gesichert w
Siehe link:weechat_user.de.html#files_and_directories[Benutzerhandbuch / Dateien und Verzeichnisse ^↗^^]
für weitere Informationen über Konfigurationsdateien.
[[move_to_another_device]]
=== Ich möchte mein WeeChat auf ein anderes Gerät verschieben und meine Konfiguration behalten. Was muss ich kopieren?
Überprüfen Sie zunächst die von WeeChat verwendeten Verzeichnisse mit diesem Befehl: `/debug dirs`. +
Die Verzeichnisse home/config und home/data müssen kopiert werden (alle Dateien und Unterverzeichnisse).
Falls beispielsweise XDG-Verzeichnisse verwendet werden (Standard bei WeeChat ≥ 3.2), sollten die
Verzeichnisse `$HOME/.config/weechat` und `$HOME/.local/share/weechat` lauten. +
Sollte ein einzelnes Verzeichnis verwenden werden (Standard bei WeeChat < 3.2), sollte das Verzeichnis
`$HOME/.weechat` lauuten.
[IMPORTANT]
Die WeeChat-Version auf dem Zielgerät muss größer oder gleich der Version sein des Ausganggerätes. +
Ein Downgrade der WeeChat-Konfiguration wird *NICHT UNTERSTÜTZT* und kann zu Schäden führen und ein
unbrauchbares WeeChat verursachen.
Schritte:
. Weechat beenden: `/quit` (oder `/upgrade -quit`, falls eine Sitzung fortgesetzt werden soll,
einschließlich des Inhalts aller Buffer).
. Kopieren Sie alle Verzeichnisse, Unterverzeichnisse und Dateien auf das neue Gerät und behalten Sie die
Namen und Berechtigungen bei.
. Optional: Kopieren Sie alle Dateien außerhalb dieser Verzeichnisse, die auf Ihre Konfiguration verweisen
(es wird nicht empfohlen, Dateien außerhalb von WeeChat-Verzeichnissen zu verwenden).
. WeeChat auf dem neuen Gerät starten: `weechat` (oder `weechat --upgrade`, falls die Sitzung gesichert wurde).
[[development]]
== Entwicklung
+128 -86
View File
@@ -135,10 +135,6 @@ Die folgende Tabelle zeigt eine Auflistung der Pakete, die zum Erstellen von Wee
| Logger-Erweitertung: Kompression von rotierenden Protokolldateien (gzip). +
Relay-Erweiterung: Kompression von Nachrichten (WeeChat -> client) with https://zlib.net/[zlib ^↗^^] (weechat protocol). +
Script-Erweiterung: Lesen der Repository-Indexdatei (gzip).
| libzstd-dev | ≥ 0.8.1
| Logger-Erweiterung: Kompression von rotierenden Protokolldateien. +
Relay-Erweiterung: Kompression von Nachrichten (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat protocol).
|===
[NOTE]
@@ -152,26 +148,68 @@ WeeChat optional sind:
[width="100%",cols="5,^3,.^15",options="header"]
|===
| Paket ^(1)^ | Version | Funktionen
| {cpp} compiler (pass:[g++ / clang++]) | | zum Erstellen der Binärdatei und um Test auszuführen, JavaScript Erweiterung.
| gettext | | Internationalisierung (Übersetzung der Mitteilungen; Hauptsprache ist englisch).
| ca-certificates | | Zertifikate für TLS Verbindungen.
| libaspell-dev / libenchant-dev | | Spell Erweiterung.
| python3-dev | ≥ 3.0 | Python Erweiterung.
| libperl-dev | | Perl Erweiterung.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1 | Ruby Erweiterung.
| liblua5.4-dev | | Lua Erweiterung.
| tcl-dev | ≥ 8.5 | Tcl Erweiterung.
| guile-3.0-dev | ≥ 2.0 | Guile (scheme) Erweiterung.
| libv8-dev | ≤ 3.24.3 | JavaScript Erweiterung.
| php-dev | ≥ 7.0 | PHP Erweiterung.
| libphp-embed | ≥ 7.0 | PHP Erweiterung.
| libxml2-dev | | PHP Erweiterung.
| libargon2-dev | | PHP Erweiterung (wenn PHP ≥ 7.2).
| libsodium-dev | | PHP Erweiterung (wenn PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4 | zum Erstellen der man page und der Dokumentation.
| ruby-pygments.rb | | Build Dokumentation.
| libcpputest-dev | ≥ 3.4 | zum Erstellen und um Test auszuführen.
| Paket ^(1)^ | Version | Funktionen
| {cpp} compiler (pass:[g++ / clang++]) |
| zum Erstellen der Binärdatei und um Test auszuführen, JavaScript Erweiterung.
| gettext |
| Internationalisierung (Übersetzung der Mitteilungen; Hauptsprache ist englisch).
| ca-certificates |
| Zertifikate für TLS Verbindungen.
| libzstd-dev | ≥ 0.8.1
| Logger-Erweiterung: Kompression von rotierenden Protokolldateien (zstandard). +
Relay-Erweiterung: Kompression von Nachrichten (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat protocol).
| libaspell-dev / libenchant-dev |
| Spell Erweiterung.
| python3-dev | ≥ 3.0
| Python Erweiterung.
| libperl-dev |
| Perl Erweiterung.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1
| Ruby Erweiterung.
| liblua5.4-dev |
| Lua Erweiterung.
| tcl-dev | ≥ 8.5
| Tcl Erweiterung.
| guile-3.0-dev | ≥ 2.0
| Guile (scheme) Erweiterung.
| libv8-dev | ≤ 3.24.3
| JavaScript Erweiterung.
| php-dev | ≥ 7.0
| PHP Erweiterung.
| libphp-embed | ≥ 7.0
| PHP Erweiterung.
| libxml2-dev |
| PHP Erweiterung.
| libargon2-dev |
| PHP Erweiterung (wenn PHP ≥ 7.2).
| libsodium-dev |
| PHP Erweiterung (wenn PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4
| zum Erstellen der man page und der Dokumentation.
| ruby-pygments.rb |
| Build Dokumentation.
| libcpputest-dev | ≥ 3.4
| zum Erstellen und um Test auszuführen.
|===
[NOTE]
@@ -212,7 +250,7 @@ $ make install
Optionen für CMake können mit dem Format, `-DOPTION=VALUE`, genutzt werden.
Liste von häufig verwendeten Optionen:
Liste der verfügbaren Optionen:
[width="100%",cols="3m,3,3m,10",options="header"]
|===
@@ -266,6 +304,9 @@ Liste von häufig verwendeten Optionen:
| ENABLE_GUILE | `ON`, `OFF` | ON
| kompiliert <<scripting_plugins,Guile Erweiterung>> (Scheme).
| ENABLE_HEADLESS | `ON`, `OFF` | ON
| Kompilieren der headless Binärdatei.
| ENABLE_IRC | `ON`, `OFF` | ON
| kompiliert <<irc,IRC Erweiterung>>.
@@ -324,6 +365,9 @@ Liste von häufig verwendeten Optionen:
| ENABLE_XFER | `ON`, `OFF` | ON
| kompiliert <<xfer,Xfer Erweiterung>>.
| ENABLE_ZSTD | `ON`, `OFF` | ON
| aktiviere https://facebook.github.io/zstd/[Zstandard ^↗^^] Kompression.
| ENABLE_TESTS | `ON`, `OFF` | OFF
| kompiliert Testumgebung.
@@ -899,8 +943,10 @@ andere Items die zur Verfügung stehen (die aber nicht standardmäßig in einer
| buffer_nicklist_count_all | `4` | Anzahl der sichtbaren Gruppen und Nicks in der Nickliste.
| buffer_nicklist_count_groups | `0` | Anzahl der sichtbaren Gruppen in der Nickliste.
| buffer_short_name | `#test` | Kurzname des aktuellen Buffers.
| buflist2 | `1.weechat` | List der Buffer, zweites Bar-Item (siehe Option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist3 | `1.weechat` | List der Buffer, drittes Bar-Item (siehe Option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist2 | `1.weechat` | Liste der Buffer, zweites Bar-Item (siehe Option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist3 | `1.weechat` | Liste der Buffer, drittes Bar-Item (siehe Option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist4 | `1.weechat` | Liste der Buffer, viertes Bar-Item (siehe Option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist5 | `1.weechat` | Liste der Buffer, fünftes Bar-Item (siehe Option <<option_buflist.look.use_items,buflist.look.use_items>>).
| fset | `+buflist.look.sort: …+` | Hilfstext zur aktuell ausgewählten Option im Fset-Buffer.
| irc_channel | `#test` | aktueller Name des IRC Kanals.
| irc_host | `+user@host.com+` | aktueller IRC Host.
@@ -1427,7 +1473,8 @@ Externe Erweitertungen und Skripte können andere lokale Variablen definieren un
=== Liste der Buffer
Die Buflist-Erweiterung dient dazu eine Liste der geöffneten Buffer in einer Bar-Item, mit Namen
"buflist", darzustellen (zwei weiere Bar-Items "buflist2" und "buflist3" sind zusätzlich verfügbar). +
"buflist", darzustellen (vier weitere Bar-Items sind dabei verfügbar "buflist2", "buflist3", "buflist4"
und "buflist5"). +
Eine Standardbar, "buflist", wird beim Programmstart automatisch mit folgendem Inhalt erstellt.
[[buflist_commands]]
@@ -1558,6 +1605,15 @@ Sie können mit dem Befehl <<command_weechat_key,/key>> geändert und neue hinzu
| kbd:[Ctrl+↓] | ruft nächsten Befehl/Nachricht aus dem globalen Verlaufsspeicher auf (für alle Buffer). | `+/input history_global_next+`
|===
[[key_bindings_cmdline_system]]
==== System
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Taste | Beschreibung | Befehl
| kbd:[Ctrl+z] | Breche den Weechat-Prozess ab | `+/sys suspend+`
|===
[[key_bindings_buffers]]
=== Buffer
@@ -1750,10 +1806,10 @@ wurde (Befehl: `+/mouse toggle+`).
| kbd:[▼] | - | chat: /list buffer | gehe fünf Zeilen im /list-Buffer nach unten. | `+/list -down 5+`
| kbd:[■ □ □] | - | chat: /list buffer | Zeile im /list-Buffer auswählen. | `+/window ${_window_number};/list -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat: /list buffer | tritt dem IRC-Kanal, in der ausgewählten Zeile, bei. | `+hsignal:irc_list_mouse+`
| kbd:[▲] | - | chat: script buffer | fünf Zeilen nach oben blättern, im Script-Buffer. | `+/script up 5+`
| kbd:[▼] | - | chat: script buffer | fünf Zeilen nach unten blättern, im Script-Buffer. | `+/script down 5+`
| kbd:[■ □ □] | - | chat: script buffer | wählt einen Eintrag im Script-Buffer aus. | `+/script go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat: script buffer | installiert/entfernt ein Skript. | `+/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[▲] | - | chat: script buffer | fünf Zeilen nach oben blättern, im Script-Buffer. | `+/script -up 5+`
| kbd:[▼] | - | chat: script buffer | fünf Zeilen nach unten blättern, im Script-Buffer. | `+/script -down 5+`
| kbd:[■ □ □] | - | chat: script buffer | wählt einen Eintrag im Script-Buffer aus. | `+/script -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat: script buffer | installiert/entfernt ein Skript. | `+/script -go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[■ □ □] | up / left | buflist | verschiebt Buffer in der Reihenfolge nach unten. | Signal `+buflist_mouse+`.
| kbd:[■ □ □] | down / right | buflist | verschiebt Buffer in der Reihenfolge nach oben. | Signal `+buflist_mouse+`.
| kbd:[■ □ □] | - | buflist | wechselt zum Buffer (oder zum vorherigen Buffer, falls der aktuell genutzte Buffer angewählt wurde). | Signal `+buflist_mouse+`.
@@ -1816,8 +1872,8 @@ Diese Tasten und Aktionen werden im fset-Buffer verwendet (siehe <<fset,Fset Erw
| kbd:[Ctrl+l] (`L`) | | der Bildschirm wird neu gezeichnet. | `+/fset -refresh+`
| | `$` | Optionen neu einlesen (markierte Optionen werden beibehalten). |
| | `$$` | Optionen neu einlesen (Markierungen von Optionen werden dabei gelöscht). |
| kbd:[Alt+p] | | Umschalten der Beschreibung von Erweiterungen (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | | Hilfe-Bar Ein-/Ausschalten. | `+/bar toggle fset+`
| kbd:[Alt+p] | `p` | Umschalten der Beschreibung von Erweiterungen (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | `v` | Hilfe-Bar Ein-/Ausschalten. | `+/bar toggle fset+`
| | `s:x,y` | sortiert Optionen nach Bereichen x,y (siehe Option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /set fset.look.sort x,y+`
| | `s:` | setzt Sortierung wieder auf Standardwerte (siehe Option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /unset fset.look.sort+`
| | `w:xxx` | exportiert Optionen in Datei "xxx". | `+/fset -export xxx+`
@@ -1871,17 +1927,22 @@ Diese Tasten und Aktionen werden im fset-Buffer verwendet (siehe <<script_manage
[width="100%",cols="^.^3,^.^2,.^8,.^5",options="header"]
|===
| Taste | Action ^(1)^ | Beschreibung | Befehl
| kbd:[↑] | | eine Zeile nach oben. | `+/script up+`
| kbd:[↓] | | eine Zeile nach unten. | `+/script down+`
| kbd:[↑] | | eine Zeile nach oben. | `+/script -up+`
| kbd:[↓] | | eine Zeile nach unten. | `+/script -down+`
| kbd:[PgUp] | | eine Seite hoch blättern. | `+/window page_up+`
| kbd:[PgDn] | | eine Seite nach unten blättern. | `+/window page_down+`
| kbd:[Alt+i] | `i` | Skript installieren. | `+/script install+`
| kbd:[Alt+r] | `r` | Skript entfernen. | `+/script remove+`
| kbd:[Alt+l] (`L`) | `l` | Skript laden. | `+/script load+`
| kbd:[Alt+l] | `l` | Skript laden. | `+/script load+`
| kbd:[Alt+L] | `L` | Skript neu laden. | `+/script reload+`
| kbd:[Alt+u] | `u` | Skript wird beendet. | `+/script unload+`
| kbd:[Alt+Shift+A] | `A` | das Skript wird in das autoload-Verzeichnis eingebunden. | `+/script toggleautoload+`
| kbd:[Alt+h] | `h` | Skript wird gehalten bzw. freigegeben. | `+/script hold+`
| kbd:[Alt+v] | `v` | Skript Quelltext anzeigen. | `+/script show+`
| | `s:x,y` | Sortiert Skrips nach Feldern x,y (siehe Option <<option_script.look.sort,script.look.sort>>). |
| | `s:` | Sortierung auf den Standardwert zurücksetzen (siehe Option <<option_script.look.sort,script.look.sort>>). |
| | `$` | Liste aktualisieren. |
| | `q` | Buffer schließen. | `+/buffer close+`
|===
[NOTE]
@@ -2246,15 +2307,9 @@ und für jeden einzelen Nick kann ein maximler Hotlist-Level eingestellt wertden
Um zum Beispiel Highlights von "joe" und "mike" im aktuellen Buffer zu deaktivieren:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
[NOTE]
Die Buffer-Eigenschaft "hotlist_max_level_nicks" ist keine permanente Einstellung und wird nicht
in der Konfigurationsdatei gesichert. + Um diese Einstellung persistent zu machen benötigt man
das Skript _buffer_autoset.py_: Um das Skript zu installieren `+/script install buffer_autoset.py+`
und um eine Hilfe zu erhalten wie man es nutzt: `+/help buffer_autoset+`.
[[highlights]]
=== Hervorhebungen
@@ -2279,15 +2334,9 @@ Dies kann auch mit der Buffereigenschaft „highlight_disable_regex“ eingestel
Gleiches Beispiel, spezifisch für den aktuellen Buffer:
----
/buffer set highlight_disable_regex <flash.*>
/buffer setauto highlight_disable_regex <flash.*>
----
[NOTE]
Die Buffer-Eigenschaft "highlight_disable_regex" ist keine permanente Einstellung und wird nicht
in der Konfigurationsdatei gesichert. + Um diese Einstellung persistent zu machen benötigt man
das Skript _buffer_autoset.py_: Um das Skript zu installieren `+/script install buffer_autoset.py+`
und um eine Hilfe zu erhalten wie man es nutzt: `+/help buffer_autoset+`.
[[highlights_words]]
==== Worte als Highlights hinzufügen
@@ -2346,15 +2395,9 @@ die Eigenschaft des Buffers mittels "highlight_regex" anpasst.
Um zum Beispiel jede Nachricht im aktuellen Buffer als Highlight-Nachricht einzustufen:
----
/buffer set highlight_regex .*
/buffer setauto highlight_regex .*
----
[NOTE]
Die Buffer-Eigenschaft "highlight_regex" ist keine permanente Einstellung und wird nicht
in der Konfigurationsdatei gesichert. + Um diese Einstellung persistent zu machen benötigt man
das Skript _buffer_autoset.py_: Um das Skript zu installieren `+/script install buffer_autoset.py+`
und um eine Hilfe zu erhalten wie man es nutzt: `+/help buffer_autoset+`.
[[buffer_logging]]
=== Bufferprotokollierung
@@ -3261,30 +3304,31 @@ Sektion in Datei _weechat.conf_:
[width="100%",cols="3m,6m,16",options="header"]
|===
| Sektion | Steuerbefehl | Beschreibung
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Debug level, für Core und Erweitertungen (Optionen können in Sektion hinzugefügt/entfernt werden).
| startup | /set weechat.startup.* | Optionen die nach dem Programmstart ausgeführt werden.
| look | /set weechat.look.* | Erscheinungsbild.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Alternativnamen für Farben (Optionen können in Sektion hinzugefügt/entfernt werden).
| color | /set weechat.color.* | Farben.
| completion | /set weechat.completion.* | Optionen für Vervollständigung.
| history | /set weechat.history.* | Optionen für Befehlsverlauf (Befehle und Buffer).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Proxy Optionen.
| network | /set weechat.network.* | Netzwerk/TLS Optionen.
| plugin | /set weechat.plugin.* | Optionen für Erweiterungen.
| signal | /set weechat.signal.* | Optionen für Signale.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Optionen für die Bars.
| layout | <<command_weechat_layout,/layout>> | Layouts.
| notify | <<command_weechat_buffer,/buffer notify>> | Benachrichtigungsstufe für Buffer (Optionen können in Sektion hinzugefügt/entfernt werden).
| filter | <<command_weechat_filter,/filter>> | Filter.
| key | <<command_weechat_key,/key>> | Tastenbefehle in default context.
| key_search | <<command_weechat_key,/key>> | Tastenbefehle in search context.
| key_cursor | <<command_weechat_key,/key>> | Tastenbefehle in cursor context.
| key_mouse | <<command_weechat_key,/key>> | Tastenbefehle in mouse context.
| Sektion | Steuerbefehl | Beschreibung
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Debug level, für Core und Erweitertungen (Optionen können in Sektion hinzugefügt/entfernt werden).
| startup | /set weechat.startup.* | Optionen die nach dem Programmstart ausgeführt werden.
| look | /set weechat.look.* | Erscheinungsbild.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Alternativnamen für Farben (Optionen können in Sektion hinzugefügt/entfernt werden).
| color | /set weechat.color.* | Farben.
| completion | /set weechat.completion.* | Optionen für Vervollständigung.
| history | /set weechat.history.* | Optionen für Befehlsverlauf (Befehle und Buffer).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Proxy Optionen.
| network | /set weechat.network.* | Netzwerk/TLS Optionen.
| plugin | /set weechat.plugin.* | Optionen für Erweiterungen.
| signal | /set weechat.signal.* | Optionen für Signale.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Optionen für die Bars.
| layout | <<command_weechat_layout,/layout>> | Layouts.
| buffer | <<command_weechat_buffer,/buffer setauto>> | Eigenschaften, die beim Öffnen des Buffers automatisch angewendet werden.
| notify | <<command_weechat_buffer,/buffer notify>> | Benachrichtigungsstufe für Buffer (Optionen können in Sektion hinzugefügt/entfernt werden).
| filter | <<command_weechat_filter,/filter>> | Filter.
| key | <<command_weechat_key,/key>> | Tastenbefehle in default context.
| key_search | <<command_weechat_key,/key>> | Tastenbefehle in search context.
| key_cursor | <<command_weechat_key,/key>> | Tastenbefehle in cursor context.
| key_mouse | <<command_weechat_key,/key>> | Tastenbefehle in mouse context.
|===
Optionen:
@@ -4168,7 +4212,7 @@ die folgenden zusätzlichen Variablen sind verfügbar:
[width="100%",cols="2,4,8",options="header"]
|===
| Variable | Beschreibung | Wert/Beispiel
| `+${clientinfo}+` | Liste der CTCP Antworten | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| `+${clientinfo}+` | Liste der CTCP Antworten | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| `+${version}+` | WeeChat Version | `+4.1.0-dev+`
| `+${versiongit}+` | WeeChat Version + Git version ^(1)^ | `+4.1.0-dev (git: v4.0.0-51-g8f98b922a)+`
| `+${git}+` | Git Version ^(1)^ | `+v4.0.0-51-g8f98b922a+`
@@ -4191,11 +4235,9 @@ Die Standard-CTCP-Antworten sind:
[width="100%",cols="2,4,8",options="header"]
|===
| CTCP | Antwortformat | Beispiel
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| FINGER | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| SOURCE | `+${download}+` | `+https://weechat.org/download/+`
| TIME | `+${time}+` | `+Sat, 08 Jul 2023 21:11:19 +0200+`
| USERINFO | `+${username} (${realname})+` | `+Name (John Doe)+`
| VERSION | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
|===
+4
View File
@@ -140,6 +140,7 @@ WeeChat "core" is located in following directories:
|    wee-secure-config.c | Secured data options (file sec.conf).
|    wee-signal.c | Signal functions.
|    wee-string.c | Functions on strings.
|    wee-sys.c | System functions.
|    wee-upgrade-file.c | Internal upgrade system.
|    wee-upgrade.c | Upgrade for WeeChat core (buffers, lines, history, ...).
|    wee-url.c | URL transfer (using libcurl).
@@ -166,6 +167,7 @@ WeeChat "core" is located in following directories:
|       wee-hook-process.c | Hook "process".
|       wee-hook-signal.c | Hook "signal".
|       wee-hook-timer.c | Hook "timer".
|       wee-hook-url.c | Hook "url".
| gui/ | Functions for buffers, windows, ... (used by all interfaces).
|    gui-bar-item.c | Bar items.
|    gui-bar-window.c | Bar windows.
@@ -236,6 +238,7 @@ WeeChat "core" is located in following directories:
|       buflist.c | Main buflist functions.
|       buflist-bar-item.c | Buflist bar items.
|       buflist-command.c | Buflist commands.
|       buflist-completion.c | Buflist completions.
|       buflist-config.c | Buflist config options (file buflist.conf).
|       buflist-info.c | Buflist info/infolists/hdata.
|       buflist-mouse.c | Buflist mouse actions.
@@ -420,6 +423,7 @@ WeeChat "core" is located in following directories:
|          test-core-url.cpp | Tests: URLs.
|          test-core-utf8.cpp | Tests: UTF-8.
|          test-core-util.cpp | Tests: utility functions.
|          test-core-sys.cpp | Tests: system functions.
|       gui/ | Root of unit tests for interfaces.
|          test-gui-bar-window.cpp | Tests: bar window functions.
|          test-gui-buffer.cpp | Tests: buffer functions.
+42 -21
View File
@@ -583,6 +583,14 @@ If you are using the macOS Terminal app, enable the option
"Use option as meta key" in menu Settings/Keyboard after which you can use the
kbd:[Option] key as meta key.
[[enter_key]]
=== Some keys including Enter are not working, why?
If you run a WeeChat < 4.0.0 with configuration files created by any
version ≥ 4.0.0, the keys names become invalid and many keys won't work at all. +
To repair them, exit WeeChat, remove all sections `[key*]` from weechat.conf
and start WeeChat again: all default keys will be created.
[[customize_key_bindings]]
=== How can I customize key bindings?
@@ -925,35 +933,20 @@ link:weechat_user.en.html#max_hotlist_level_nicks[hotlist_max_level_nicks_add ^
buffer property to set the max hotlist level for some nicks, per buffer,
or per group of buffers (like IRC servers).
To only disable highlights, you'd have to set it to 2:
To only disable highlights, you'd have to set it to 2.
For the current buffer:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
This buffer property isn't stored in the configuration though.
To automatically reapply these buffer properties, you would need the
_buffer_autoset.py_ script:
For all channels on server "libera":
----
/script install buffer_autoset.py
/set weechat.buffer.irc.libera.*.hotlist_max_level_nicks_add joe:2,mike:2
----
For example, to permanently disable highlights from "mike" on #weechat
on the IRC server libera:
----
/buffer_autoset add irc.libera.#weechat hotlist_max_level_nicks_add mike:2
----
To apply it to the entire libera server instead:
----
/buffer_autoset add irc.libera hotlist_max_level_nicks_add mike:2
----
For more examples, see `+/help buffer_autoset+`.
[[irc_target_buffer]]
=== How can I change target buffer for commands on merged buffers (like buffer with servers)?
@@ -1151,6 +1144,34 @@ stored in _sec.conf_ with the `/secure` command).
See the link:weechat_user.en.html#files_and_directories[User's guide / Files and directories ^↗^^]
for more information about configuration files.
[[move_to_another_device]]
=== I want to move my WeeChat to another device and keep my config, what should I copy?
First check directories used by WeeChat with this command: `/debug dirs`. +
Directories home/config and home/data must be copied (all files and sub-directories).
For example if you're using XDG directories (default with WeeChat ≥ 3.2),
the directories should be `$HOME/.config/weechat` and `$HOME/.local/share/weechat`. +
If you're using a single directory (default with WeeChat < 3.2), the directory
should be `$HOME/.weechat`.
[IMPORTANT]
The WeeChat version on the new device must be greater than or equal to the version
on the initial device. +
Downgrading WeeChat configuration is *NOT SUPPORTED* and can break it,
leading to unusable WeeChat.
Steps:
. Quit Weechat: `/quit` (or `/upgrade -quit` if you want to resume the session,
which includes content of all buffers).
. Copy all directories, sub-directories and files to the new device, keeping
same names and permissions.
. Optional: copy any file outside these directories that you refer to in your
configuration (it's not recommended to use files outside WeeChat directories).
. Start WeeChat on the new device: `weechat` (or `weechat --upgrade` if you
saved the session).
[[development]]
== Development
+200 -53
View File
@@ -4028,18 +4028,28 @@ Supported hash algorithms:
[width="100%",cols="2,2,3,6",options="header"]
|===
| Value | Algorithm | Hash size | Notes
| `+crc32+` | CRC32 | 4 bytes (32 bits) | Not a hash algorithm in the cryptographic sense.
| `+md5+` | MD5 | 16 bytes (128 bits) | *Weak*, not recommended for cryptography usage.
| `+sha1+` | SHA-1 | 20 bytes (160 bits) | *Weak*, not recommended for cryptography usage.
| `+sha224+` | SHA-224 | 28 bytes (224 bits) |
| `+sha256+` | SHA-256 | 32 bytes (256 bits) |
| `+sha384+` | SHA-384 | 48 bytes (384 bits) |
| `+sha512+` | SHA-512 | 64 bytes (512 bits) |
| `+sha3-224+` | SHA3-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| Value | Algorithm | Hash size | Notes
| `+crc32+` | CRC32 | 4 bytes (32 bits) | Not a hash algorithm in the cryptographic sense.
| `+md5+` | MD5 | 16 bytes (128 bits) | *Weak*, not recommended for cryptography usage.
| `+sha1+` | SHA-1 | 20 bytes (160 bits) | *Weak*, not recommended for cryptography usage.
| `+sha224+` | SHA-224 | 28 bytes (224 bits) |
| `+sha256+` | SHA-256 | 32 bytes (256 bits) |
| `+sha384+` | SHA-384 | 48 bytes (384 bits) |
| `+sha512+` | SHA-512 | 64 bytes (512 bits) |
| `+sha512-224+` | SHA-512/224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.9.4.
| `+sha512-256+` | SHA-512/256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.9.4.
| `+sha3-224+` | SHA3-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+blake2b-160+` | BLAKE2B-160 | 20 bytes (160 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-256+` | BLAKE2B-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-384+` | BLAKE2B-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-512+` | BLAKE2B-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-128+` | BLAKE2S-128 | 16 bytes (128 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-160+` | BLAKE2S-160 | 20 bytes (160 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-224+` | BLAKE2S-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-256+` | BLAKE2S-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
|===
Return value:
@@ -4474,7 +4484,8 @@ Arguments:
* _to_: destination file
* _compressor_: the compressor to use, one of:
** _gzip_: gzip compression
** _zstd_: zstandard compression
** _zstd_: zstandard compression (available only if zstd was enabled when
WeeChat was compiled)
* _compression_level_: compression level, between 1 (fast, low compression) to
100 (slow, best compression)
@@ -6796,7 +6807,7 @@ def config_new_section(config_file: str, name: str,
callback_delete_option: str, callback_delete_option_data: str) -> str: ...
# example
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -6815,7 +6826,7 @@ def my_section_write_default_cb(data: str, config_file: str, section_name: str)
# return weechat.WEECHAT_CONFIG_WRITE_ERROR
# return weechat.WEECHAT_CONFIG_WRITE_MEMORY_ERROR
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -7057,7 +7068,7 @@ Script (Python):
# prototype
def config_new_option(config_file: str, section: str, name: str, type: str, description: str,
string_values: str, min: int, max: int,
default_value: str | None, value: str | None, null_value_allowed: int,
default_value: Union[str, None], value: Union[str, None], null_value_allowed: int,
callback_check_value: str, callback_check_value_data: str,
callback_change: str, callback_change_data: str,
callback_delete: str, callback_delete_data: str) -> str: ...
@@ -10015,7 +10026,6 @@ struct t_hook *weechat_hook_process (const char *command,
void *callback_data);
----
Arguments:
* _command_: command to launch in child process, URL _(WeeChat ≥ 0.3.7)_ or
@@ -10267,22 +10277,7 @@ available:
_/dev/null_.
|===
For command "url:...", following options are available (see
`+man curl_easy_setopt+` for a description of each option):
include::{autogendir}/autogen_api_url_options.en.adoc[tag=url_options]
[NOTE]
^(1)^ For options with type "mask", format is: "value1+value2+value3";
for options with type "list", the list items must be separated by a newline
(`\n`). +
^(2)^ When constants are available they must be used as value for option.
For URL, two extra options (strings) are allowed for input/output file:
* _file_in_: file to read and send with URLs (post file)
* _file_out_: write downloaded URL/file in this file (instead of standard
output)
For command "url:...", see available options in function <<_hook_url,hook_url>>.
Return value:
@@ -10442,6 +10437,156 @@ hook4 = weechat.hook_process_hashtable("sh",
20000, "my_process_cb", "")
----
==== hook_url
_WeeChat ≥ 4.1.0._
URL transfer.
Prototype:
[source,c]
----
struct t_hook *weechat_hook_url (const char *url,
struct t_hashtable *options,
int timeout,
int (*callback)(const void *pointer,
void *data,
const char *url,
struct t_hashtable *options,
struct t_hashtable *output),
const void *callback_pointer,
void *callback_data);
----
Arguments:
* _url_: URL
* _options_: options for URL transfer (see below); the hashtable is duplicated in
function, so it's safe to free it after this call
* _timeout_: timeout for URL transfer (in milliseconds): after this timeout,
the transfer is stopped (0 means no timeout)
* _callback_: function called when the transfer has ended, arguments and return
value:
** _const void *pointer_: pointer
** _void *data_: pointer
** _const char *url_: URL
** _struct t_hashtable *options_: options
** _struct t_hashtable *output_: result (keys and values are strings), which may
contain the following keys:
*** _response_code_: HTTP response code
*** _headers_: HTTP headers in response
*** _output_: standard output (set only if _file_out_ was not set in options)
*** _error_: error message (set only in case of error)
** return value:
*** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_
* _callback_pointer_: pointer given to callback when it is called by WeeChat
* _callback_data_: pointer given to callback when it is called by WeeChat;
if not NULL, it must have been allocated with malloc (or similar function)
and it is automatically freed when the hook is deleted
The following Curl options are available (see `+man curl_easy_setopt+` for
a description of each option):
include::{autogendir}/autogen_api_url_options.en.adoc[tag=url_options]
[NOTE]
^(1)^ For options with type "mask", format is: "value1+value2+value3";
for options with type "list", the list items must be separated by a newline
(`\n`). +
^(2)^ When constants are available they must be used as value for option.
These two extra options (strings) are allowed for input/output file:
[width="100%",cols="2,^1,7",options="header"]
|===
| Option | Type | Description
| file_in | string | file to read and send with URLs (post file)
| file_out | string | write downloaded URL/file in this file (instead of standard output)
|===
Return value:
* pointer to new hook, NULL if error occurred
C example:
[source,c]
----
int
my_url_cb (const void *pointer, void *data, const char *url,
struct t_hashtable *options, struct t_hashtable *output)
{
weechat_printf (NULL, "response_code: %s", weechat_hashtable_get (output, "response_code"));
weechat_printf (NULL, "headers: %s", weechat_hashtable_get (output, "headers"));
weechat_printf (NULL, "output: %s", weechat_hashtable_get (output, "output"));
weechat_printf (NULL, "error: %s", weechat_hashtable_get (output, "error"));
return WEECHAT_RC_OK;
}
/* example 1: output to a file */
struct t_hashtable *options_url1 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url1)
{
weechat_hashtable_set (options_url1, "file_out", "/tmp/weechat.org.html");
struct t_hook *my_url_hook = weechat_hook_url ("https://weechat.org/",
options_url1,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url1);
}
/* example 2: custom HTTP headers, output sent to callback */
struct t_hashtable *options_url2 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url2)
{
weechat_hashtable_set (options_url2, "httpheader",
"Header1: value1\n"
"Header2: value2");
struct t_hook *my_url_hook = weechat_hook_url ("http://localhost:8080/",
options_url2,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url2);
}
----
Script (Python):
[source,python]
----
# prototype
def hook_url(url: str, options: Dict[str, str], timeout: int, callback: str, callback_data: str) -> str: ...
# example
def my_url_cb(data: str, url: str, options: Dict[str, str], output: Dict[str, str]) -> int:
weechat.prnt("", "output: %s" % output)
return weechat.WEECHAT_RC_OK
# example 1: output to a file
hook1 = weechat.hook_url("https://weechat.org/",
{"file_out": "/tmp/weechat.org.html"},
20000, "my_url_cb", "")
# example 2: custom HTTP headers, output sent to callback
options = {
"httpheader": "\n".join([
"Header1: value1",
"Header2: value2",
]),
}
hook2 = weechat.hook_url("http://localhost:8080/", options, 20000, "my_url_cb", "")
----
==== hook_connect
_Updated in 1.5, 2.0._
@@ -10628,7 +10773,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
==== hook_line
_WeeChat ≥ 2.3, updated in 3.7, 4.1.0._
_WeeChat ≥ 2.3, updated in 3.7._
Hook a line to be printed in a buffer.
@@ -10699,13 +10844,13 @@ Line data sent to the callback is a hashtable, with following values
| Key | Value (formatted buffer) | Value (free buffer) | Examples
| buffer
| Comma-separated list of buffer pointers.
| Comma-separated list of buffer pointers.
| Buffer pointer.
| Buffer pointer.
| `+0x1234abcd+`
| buffer_name
| Comma-separated list of buffer names.
| Comma-separated list of buffer names.
| Buffer name.
| Buffer name.
| `+core.weechat+` +
`+irc.server.libera+` +
`+irc.libera.#weechat+`
@@ -10793,20 +10938,16 @@ in this hashtable):
| Key | Allowed value (formatted buffer) | Allowed value (free buffer) | Result
| buffer
| Comma-separated list buffer pointers (with formatted content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Comma-separated list buffer pointers (with free content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| The line is displayed on these buffers. +
| Pointer of a buffer with formatted content.
| Pointer of a buffer with free content.
| The line is displayed on this buffer. +
If the value is empty, the line is deleted (anything else in the hashtable
is then ignored); the next hooks of type "line" are not called.
| buffer_name
| Comma-separated list buffer names (with formatted content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Comma-separated list buffer names (with free content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| The line is displayed on these buffers. +
| Name of a buffer with formatted content.
| Name of a buffer with free content.
| The line is displayed on this buffer. +
If `buffer` is also set, the value of `+buffer_name+` has higher priority and is used. +
If the value is empty, the line is deleted (anything else in the hashtable
is then ignored); the next hooks of type "line" are not called.
@@ -18593,7 +18734,7 @@ for key in hash:
==== hdata_compare
_WeeChat ≥ 1.9._
_WeeChat ≥ 1.9, updated in 4.1.0._
Compare a hdata variable of two objects.
@@ -18609,8 +18750,8 @@ Arguments:
* _hdata_: hdata pointer
* _pointer1_: pointer to first WeeChat/plugin object
* _pointer2_: pointer to second WeeChat/plugin object
* _name_: variable name; for arrays, the name can be "N|name" where N is
the index in array (starting at 0), for example: "2|name"
* _name_: variable name or path to a variable name; for arrays, the name can be
"N|name" where N is the index in array (starting at 0), for example: "2|name"
* _case_sensitive_: 1 for case sensitive comparison of strings, otherwise 0
Return value:
@@ -18626,8 +18767,12 @@ C example:
struct t_hdata *hdata = weechat_hdata_get ("buffer");
struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat");
struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr");
weechat_printf (NULL, "number comparison = %d",
weechat_printf (NULL, "comparison of buffer number = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
weechat_printf (NULL, "comparison of number of lines = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0));
weechat_printf (NULL, "comparison of local variable = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0));
----
Script (Python):
@@ -18641,7 +18786,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens
hdata = weechat.hdata_get("buffer")
buffer1 = weechat.buffer_search("irc", "libera.#weechat")
buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr")
weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparison of buffer number = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparison of number of lines = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0))
weechat.prnt("", "comparison of local variable = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0))
----
==== hdata_set
+126 -84
View File
@@ -130,10 +130,6 @@ WeeChat:
| Logger plugin: compression of rotated log files (gzip). +
Relay plugin: compression of messages (WeeChat -> client) with https://zlib.net/[zlib ^↗^^] (weechat protocol). +
Script plugin: read of repository index file (gzip).
| libzstd-dev | ≥ 0.8.1
| Logger plugin: compression of rotated log files. +
Relay plugin: compression of messages (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat protocol).
|===
[NOTE]
@@ -147,26 +143,68 @@ WeeChat:
[width="100%",cols="5,^3,.^15",options="header"]
|===
| Package ^(1)^ | Version | Features
| {cpp} compiler (pass:[g++ / clang++]) | | Build and run tests, JavaScript plugin.
| gettext | | Internationalization (translation of messages; base language is English).
| ca-certificates | | Certificates for TLS connections.
| libaspell-dev / libenchant-dev | | Spell plugin.
| python3-dev | ≥ 3.0 | Python plugin.
| libperl-dev | | Perl plugin.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1 | Ruby plugin.
| liblua5.4-dev | | Lua plugin.
| tcl-dev | ≥ 8.5 | Tcl plugin.
| guile-3.0-dev | ≥ 2.0 | Guile (scheme) plugin.
| libv8-dev | ≤ 3.24.3 | JavaScript plugin.
| php-dev | ≥ 7.0 | PHP plugin.
| libphp-embed | ≥ 7.0 | PHP plugin.
| libxml2-dev | | PHP plugin.
| libargon2-dev | | PHP plugin (if PHP ≥ 7.2).
| libsodium-dev | | PHP plugin (if PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4 | Build man page and documentation.
| ruby-pygments.rb | | Build documentation.
| libcpputest-dev | ≥ 3.4 | Build and run tests.
| Package ^(1)^ | Version | Features
| {cpp} compiler (pass:[g++ / clang++]) |
| Build and run tests, JavaScript plugin.
| gettext |
| Internationalization (translation of messages; base language is English).
| ca-certificates |
| Certificates for TLS connections.
| libzstd-dev | ≥ 0.8.1
| Logger plugin: compression of rotated log files (zstandard). +
Relay plugin: compression of messages (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat protocol).
| libaspell-dev / libenchant-dev |
| Spell plugin.
| python3-dev | ≥ 3.0
| Python plugin.
| libperl-dev |
| Perl plugin.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1
| Ruby plugin.
| liblua5.4-dev |
| Lua plugin.
| tcl-dev | ≥ 8.5
| Tcl plugin.
| guile-3.0-dev | ≥ 2.0
| Guile (scheme) plugin.
| libv8-dev | ≤ 3.24.3
| JavaScript plugin.
| php-dev | ≥ 7.0
| PHP plugin.
| libphp-embed | ≥ 7.0
| PHP plugin.
| libxml2-dev |
| PHP plugin.
| libargon2-dev |
| PHP plugin (if PHP ≥ 7.2).
| libsodium-dev |
| PHP plugin (if PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4
| Build man page and documentation.
| ruby-pygments.rb |
| Build documentation.
| libcpputest-dev | ≥ 3.4
| Build and run tests.
|===
[NOTE]
@@ -206,7 +244,7 @@ $ make install
Options can be used for CMake, with format: `-DOPTION=VALUE`.
List of commonly used options:
List of available options:
[width="100%",cols="3m,3,3m,10",options="header"]
|===
@@ -260,6 +298,9 @@ List of commonly used options:
| ENABLE_GUILE | `ON`, `OFF` | ON
| Compile <<scripting_plugins,Guile plugin>> (Scheme).
| ENABLE_HEADLESS | `ON`, `OFF` | ON
| Compile headless binary.
| ENABLE_IRC | `ON`, `OFF` | ON
| Compile <<irc,IRC plugin>>.
@@ -318,6 +359,9 @@ List of commonly used options:
| ENABLE_XFER | `ON`, `OFF` | ON
| Compile <<xfer,Xfer plugin>>.
| ENABLE_ZSTD | `ON`, `OFF` | ON
| Enable https://facebook.github.io/zstd/[Zstandard ^↗^^] compression.
| ENABLE_TESTS | `ON`, `OFF` | OFF
| Compile tests.
@@ -895,6 +939,8 @@ Other items available (not used in bars by default):
| buffer_short_name | `#test` | Current buffer short name.
| buflist2 | `1.weechat` | List of buffers, second bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist3 | `1.weechat` | List of buffers, third bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist4 | `1.weechat` | List of buffers, fourth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist5 | `1.weechat` | List of buffers, fifth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
| fset | `+buflist.look.sort: …+` | Help on currently selected option on fset buffer.
| irc_channel | `#test` | Current IRC channel name.
| irc_host | `+user@host.com+` | Current IRC host.
@@ -1413,7 +1459,8 @@ External plugins and scripts can define and use other local variables.
=== List of buffers
Buflist plugin displays a list of buffers in a bar item called "buflist"
(two other bar items "buflist2" and "buflist3" are available as well). +
(four other bar items "buflist2", "buflist3", "buflist4" and "buflist5" are
available as well). +
A default bar "buflist" is created on startup with this item.
[[buflist_commands]]
@@ -1545,6 +1592,15 @@ They can be changed and new ones can be added with the <<command_weechat_key,/ke
| kbd:[Ctrl+↓] | Call next command/message in global history (common for all buffers). | `+/input history_global_next+`
|===
[[key_bindings_cmdline_system]]
==== System
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Key | Description | Command
| kbd:[Ctrl+z] | Suspend WeeChat process. | `+/sys suspend+`
|===
[[key_bindings_buffers]]
=== Buffers
@@ -1737,10 +1793,10 @@ These mouse actions are possible only if mouse is enabled with key kbd:[Alt+m]
| kbd:[▼] | - | chat: /list buffer | Move five lines down in /list buffer. | `+/list -down 5+`
| kbd:[■ □ □] | - | chat: /list buffer | Select line in /list buffer. | `+/window ${_window_number};/list -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat: /list buffer | Join IRC channel on selected line. | `+hsignal:irc_list_mouse+`
| kbd:[▲] | - | chat: script buffer | Move five lines up in script buffer. | `+/script up 5+`
| kbd:[▼] | - | chat: script buffer | Move five lines down in script buffer. | `+/script down 5+`
| kbd:[■ □ □] | - | chat: script buffer | Select line in script buffer. | `+/script go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat: script buffer | Install/remove script. | `+/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[▲] | - | chat: script buffer | Move five lines up in script buffer. | `+/script -up 5+`
| kbd:[▼] | - | chat: script buffer | Move five lines down in script buffer. | `+/script -down 5+`
| kbd:[■ □ □] | - | chat: script buffer | Select line in script buffer. | `+/script -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat: script buffer | Install/remove script. | `+/script -go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[■ □ □] | up / left | buflist | Move buffer to a lower number. | Signal `+buflist_mouse+`.
| kbd:[■ □ □] | down / right | buflist | Move buffer to a higher number. | Signal `+buflist_mouse+`.
| kbd:[■ □ □] | - | buflist | Switch to buffer (previously visited buffer if the buffer is the current one). | Signal `+buflist_mouse+`.
@@ -1803,8 +1859,8 @@ These keys and actions are used on the fset buffer (see <<fset,Fset plugin>>).
| kbd:[Ctrl+l] (`L`) | | Refresh options and whole screen. | `+/fset -refresh+`
| | `$` | Refresh options (keep marked options). |
| | `$$` | Refresh options (unmark all options). |
| kbd:[Alt+p] | | Toggle plugin description options (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | | Toggle help bar. | `+/bar toggle fset+`
| kbd:[Alt+p] | `p` | Toggle plugin description options (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | `v` | Toggle help bar. | `+/bar toggle fset+`
| | `s:x,y` | Sort options by fields x,y (see option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /set fset.look.sort x,y+`
| | `s:` | Reset sort to its default value (see option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /unset fset.look.sort+`
| | `w:xxx` | Export options in file "xxx". | `+/fset -export xxx+`
@@ -1858,17 +1914,22 @@ These keys and actions are used on the script buffer (see <<script_manager,scrip
[width="100%",cols="^.^3,^.^2,.^8,.^5",options="header"]
|===
| Key | Action ^(1)^ | Description | Command
| kbd:[↑] | | Move one line up. | `+/script up+`
| kbd:[↓] | | Move one line down. | `+/script down+`
| kbd:[↑] | | Move one line up. | `+/script -up+`
| kbd:[↓] | | Move one line down. | `+/script -down+`
| kbd:[PgUp] | | Move one page up. | `+/window page_up+`
| kbd:[PgDn] | | Move one page down. | `+/window page_down+`
| kbd:[Alt+i] | `i` | Install script. | `+/script install+`
| kbd:[Alt+r] | `r` | Remove script. | `+/script remove+`
| kbd:[Alt+l] (`L`) | `l` | Load script. | `+/script load+`
| kbd:[Alt+l] | `l` | Load script. | `+/script load+`
| kbd:[Alt+L] | `L` | Reload script. | `+/script reload+`
| kbd:[Alt+u] | `u` | Unload script. | `+/script unload+`
| kbd:[Alt+Shift+A] | `A` | Autoload script. | `+/script toggleautoload+`
| kbd:[Alt+h] | `h` | Hold/unhold script. | `+/script hold+`
| kbd:[Alt+v] | `v` | View script. | `+/script show+`
| | `s:x,y` | Sort scripts by fields x,y (see option <<option_script.look.sort,script.look.sort>>). |
| | `s:` | Reset sort to its default value (see option <<option_script.look.sort,script.look.sort>>). |
| | `$` | Refresh list. |
| | `q` | Close buffer. | `+/buffer close+`
|===
[NOTE]
@@ -2221,15 +2282,9 @@ and for each nick the max hotlist level to trigger, possible levels are:
For example to disable highlights from "joe" and "mike" on current buffer:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
[NOTE]
The buffer property "hotlist_max_level_nicks" is not saved in configuration. +
You can easily save it with the script _buffer_autoset.py_: you can install it
with `+/script install buffer_autoset.py+` and get help with
`+/help buffer_autoset+`.
[[highlights]]
=== Highlights
@@ -2254,15 +2309,9 @@ This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
/buffer setauto highlight_disable_regex <flash.*>
----
[NOTE]
The buffer property "highlight_disable_regex" is not saved in configuration. +
You can easily save it with the script _buffer_autoset.py_: you can install it
with `+/script install buffer_autoset.py+` and get help with
`+/help buffer_autoset+`.
[[highlights_words]]
==== Add words to highlight
@@ -2317,15 +2366,9 @@ You can force highlight using a regular expression with the buffer property
For example to force the highlight on all messages in the current buffer:
----
/buffer set highlight_regex .*
/buffer setauto highlight_regex .*
----
[NOTE]
The buffer property "highlight_regex" is not saved in configuration. +
You can easily save it with the script _buffer_autoset.py_: you can install it
with `+/script install buffer_autoset.py+` and get help with
`+/help buffer_autoset+`.
[[buffer_logging]]
=== Buffer logging
@@ -3204,30 +3247,31 @@ Sections in file _weechat.conf_:
[width="100%",cols="3m,6m,16",options="header"]
|===
| Section | Control command | Description
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Debug level, for core and plugins (options can be added/removed in section).
| startup | /set weechat.startup.* | Startup options.
| look | /set weechat.look.* | Look and feel.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Color aliases (options can be added/removed in section).
| color | /set weechat.color.* | Colors.
| completion | /set weechat.completion.* | Completion options.
| history | /set weechat.history.* | History options (commands and buffers).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Proxy options.
| network | /set weechat.network.* | Network/TLS options.
| plugin | /set weechat.plugin.* | Options on plugins.
| signal | /set weechat.signal.* | Options on signals.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Bar options.
| layout | <<command_weechat_layout,/layout>> | Layouts.
| notify | <<command_weechat_buffer,/buffer notify>> | Notify levels for buffers (options can be added/removed in section).
| filter | <<command_weechat_filter,/filter>> | Filters.
| key | <<command_weechat_key,/key>> | Keys in default context.
| key_search | <<command_weechat_key,/key>> | Keys in search context.
| key_cursor | <<command_weechat_key,/key>> | Keys in cursor context.
| key_mouse | <<command_weechat_key,/key>> | Keys in mouse context.
| Section | Control command | Description
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Debug level, for core and plugins (options can be added/removed in section).
| startup | /set weechat.startup.* | Startup options.
| look | /set weechat.look.* | Look and feel.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Color aliases (options can be added/removed in section).
| color | /set weechat.color.* | Colors.
| completion | /set weechat.completion.* | Completion options.
| history | /set weechat.history.* | History options (commands and buffers).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Proxy options.
| network | /set weechat.network.* | Network/TLS options.
| plugin | /set weechat.plugin.* | Options on plugins.
| signal | /set weechat.signal.* | Options on signals.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Bar options.
| layout | <<command_weechat_layout,/layout>> | Layouts.
| buffer | <<command_weechat_buffer,/buffer setauto>> | Properties auto-applied on buffers when they are opened.
| notify | <<command_weechat_buffer,/buffer notify>> | Notify levels for buffers (options can be added/removed in section).
| filter | <<command_weechat_filter,/filter>> | Filters.
| key | <<command_weechat_key,/key>> | Keys in default context.
| key_search | <<command_weechat_key,/key>> | Keys in search context.
| key_cursor | <<command_weechat_key,/key>> | Keys in cursor context.
| key_mouse | <<command_weechat_key,/key>> | Keys in mouse context.
|===
Options:
@@ -4095,7 +4139,7 @@ the following extra variables are available:
[width="100%",cols="2,4,8",options="header"]
|===
| Variable | Description | Value/example
| `+${clientinfo}+` | List of supported CTCP | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| `+${clientinfo}+` | List of supported CTCP | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| `+${version}+` | WeeChat version | `+4.1.0-dev+`
| `+${versiongit}+` | WeeChat version + Git version ^(1)^ | `+4.1.0-dev (git: v4.0.0-51-g8f98b922a)+`
| `+${git}+` | Git version ^(1)^ | `+v4.0.0-51-g8f98b922a+`
@@ -4117,11 +4161,9 @@ The default CTCP replies are:
[width="100%",cols="2,4,8",options="header"]
|===
| CTCP | Reply format | Example
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| FINGER | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| SOURCE | `+${download}+` | `+https://weechat.org/download/+`
| TIME | `+${time}+` | `+Sat, 08 Jul 2023 21:11:19 +0200+`
| USERINFO | `+${username} (${realname})+` | `+name (John Doe)+`
| VERSION | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
|===
+46 -21
View File
@@ -598,6 +598,15 @@ Si está utilizando aplicación Terminal de macOS, habilite la opción
"Use option as meta key" en el menú Settings/Keyboard después de la cual puede utilizar la tecla
kbd:[Option] como tecla meta.
// TRANSLATION MISSING
[[enter_key]]
=== Some keys including Enter are not working, why?
If you run a WeeChat < 4.0.0 with configuration files created by any
version ≥ 4.0.0, the keys names become invalid and many keys won't work at all. +
To repair them, exit WeeChat, remove all sections `[key*]` from weechat.conf
and start WeeChat again: all default keys will be created.
[[customize_key_bindings]]
=== ¿Cómo puedo personalizar los atajos de teclado?
@@ -954,35 +963,22 @@ link:weechat_user.en.html#max_hotlist_level_nicks[hotlist_max_level_nicks_add ^
buffer property to set the max hotlist level for some nicks, per buffer,
or per group of buffers (like IRC servers).
Para únicamente inhabilitar las notificaciones, debería establecerlo a 2:
Para únicamente inhabilitar las notificaciones, debería establecerlo a 2.
// TRANSLATION MISSING
For the current buffer:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
Esta propiedad del buffer no es almacenada en la configuración.
Para volver a aplicar automáticamente estas propiedades del buffer, necesitaría el script
_buffer_autoset.py_:
// TRANSLATION MISSING
For all channels on server "libera":
----
/script install buffer_autoset.py
/set weechat.buffer.irc.libera.*.hotlist_max_level_nicks_add joe:2,mike:2
----
Por ejemplo, para inhabilitar automáticamente las menciones de "mike" en #weechat
en el servidor IRC de libera:
----
/buffer_autoset add irc.libera.#weechat hotlist_max_level_nicks_add mike:2
----
Para aplicarlo al servidor completo de libera:
----
/buffer_autoset add irc.libera hotlist_max_level_nicks_add mike:2
----
Para más ejemplos, vea `+/help buffer_autoset+`.
[[irc_target_buffer]]
=== ¿Cómo puedo cambiar el objetivo del buffer para comandos en buffers unidos (como en un buffer con servidores)?
@@ -1186,6 +1182,35 @@ almacenadas en _sec.conf_ con el comando `/secure`).
Vea la link:weechat_user.en.html#files_and_directories[Guía del usuario / Archivos y directorios ^↗^^]
para más información relacionada con los archivos de configuración.
// TRANSLATION MISSING
[[move_to_another_device]]
=== I want to move my WeeChat to another device and keep my config, what should I copy?
First check directories used by WeeChat with this command: `/debug dirs`. +
Directories home/config and home/data must be copied (all files and sub-directories).
For example if you're using XDG directories (default with WeeChat ≥ 3.2),
the directories should be `$HOME/.config/weechat` and `$HOME/.local/share/weechat`. +
If you're using a single directory (default with WeeChat < 3.2), the directory
should be `$HOME/.weechat`.
[IMPORTANT]
The WeeChat version on the new device must be greater than or equal to the version
on the initial device. +
Downgrading WeeChat configuration is *NOT SUPPORTED* and can break it,
leading to unusable WeeChat.
Steps:
. Quit Weechat: `/quit` (or `/upgrade -quit` if you want to resume the session,
which includes content of all buffers).
. Copy all directories, sub-directories and files to the new device, keeping
same names and permissions.
. Optional: copy any file outside these directories that you refer to in your
configuration (it's not recommended to use files outside WeeChat directories).
. Start WeeChat on the new device: `weechat` (or `weechat --upgrade` if you
saved the session).
[[development]]
== Desarrollo
+4
View File
@@ -142,6 +142,7 @@ Le cœur de WeeChat est situé dans les répertoires suivants :
|    wee-secure-config.c | Options des données sécurisées (fichier sec.conf).
|    wee-signal.c | Fonctions sur les signaux.
|    wee-string.c | Fonctions sur les chaînes de caractères.
|    wee-sys.c | Fonctions système.
|    wee-upgrade-file.c | Système de mise à jour interne.
|    wee-upgrade.c | Mise à jour du cœur de WeeChat (tampons, lignes, historique, ...).
|    wee-url.c | Transfert d'URL (en utilisant libcurl).
@@ -168,6 +169,7 @@ Le cœur de WeeChat est situé dans les répertoires suivants :
|       wee-hook-process.c | Hook "process".
|       wee-hook-signal.c | Hook "signal".
|       wee-hook-timer.c | Hook "timer".
|       wee-hook-url.c | Hook "url".
| gui/ | Fonctions pour les tampons, fenêtres, ... (utilisées par toutes les interfaces).
|    gui-bar-item.c | Objets de barre.
|    gui-bar-window.c | Fenêtres de barre.
@@ -238,6 +240,7 @@ Le cœur de WeeChat est situé dans les répertoires suivants :
|       buflist.c | Fonctions principales de Buflist.
|       buflist-bar-item.c | Objets de barre Buflist.
|       buflist-command.c | Commandes pour Buflist.
|       buflist-completion.c | Complétions pour Buflist.
|       buflist-config.c | Options de configuration pour Buflist (fichier buflist.conf).
|       buflist-info.c | Info/infolists/hdata pour Buflist.
|       buflist-mouse.c | Actions souris pour Buflist.
@@ -422,6 +425,7 @@ Le cœur de WeeChat est situé dans les répertoires suivants :
|          test-core-url.cpp | Tests : URLs.
|          test-core-utf8.cpp | Tests : UTF-8.
|          test-core-util.cpp | Tests : fonctions utiles.
|          test-core-sys.cpp | Tests : fonctions système.
|       gui/ | Racine des tests unitaires pour les interfaces.
|          test-gui-bar-window.cpp | Tests : fonctions de fenêtres de barre.
|          test-gui-buffer.cpp | Tests : fonctions de tampons.
+47 -21
View File
@@ -601,6 +601,16 @@ Si vous utilisez l'application Terminal sous macOS, activez l'option
"Use option as meta key" dans le menu Réglages/Clavier. Vous pouvez alors
utiliser la touche kbd:[Option] comme touche meta.
[[enter_key]]
=== Quelques touches comme Entrée ne fonctionnent pas, pourquoi ?
Si vous lancez WeeChat < 4.0.0 avec des fichiers de configuration créés par toute
version ≥ 4.0.0, les noms des touches sont invalides et de nombreuses touches
ne fonctionneront plus. +
Pour les réparer, quittez WeeChat, supprimez toutes les sections `[key*]` de
weechat.conf et démarrez WeeChat à nouveau : toutes les touches par défaut
seront recréées.
[[customize_key_bindings]]
=== Comment puis-je configurer les raccourcis clavier ?
@@ -955,35 +965,20 @@ link:weechat_user.fr.html#max_hotlist_level_nicks[hotlist_max_level_nicks_add ^
pour définir le niveau maximum de hotlist pour certains pseudos, par tampon,
ou groupe de tampons (comme des serveurs IRC).
Pour désactiver seulement les highlights, vous pouvez positionner la valeur à 2 :
Pour désactiver seulement les highlights, vous pouvez positionner la valeur à 2.
Pour le tampon courant :
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
Cependant, cette propriété de tampon n'est pas sauvegardée dans la configuration.
Pour automatiquement réappliquer ces propriétés de tampons, vous aurez besoin
du script _buffer_autoset.py_ :
Pour tous les canaux sur le serveur "libera":
----
/script install buffer_autoset.py
/set weechat.buffer.irc.libera.*.hotlist_max_level_nicks_add joe:2,mike:2
----
Par exemple, pour désactiver de manière permanente les highlights de "mike" sur
#weechat sur le serveur IRC libera :
----
/buffer_autoset add irc.libera.#weechat hotlist_max_level_nicks_add mike:2
----
Pour l'appliquer à l'ensemble du serveur libera :
----
/buffer_autoset add irc.libera hotlist_max_level_nicks_add mike:2
----
Pour plus d'exemples, voir `+/help buffer_autoset+`.
[[irc_target_buffer]]
=== Comment puis-je changer le serveur cible pour les commandes avec des tampons mélangés (comme le tampon avec les serveurs) ?
@@ -1195,6 +1190,37 @@ des mots de passes (s'ils ne sont pas stockés dans _sec.conf_ avec la commande
Voir le link:weechat_user.fr.html#files_and_directories[Guide utilisateur / Fichiers et répertoires ^↗^^]
pour plus d'informations sur les fichiers de configuration.
[[move_to_another_device]]
=== Je souhaite déplacer mon WeeChat vers une autre machine et garder ma configuration, que dois-je copier ?
Premièrement, vérifiez les répertoires utilisés par WeeChat avec cette commande :
`/debug dirs`. +
Les répertoires home/config et home/data doivent être copiés (tous les fichiers
et sous-répertoires).
Par exemple si vous utilisez les répertoires XDG (par défaut avec WeeChat ≥ 3.2),
les répertoires devraient être `$HOME/.config/weechat` et `$HOME/.local/share/weechat`. +
Si vous utilisez un répertoire unique (par défaut avec WeeChat < 3.2), le répertoire
devrait être `$HOME/.weechat`.
[IMPORTANT]
La version de WeeChat sur la nouvelle machine doit être supérieure ou égale
à celle de la machine initiale. +
La rétrogradation de la configuration n'est *PAS SUPPORTÉE* et pourrait la casser,
rendant WeeChat inutilisable.
Étapes :
. Quitter Weechat : `/quit` (ou `/upgrade -quit` si vous souhaitez restaurer
la session, qui inclut le contenu de tous les tampons).
. Copier tous les répertoires, fichiers et sous-répertoires vers la nouvelle machine
au même endroit, en préservant les noms et les permissions.
. Facultatif : copier tout fichier en dehors de ces répertoires que vous référencez
dans votre configuration (il n'est pas recommandé d'utiliser des fichiers en
dehors des répertoires WeeChat).
. Démarrer WeeChat sur la nouvelle machine : `weechat` (ou `weechat --upgrade`
si vous avez sauvé la session).
[[development]]
== Développement
+215 -60
View File
@@ -4100,18 +4100,28 @@ Algorithmes de hachage supportés :
[width="100%",cols="2,2,3,6",options="header"]
|===
| Valeur | Algorithme | Taille du haché | Notes
| `+crc32+` | CRC32 | 4 octets (32 bits) | Pas un algorithme de hachage au sens cryptographique.
| `+md5+` | MD5 | 16 octets (128 bits) | *Faible*, non recommandé pour un usage cryptographique.
| `+sha1+` | SHA-1 | 20 octets (160 bits) | *Faible*, non recommandé pour un usage cryptographique.
| `+sha224+` | SHA-224 | 28 octets (224 bits) |
| `+sha256+` | SHA-256 | 32 octets (256 bits) |
| `+sha384+` | SHA-384 | 48 octets (384 bits) |
| `+sha512+` | SHA-512 | 64 octets (512 bits) |
| `+sha3-224+` | SHA3-224 | 28 octets (224 bits) | Algorithme disponible avec libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 octets (256 bits) | Algorithme disponible avec libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 octets (384 bits) | Algorithme disponible avec libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 octets (512 bits) | Algorithme disponible avec libgcrypt ≥ 1.7.0.
| Valeur | Algorithme | Taille du haché | Notes
| `+crc32+` | CRC32 | 4 octets (32 bits) | Pas un algorithme de hachage au sens cryptographique.
| `+md5+` | MD5 | 16 octets (128 bits) | *Faible*, non recommandé pour un usage cryptographique.
| `+sha1+` | SHA-1 | 20 octets (160 bits) | *Faible*, non recommandé pour un usage cryptographique.
| `+sha224+` | SHA-224 | 28 octets (224 bits) |
| `+sha256+` | SHA-256 | 32 octets (256 bits) |
| `+sha384+` | SHA-384 | 48 octets (384 bits) |
| `+sha512+` | SHA-512 | 64 octets (512 bits) |
| `+sha512-224+` | SHA-512/224 | 28 octets (224 bits) | Algorithme disponible avec libgcrypt ≥ 1.9.4.
| `+sha512-256+` | SHA-512/256 | 32 octets (256 bits) | Algorithme disponible avec libgcrypt ≥ 1.9.4.
| `+sha3-224+` | SHA3-224 | 28 octets (224 bits) | Algorithme disponible avec libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 octets (256 bits) | Algorithme disponible avec libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 octets (384 bits) | Algorithme disponible avec libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 octets (512 bits) | Algorithme disponible avec libgcrypt ≥ 1.7.0.
| `+blake2b-160+` | BLAKE2B-160 | 20 octets (160 bits) | Algorithme disponible avec libgcrypt ≥ 1.8.0.
| `+blake2b-256+` | BLAKE2B-256 | 32 octets (256 bits) | Algorithme disponible avec libgcrypt ≥ 1.8.0.
| `+blake2b-384+` | BLAKE2B-384 | 48 octets (384 bits) | Algorithme disponible avec libgcrypt ≥ 1.8.0.
| `+blake2b-512+` | BLAKE2B-512 | 64 octets (512 bits) | Algorithme disponible avec libgcrypt ≥ 1.8.0.
| `+blake2s-128+` | BLAKE2S-128 | 16 octets (128 bits) | Algorithme disponible avec libgcrypt ≥ 1.8.0.
| `+blake2s-160+` | BLAKE2S-160 | 20 octets (160 bits) | Algorithme disponible avec libgcrypt ≥ 1.8.0.
| `+blake2s-224+` | BLAKE2S-224 | 28 octets (224 bits) | Algorithme disponible avec libgcrypt ≥ 1.8.0.
| `+blake2s-256+` | BLAKE2S-256 | 32 octets (256 bits) | Algorithme disponible avec libgcrypt ≥ 1.8.0.
|===
Valeur de retour :
@@ -4552,7 +4562,8 @@ Paramètres :
* _to_ : fichier cible
* _compressor_ : le compresseur à utiliser, un parmi :
** _gzip_ : compression gzip
** _zstd_ : compression zstandard
** _zstd_ : compression zstandard (disponible seulement si zstd a été activé
lors de la compilation de WeeChat)
* _compression_level_ : niveau de compression, entre 1 (rapide, peu de
compression) à 100 (lent, meilleure compression)
@@ -6819,9 +6830,10 @@ my_section_read_cb (const void *pointer, void *data,
{
/* ... */
return WEECHAT_CONFIG_READ_OK;
/* return WEECHAT_CONFIG_READ_MEMORY_ERROR; */
/* return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; */
return WEECHAT_CONFIG_OPTION_SET_OK_CHANGED;
/* return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; */
/* return WEECHAT_CONFIG_OPTION_SET_ERROR; */
/* return WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND; */
}
int
@@ -6911,7 +6923,7 @@ def config_new_section(config_file: str, name: str,
callback_delete_option: str, callback_delete_option_data: str) -> str: ...
# exemple
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -6930,7 +6942,7 @@ def my_section_write_default_cb(data: str, config_file: str, section_name: str)
# return weechat.WEECHAT_CONFIG_WRITE_ERROR
# return weechat.WEECHAT_CONFIG_WRITE_MEMORY_ERROR
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -7177,7 +7189,7 @@ Script (Python) :
# prototype
def config_new_option(config_file: str, section: str, name: str, type: str, description: str,
string_values: str, min: int, max: int,
default_value: str | None, value: str | None, null_value_allowed: int,
default_value: Union[str, None], value: Union[str, None], null_value_allowed: int,
callback_check_value: str, callback_check_value_data: str,
callback_change: str, callback_change_data: str,
callback_delete: str, callback_delete_data: str) -> str: ...
@@ -10196,7 +10208,6 @@ struct t_hook *weechat_hook_process (const char *command,
void *callback_data);
----
Paramètres :
* _command_ : commande à lancer dans le processus fils, URL _(WeeChat ≥ 0.3.7)_
@@ -10430,7 +10441,7 @@ struct t_hook *weechat_hook_process_hashtable (const char *command,
Les paramètres sont les mêmes que ceux de la fonction
<<_hook_process,hook_process>>, avec un paramètre supplémentaire :
* _options_ : options pour la commande exécutée; la table de hachage est
* _options_ : options pour la commande exécutée ; la table de hachage est
dupliquée dans la fonction, donc il est possible de la supprimer après cet
appel
@@ -10460,25 +10471,8 @@ sont disponibles :
_/dev/null_.
|===
Pour la commande "url:...", les options suivantes sont disponibles (voir
`+man curl_easy_setopt+` pour une description de chaque option) :
include::{autogendir}/autogen_api_url_options.fr.adoc[tag=url_options]
[NOTE]
^(1)^ Pour les options avec le type "mask", le format est :
"value1+value2+value3" ;
pour les options avec le type "list", les éléments de la liste doivent être
séparés par un retour à la ligne (`\n`). +
^(2)^ Lorsque des constantes sont disponibles, elles doivent être utilisées
comme valeur pour l'option.
Pour l'URL, deux options supplémentaires (chaînes) sont autorisées, pour le
fichier en entrée/sortie :
* _file_in_ : fichier à lire pour envoyer avec l'URL (envoi de fichier "post")
* _file_out_ : écrire l'URL/fichier dans ce fichier (au lieu de la sortie
standard)
Pour la commande "url:...", voir les options disponibles dans la fonction
<<_hook_url,hook_url>>.
Valeur de retour :
@@ -10638,6 +10632,163 @@ hook4 = weechat.hook_process_hashtable("sh",
20000, "my_process_cb", "")
----
==== hook_url
_WeeChat ≥ 4.1.0._
Transfert d'URL.
Prototype :
[source,c]
----
struct t_hook *weechat_hook_url (const char *url,
struct t_hashtable *options,
int timeout,
int (*callback)(const void *pointer,
void *data,
const char *url,
struct t_hashtable *options,
struct t_hashtable *output),
const void *callback_pointer,
void *callback_data);
----
Paramètres :
* _url_ : URL
* _options_ : options pour le transfert d'URL (voir ci-dessous) ; la table de
hachage est dupliquée dans la fonction, donc il est possible de la supprimer
après cet appel
* _timeout_ : timeout pour le transfert d'URL (en millisecondes) : après de délai,
le transfert est stoppé (0 signifie pas de limite)
* _callback_ : fonction appelée lorsque le transfert est terminé, paramètres et
valeur de retour :
** _const void *pointer_ : pointeur
** _void *data_ : pointeur
** _const char *url_ : URL
** _struct t_hashtable *options_ : options
** _struct t_hashtable *output_ : résultat (les clés et valeurs sont des chaînes),
qui peut contenir les clés suivantes :
*** _response_code_ : code réponse HTTP
*** _headers_ : en-têtes HTTP dans la réponse
*** _output_ : sortie standard (défini seulement si _file_out_ n'était pas défini
dans les options)
*** _error_ : message d'erreur (défini seulement en cas d'erreur)
** valeur de retour :
*** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_
* _callback_pointer_ : pointeur donné à la fonction de rappel lorsqu'elle est
appelée par WeeChat
* _callback_data_ : pointeur donné à la fonction de rappel lorsqu'elle est
appelée par WeeChat; si non NULL, doit avoir été alloué par malloc (ou une
fonction similaire) et est automatiquement libéré (par free) lorsque le
"hook" est supprimé
Les options Curl suivantes sont disponibles (voir `+man curl_easy_setopt+` pour
une description de chaque option) :
include::{autogendir}/autogen_api_url_options.fr.adoc[tag=url_options]
[NOTE]
^(1)^ Pour les options avec le type "mask", le format est :
"value1+value2+value3" ;
pour les options avec le type "list", les éléments de la liste doivent être
séparés par un retour à la ligne (`\n`). +
^(2)^ Lorsque des constantes sont disponibles, elles doivent être utilisées
comme valeur pour l'option.
Ces deux options supplémentaires (chaînes) sont autorisées, pour le fichier en
entrée/sortie :
[width="100%",cols="2,^1,7",options="header"]
|===
| Option | Type | Description
| file_in | string | fichier à lire pour envoyer avec l'URL (envoi de fichier "post")
| file_out | string | écrire l'URL/fichier dans ce fichier (au lieu de la sortie standard)
|===
Valeur de retour :
* pointeur vers le nouveau "hook", NULL en cas d'erreur
Exemple en C :
[source,c]
----
int
my_url_cb (const void *pointer, void *data, const char *url,
struct t_hashtable *options, struct t_hashtable *output)
{
weechat_printf (NULL, "response_code : %s", weechat_hashtable_get (output, "response_code"));
weechat_printf (NULL, "headers : %s", weechat_hashtable_get (output, "headers"));
weechat_printf (NULL, "output : %s", weechat_hashtable_get (output, "output"));
weechat_printf (NULL, "error : %s", weechat_hashtable_get (output, "error"));
return WEECHAT_RC_OK;
}
/* example 1: sortie dans un fichier */
struct t_hashtable *options_url1 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url1)
{
weechat_hashtable_set (options_url1, "file_out", "/tmp/weechat.org.html");
struct t_hook *my_url_hook = weechat_hook_url ("https://weechat.org/",
options_url1,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url1);
}
/* example 2: en-têtes HTTP personnalisés, sortie envoyée à la fonction de rappel */
struct t_hashtable *options_url2 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url2)
{
weechat_hashtable_set (options_url2, "httpheader",
"Header1: valeur1\n"
"Header2: valeur2");
struct t_hook *my_url_hook = weechat_hook_url ("http://localhost:8080/",
options_url2,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url2);
}
----
Script (Python) :
[source,python]
----
# prototype
def hook_url(url: str, options: Dict[str, str], timeout: int, callback: str, callback_data: str) -> str: ...
# exemple
def my_url_cb(data: str, url: str, options: Dict[str, str], output: Dict[str, str]) -> int:
weechat.prnt("", "output: %s" % output)
return weechat.WEECHAT_RC_OK
# exemple 1 : sortie dans un fichier
hook1 = weechat.hook_url("https://weechat.org/",
{"file_out": "/tmp/weechat.org.html"},
20000, "my_url_cb", "")
# exemple 2 : en-têtes HTTP personnalisés, sortie envoyée à la fonction de rappel
options = {
"httpheader": "\n".join([
"Header1: valeur1",
"Header2: valeur2",
]),
}
hook2 = weechat.hook_url("http://localhost:8080/", options, 20000, "my_url_cb", "")
----
==== hook_connect
_Mis à jour dans la 1.5, 2.0._
@@ -10831,7 +10982,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
==== hook_line
_WeeChat ≥ 2.3, mis à jour dans la 3.7, 4.1.0._
_WeeChat ≥ 2.3, mis à jour dans la 3.7._
Intercepter une ligne sur le point d'être affichée dans un tampon.
@@ -10909,13 +11060,13 @@ de hachage, avec les valeurs suivantes (les clés et valeurs sont des chaînes)
| Clé | Valeur (tampon formaté) | Valeur (tampon libre) | Exemples
| buffer
| Liste de pointeurs vers les tampons, séparés par des virgules.
| Liste de pointeurs vers les tampons, séparés par des virgules.
| Pointeur vers le tampon.
| Pointeur vers le tampon.
| `+0x1234abcd+`
| buffer_name
| Liste de noms de tampons, séparés par des virgules.
| Liste de noms de tampons, séparés par des virgules.
| Nom du tampon.
| Nom du tampon.
| `+core.weechat+` +
`+irc.server.libera+` +
`+irc.libera.#weechat+`
@@ -11004,20 +11155,16 @@ valeurs sont des chaînes dans cette table de hachage) :
| Clé | Valeur autorisée (tampon formaté) | Valeur autorisée (tampon libre) | Résultat
| buffer
| Liste de pointeurs vers les tampons, séparés par des virgules (avec contenu formaté)
(plusieurs tampons sont supportés seulement avec WeeChat ≥ 4.1.0).
| Liste de pointeurs vers les tampons, séparés par des virgules (avec contenu libre)
(plusieurs tampons sont supportés seulement avec WeeChat ≥ 4.1.0).
| La ligne est affichée sur ces tampons. +
| Pointeur vers un tampon avec contenu formaté.
| Pointeur vers un tampon avec contenu libre.
| La ligne est affichée sur ce tampon. +
Si la valeur est vide, la ligne est supprimée (le reste de la table de hachage
est alors ignoré) ; les "hooks" suivants de type "line" ne sont pas appelés.
| buffer_name
| Liste de noms de tampons, séparés par des virgules (avec contenu formaté)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Liste de noms de tampons, séparés par des virgules (avec contenu libre)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| La ligne est affichée sur ces tampons. +
| Nom d'un tampon avec contenu formaté.
| Nom d'un tampon avec contenu libre.
| La ligne est affichée sur ce tampon. +
Si `buffer` est également défini, la valeur de `+buffer_name+` a une priorité
plus haute est est utilisée. +
Si la valeur est vide, la ligne est supprimée (le reste de la table de hachage
@@ -18986,7 +19133,7 @@ for key in hash:
==== hdata_compare
_WeeChat ≥ 1.9._
_WeeChat ≥ 1.9, mis à jour dans la 4.1.0._
Comparer une variable hdata de deux objets.
@@ -19002,8 +19149,9 @@ Paramètres :
* _hdata_ : pointeur vers le hdata
* _pointer1_ : pointeur vers le premier objet WeeChat ou d'une extension
* _pointer2_ : pointeur vers le second objet WeeChat ou d'une extension
* _name_ : nom de la variable ; pour les tableaux, le nom peut être "N|name" où N
est un index dans le tableau (démarrant à 0), par exemple : "2|name"
* _name_ : nom de la variable ou chemin vers le nom de la variable ; pour les
tableaux, le nom peut être "N|name" où N est un index dans le tableau
(démarrant à 0), par exemple : "2|name"
* _case_sensitive_ : 1 pour une comparaison tenant compte de la casse pour les chaînes,
sinon 0
@@ -19020,7 +19168,12 @@ Exemple en C :
struct t_hdata *hdata = weechat_hdata_get ("buffer");
struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat");
struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr");
weechat_printf (NULL, "comparaison de numéro = %d", weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
weechat_printf (NULL, "comparaison de numéro de tampon = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
weechat_printf (NULL, "comparaison du nombre de lignes = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0));
weechat_printf (NULL, "comparaison de variable locale = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0));
----
Script (Python) :
@@ -19034,7 +19187,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens
hdata = weechat.hdata_get("buffer")
buffer1 = weechat.buffer_search("irc", "libera.#weechat")
buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr")
weechat.prnt("", "comparaison de numéro = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparaison de numéro de tampon = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparaison du nombre de lignes = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0))
weechat.prnt("", "comparaison de variable locale = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0))
----
==== hdata_set
+134 -96
View File
@@ -130,10 +130,6 @@ Le tableau suivant liste les paquets *requis* pour construire WeeChat :
| Extension Logger : compression des fichiers de log qui tournent (gzip). +
Extention Relay : compression des messages (WeeChat -> client) avec https://zlib.net/[zlib ^↗^^] (protocole weechat). +
Extension Script : lecture du fichier d'index du dépôt (gzip).
| libzstd-dev | ≥ 0.8.1
| Extension Logger : compression des fichiers de log qui tournent. +
Extension Relay : compression des messages (WeeChat -> client) avec https://facebook.github.io/zstd/[Zstandard ^↗^^] (protocole weechat).
|===
[NOTE]
@@ -146,26 +142,68 @@ Le tableau suivant liste les paquets optionnels pour compiler WeeChat :
[width="100%",cols="5,^3,.^15",options="header"]
|===
| Paquet ^(1)^ | Version | Fonctionnalités
| compilateur {cpp} (pass:[g++ / clang++]) | | Construction et lancement des tests, extension JavaScript.
| gettext | | Internationalisation (traduction des messages ; la langue de base est l'anglais).
| ca-certificates | | Certificats pour les connexions TLS.
| libaspell-dev / libenchant-dev | | Extension spell.
| python3-dev | ≥ 3.0 | Extension python.
| libperl-dev | | Extension perl.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1 | Extension ruby.
| liblua5.4-dev | | Extension lua.
| tcl-dev | ≥ 8.5 | Extension tcl.
| guile-3.0-dev | ≥ 2.0 | Extension guile (scheme).
| libv8-dev | ≤ 3.24.3 | Extension javascript.
| php-dev | ≥ 7.0 | Extension PHP.
| libphp-embed | ≥ 7.0 | Extension PHP.
| libxml2-dev | | Extension PHP.
| libargon2-dev | | Extension PHP (si PHP ≥ 7.2).
| libsodium-dev | | Extension PHP (si PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4 | Construction de la page man et de la documentation.
| ruby-pygments.rb | | Construction de la documentation.
| libcpputest-dev | ≥ 3.4 | Construction et lancement des tests.
| Paquet ^(1)^ | Version | Fonctionnalités
| compilateur {cpp} (pass:[g++ / clang++]) |
| Construction et lancement des tests, extension JavaScript.
| gettext |
| Internationalisation (traduction des messages ; la langue de base est l'anglais).
| ca-certificates |
| Certificats pour les connexions TLS.
| libzstd-dev | ≥ 0.8.1
| Extension Logger : compression des fichiers de log qui tournent (zstandard). +
Extension Relay : compression des messages (WeeChat -> client) avec https://facebook.github.io/zstd/[Zstandard ^↗^^] (protocole weechat).
| libaspell-dev / libenchant-dev |
| Extension spell.
| python3-dev | ≥ 3.0
| Extension python.
| libperl-dev |
| Extension perl.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1
| Extension ruby.
| liblua5.4-dev |
| Extension lua.
| tcl-dev | ≥ 8.5
| Extension tcl.
| guile-3.0-dev | ≥ 2.0
| Extension guile (scheme).
| libv8-dev | ≤ 3.24.3
| Extension javascript.
| php-dev | ≥ 7.0
| Extension PHP.
| libphp-embed | ≥ 7.0
| Extension PHP.
| libxml2-dev |
| Extension PHP.
| libargon2-dev |
| Extension PHP (si PHP ≥ 7.2).
| libsodium-dev |
| Extension PHP (si PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4
| Construction de la page man et de la documentation.
| ruby-pygments.rb |
| Construction de la documentation.
| libcpputest-dev | ≥ 3.4
| Construction et lancement des tests.
|===
[NOTE]
@@ -205,7 +243,7 @@ $ make install
Des options peuvent être utilisées pour CMake, avec le format : `-DOPTION=VALUE`.
Liste des options couramment utilisées :
Liste des options disponibles :
[width="100%",cols="3m,3,3m,10",options="header"]
|===
@@ -259,6 +297,9 @@ Liste des options couramment utilisées :
| ENABLE_GUILE | `ON`, `OFF` | ON
| Compiler <<scripting_plugins,l'extension Guile>> (Scheme).
| ENABLE_HEADLESS | `ON`, `OFF` | ON
| Compiler le binaire sans interface (« headless »).
| ENABLE_IRC | `ON`, `OFF` | ON
| Compiler <<irc,l'extension IRC>>.
@@ -317,6 +358,9 @@ Liste des options couramment utilisées :
| ENABLE_XFER | `ON`, `OFF` | ON
| Compiler <<xfer,l'extension Xfer>>.
| ENABLE_ZSTD | `ON`, `OFF` | ON
| Activer la compression https://facebook.github.io/zstd/[Zstandard ^↗^^].
| ENABLE_TESTS | `ON`, `OFF` | OFF
| Compiler les tests.
@@ -909,6 +953,8 @@ Autres objets (non utilisés dans des barres par défaut) :
| buffer_short_name | `#test` | Nom court du tampon courant.
| buflist2 | `1.weechat` | Liste des tampons, deuxième objet de barre (voir l'option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist3 | `1.weechat` | Liste des tampons, troisième objet de barre (voir l'option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist4 | `1.weechat` | Liste des tampons, quatrième objet de barre (voir l'option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist5 | `1.weechat` | Liste des tampons, cinquième objet de barre (voir l'option <<option_buflist.look.use_items,buflist.look.use_items>>).
| fset | `+buflist.look.sort: …+` | Aide sur l'option sélectionnée dans le tampon fset.
| irc_channel | `#test` | Nom de canal IRC courant.
| irc_host | `+user@host.com+` | Hôte sur IRC.
@@ -1444,8 +1490,8 @@ variables locales.
=== Liste des tampons
L'extension Buflist affiche une liste des tampons dans un objet de barre appelé
"buflist" (deux autres objets de barre "buflist2" et "buflist3" sont également
disponibles). +
"buflist" (quatre autres objets de barre "buflist2", "buflist3", "buflist4" et
"buflist5" sont également disponibles). +
Une barre par défaut "buflist" est créée au démarrage avec cet objet de barre.
[[buflist_commands]]
@@ -1581,6 +1627,15 @@ Ils peuvent être modifiés et de nouveaux peuvent être ajoutés avec la comman
| kbd:[Ctrl+↓] | Rappeler la commande suivante dans l'historique global (commun à tous les tampons). | `+/input history_global_next+`
|===
[[key_bindings_cmdline_system]]
==== Système
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Touche | Description | Commande
| kbd:[Ctrl+z] | Suspendre le processus WeeChat. | `+/sys suspend+`
|===
[[key_bindings_buffers]]
=== Tampons
@@ -1773,10 +1828,10 @@ avec la touche kbd:[Alt+m] (commande : `+/mouse toggle+`).
| kbd:[▼] | - | chat : tampon /list | Descendre de cinq lignes dans le tampon /list. | `+/list -down 5+`
| kbd:[■ □ □] | - | chat : tampon /list | Sélectionner la ligne dans le tampon /list. | `+/window ${_window_number};/list -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat : tampon /list | Rejoindre le canal IRC sur la ligne sélectionnée. | `+hsignal:irc_list_mouse+`
| kbd:[▲] | - | chat : tampon script | Monter de 5 lignes dans le tampon script. | `+/script up 5+`
| kbd:[▼] | - | chat : tampon script | Descendre de 5 lignes dans le tampon script. | `+/script down 5+`
| kbd:[■ □ □] | - | chat : tampon script | Sélectionner la ligne dans le tampon script. | `+/script go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat : tampon script | Installer/supprimer un script. | `+/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[▲] | - | chat : tampon script | Monter de 5 lignes dans le tampon script. | `+/script -up 5+`
| kbd:[▼] | - | chat : tampon script | Descendre de 5 lignes dans le tampon script. | `+/script -down 5+`
| kbd:[■ □ □] | - | chat : tampon script | Sélectionner la ligne dans le tampon script. | `+/script -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat : tampon script | Installer/supprimer un script. | `+/script -go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[■ □ □] | haut / gauche | buflist | Déplacer le tampon vers un numéro inférieur. | Signal `+buflist_mouse+`.
| kbd:[■ □ □] | bas / droit | buflist | Déplacer le tampon vers un numéro supérieur. | Signal `+buflist_mouse+`.
| kbd:[■ □ □] | - | buflist | Aller au tampon (tampon précédent dans la liste des tampons visités si le tampon est le courant). | Signal `+buflist_mouse+`.
@@ -1840,8 +1895,8 @@ Ces touches et actions sont utilisées sur le tampon fset
| kbd:[Ctrl+l] (`L`) | | Rafraîchir les options et l'écran entier. | `+/fset -refresh+`
| | `$` | Rafraîchir les options (garder les options marquées). |
| | `$$` | Rafraîchir les options (démarquer toutes les options). |
| kbd:[Alt+p] | | Activer/désactiver la description des options d'extensions (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | | Activer/désactiver la barre d'aide. | `+/bar toggle fset+`
| kbd:[Alt+p] | `p` | Activer/désactiver la description des options d'extensions (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | `v` | Activer/désactiver la barre d'aide. | `+/bar toggle fset+`
| | `s:x,y` | Trier les options par les champs x,y (voir l'option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /set fset.look.sort x,y+`
| | `s:` | Réinitialiser le tri à sa valeur par défaut (voir l'option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /unset fset.look.sort+`
| | `w:xxx` | Exporter les options dans le fichier "xxx". | `+/fset -export xxx+`
@@ -1897,17 +1952,22 @@ Ces touches et actions sont utilisées sur le tampon script
[width="100%",cols="^.^3,^.^2,.^8,.^5",options="header"]
|===
| Touche | Action ^(1)^ | Description | Commande
| kbd:[↑] | | Move one line up. | `+/script up+`
| kbd:[↓] | | Move one line down. | `+/script down+`
| kbd:[PgUp] | | Move one page up. | `+/window page_up+`
| kbd:[PgDn] | | Move one page down. | `+/window page_down+`
| kbd:[Alt+i] | `i` | Install script. | `+/script install+`
| kbd:[Alt+r] | `r` | Remove script. | `+/script remove+`
| kbd:[Alt+l] (`L`) | `l` | Load script. | `+/script load+`
| kbd:[Alt+u] | `u` | Unload script. | `+/script unload+`
| kbd:[Alt+Shift+A] | `A` | Autoload script. | `+/script toggleautoload+`
| kbd:[Alt+h] | `h` | Hold/unhold script. | `+/script hold+`
| kbd:[Alt+v] | `v` | View script. | `+/script show+`
| kbd:[↑] | | Monter d'une ligne. | `+/script -up+`
| kbd:[↓] | | Descendre d'une ligne. | `+/script -down+`
| kbd:[PgUp] | | Monter d'une page. | `+/window page_up+`
| kbd:[PgDn] | | Descendre d'une page. | `+/window page_down+`
| kbd:[Alt+i] | `i` | Installer le script. | `+/script install+`
| kbd:[Alt+r] | `r` | Supprimer le script. | `+/script remove+`
| kbd:[Alt+l] | `l` | Charger le script. | `+/script load+`
| kbd:[Alt+L] | `L` | Recharger le script. | `+/script reload+`
| kbd:[Alt+u] | `u` | Décharger le script. | `+/script unload+`
| kbd:[Alt+Shift+A] | `A` | Charger automatiquement le script. | `+/script toggleautoload+`
| kbd:[Alt+h] | `h` | Figer/défiger le script. | `+/script hold+`
| kbd:[Alt+v] | `v` | Voir le script. | `+/script show+`
| | `s:x,y` | Trier les scripts par les champs x,y (voir l'option <<option_script.look.sort,script.look.sort>>). |
| | `s:` | Reset sort to its default value (voir l'option <<option_script.look.sort,script.look.sort>>). |
| | `$` | Rafraîchir la liste. |
| | `q` | Fermer le tampon. | `+/buffer close+`
|===
[NOTE]
@@ -2276,16 +2336,9 @@ Par exemple pour désactiver les « highlights » de "joe" et "mike" sur le ta
courant :
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
[NOTE]
La propriété de tampon "hotlist_max_level_nicks" n'est pas sauvegardée dans la
configuration. +
Vous pouvez facilement la sauvegarder avec le script _buffer_autoset.py_ : vous
pouvez l'installer avec `+/script install buffer_autoset.py+` et obtenir de l'aide
avec `+/help buffer_autoset+`.
[[highlights]]
=== Highlights
@@ -2310,16 +2363,9 @@ Ceci peut aussi être défini avec la propriété de tampon "highlight_disable_r
Même exemple, spécifique au tampon courant :
----
/buffer set highlight_disable_regex <flash.*>
/buffer setauto highlight_disable_regex <flash.*>
----
[NOTE]
La propriété de tampon "highlight_disable_regex" n'est pas sauvegardée dans la
configuration. +
Vous pouvez facilement la sauvegarder avec le script _buffer_autoset.py_ : vous
pouvez l'installer avec `+/script install buffer_autoset.py+` et obtenir de l'aide
avec `+/help buffer_autoset+`.
[[highlights_words]]
==== Ajouter des mots pour le « highlight »
@@ -2377,16 +2423,9 @@ Par exemple pour forcer le highlight sur tous les messages dans le canal
courant :
----
/buffer set highlight_regex .*
/buffer setauto highlight_regex .*
----
[NOTE]
La propriété de tampon "highlight_regex" n'est pas sauvegardée dans la
configuration. +
Vous pouvez facilement la sauvegarder avec le script _buffer_autoset.py_ : vous
pouvez l'installer avec `+/script install buffer_autoset.py+` et obtenir de l'aide
avec `+/help buffer_autoset+`.
[[buffer_logging]]
=== Enregistrement des tampons
@@ -3302,30 +3341,31 @@ Sections dans le fichier _weechat.conf_ :
[width="100%",cols="3m,6m,16",options="header"]
|===
| Section | Commande de contrôle | Description
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Niveau de debug, pour le cœur et les extensions (les options peuvent être ajoutées/supprimées dans la section).
| startup | /set weechat.startup.* | Options de démarrage.
| look | /set weechat.look.* | Aspect/présentation.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Alias de couleurs (les options peuvent être ajoutées/supprimées dans la section).
| color | /set weechat.color.* | Couleurs.
| completion | /set weechat.completion.* | Options de complétion.
| history | /set weechat.history.* | Options d'historique (commandes et tampons).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Options des proxies.
| network | /set weechat.network.* | Options réseau/TLS.
| plugin | /set weechat.plugin.* | Options sur les extensions.
| signal | /set weechat.signal.* | Options sur les signaux.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Options des barres.
| layout | <<command_weechat_layout,/layout>> | Dispositions.
| notify | <<command_weechat_buffer,/buffer notify>> | Niveaux de notification des tampons (les options peuvent être ajoutées/supprimées dans la section).
| filter | <<command_weechat_filter,/filter>> | Filtres.
| key | <<command_weechat_key,/key>> | Touches pour le contexte "default".
| key_search | <<command_weechat_key,/key>> | Touches pour le contexte "search".
| key_cursor | <<command_weechat_key,/key>> | Touches pour le contexte "cursor".
| key_mouse | <<command_weechat_key,/key>> | Touches pour le contexte "mouse".
| Section | Commande de contrôle | Description
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Niveau de debug, pour le cœur et les extensions (les options peuvent être ajoutées/supprimées dans la section).
| startup | /set weechat.startup.* | Options de démarrage.
| look | /set weechat.look.* | Aspect/présentation.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Alias de couleurs (les options peuvent être ajoutées/supprimées dans la section).
| color | /set weechat.color.* | Couleurs.
| completion | /set weechat.completion.* | Options de complétion.
| history | /set weechat.history.* | Options d'historique (commandes et tampons).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Options des proxies.
| network | /set weechat.network.* | Options réseau/TLS.
| plugin | /set weechat.plugin.* | Options sur les extensions.
| signal | /set weechat.signal.* | Options sur les signaux.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Options des barres.
| layout | <<command_weechat_layout,/layout>> | Dispositions.
| buffer | <<command_weechat_buffer,/buffer setauto>> | Propriétés appliquées automatiquement sur les tampons lorsqu'ils sont ouverts.
| notify | <<command_weechat_buffer,/buffer notify>> | Niveaux de notification des tampons (les options peuvent être ajoutées/supprimées dans la section).
| filter | <<command_weechat_filter,/filter>> | Filtres.
| key | <<command_weechat_key,/key>> | Touches pour le contexte "default".
| key_search | <<command_weechat_key,/key>> | Touches pour le contexte "search".
| key_cursor | <<command_weechat_key,/key>> | Touches pour le contexte "cursor".
| key_mouse | <<command_weechat_key,/key>> | Touches pour le contexte "mouse".
|===
Options :
@@ -4219,7 +4259,7 @@ et les variables supplémentaires suivantes sont disponibles :
[width="100%",cols="2,4,8",options="header"]
|===
| Variable | Description | Valeur / exemple
| `+${clientinfo}+` | Liste des CTCP supportés | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| `+${clientinfo}+` | Liste des CTCP supportés | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| `+${version}+` | Version de WeeChat | `+4.1.0-dev+`
| `+${versiongit}+` | Version de WeeChat + version Git ^(1)^ | `+4.1.0-dev (git: v4.0.0-51-g8f98b922a)+`
| `+${git}+` | Version Git ^(1)^ | `+v4.0.0-51-g8f98b922a+`
@@ -4242,11 +4282,9 @@ Les réponses CTCP par défaut sont :
[width="100%",cols="2,4,8",options="header"]
|===
| CTCP | Format de réponse | Exemple
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| FINGER | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| SOURCE | `+${download}+` | `+https://weechat.org/download/+`
| TIME | `+${time}+` | `+Sat, 08 Jul 2023 21:11:19 +0200+`
| USERINFO | `+${username} (${realname})+` | `+nom (John Doe)+`
| VERSION | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
|===
+44 -22
View File
@@ -644,6 +644,15 @@ If you are using the macOS Terminal app, enable the option
"Use option as meta key" in menu Settings/Keyboard. And then you can use the
kbd:[Option] key as meta key.
// TRANSLATION MISSING
[[enter_key]]
=== Some keys including Enter are not working, why?
If you run a WeeChat < 4.0.0 with configuration files created by any
version ≥ 4.0.0, the keys names become invalid and many keys won't work at all. +
To repair them, exit WeeChat, remove all sections `[key*]` from weechat.conf
and start WeeChat again: all default keys will be created.
[[customize_key_bindings]]
=== Come posso personalizzare le associazioni dei tasti?
@@ -1012,41 +1021,25 @@ Altri script correlati:
[[disable_highlights_for_specific_nicks]]
=== How can I disable highlights for specific nicks?
// TRANSLATION MISSING
You can use the
link:weechat_user.it.html#max_hotlist_level_nicks[hotlist_max_level_nicks_add ^↗^^]
buffer property to set the max hotlist level for some nicks, per buffer,
or per group of buffers (like IRC servers).
To only disable highlights, you'd have to set it to 2:
To only disable highlights, you'd have to set it to 2.
For the current buffer:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
This buffer property isn't stored in the configuration though.
To automatically reapply these buffer properties, you would need the
_buffer_autoset.py_ script:
For all channels on server "libera":
----
/script install buffer_autoset.py
/set weechat.buffer.irc.libera.*.hotlist_max_level_nicks_add joe:2,mike:2
----
For example, to permanently disable highlights from "mike" on #weechat
on the IRC server libera:
----
/buffer_autoset add irc.libera.#weechat hotlist_max_level_nicks_add mike:2
----
To apply it to the entire libera server instead:
----
/buffer_autoset add irc.libera hotlist_max_level_nicks_add mike:2
----
For more examples, see `+/help buffer_autoset+`.
[[irc_target_buffer]]
=== Come si può modificare il buffer destinazione per i comandi sui buffer uniti (come i buffer con i server)?
@@ -1267,6 +1260,35 @@ stored in _sec.conf_ with the `/secure` command).
See the link:weechat_user.it.html#files_and_directories[User's guide / Files and directories ^↗^^]
for more information about configuration files.
// TRANSLATION MISSING
[[move_to_another_device]]
=== I want to move my WeeChat to another device and keep my config, what should I copy?
First check directories used by WeeChat with this command: `/debug dirs`. +
Directories home/config and home/data must be copied (all files and sub-directories).
For example if you're using XDG directories (default with WeeChat ≥ 3.2),
the directories should be `$HOME/.config/weechat` and `$HOME/.local/share/weechat`. +
If you're using a single directory (default with WeeChat < 3.2), the directory
should be `$HOME/.weechat`.
[IMPORTANT]
The WeeChat version on the new device must be greater than or equal to the version
on the initial device. +
Downgrading WeeChat configuration is *NOT SUPPORTED* and can break it,
leading to unusable WeeChat.
Steps:
. Quit Weechat: `/quit` (or `/upgrade -quit` if you want to resume the session,
which includes content of all buffers).
. Copy all directories, sub-directories and files to the new device, keeping
same names and permissions.
. Optional: copy any file outside these directories that you refer to in your
configuration (it's not recommended to use files outside WeeChat directories).
. Start WeeChat on the new device: `weechat` (or `weechat --upgrade` if you
saved the session).
[[development]]
== Sviluppo
+207 -58
View File
@@ -4219,18 +4219,28 @@ Supported hash algorithms:
[width="100%",cols="2,2,3,6",options="header"]
|===
| Value | Algorithm | Hash size | Notes
| `+crc32+` | CRC32 | 4 bytes (32 bits) | Not a hash algorithm in the cryptographic sense.
| `+md5+` | MD5 | 16 bytes (128 bits) | *Weak*, not recommended for cryptography usage.
| `+sha1+` | SHA-1 | 20 bytes (160 bits) | *Weak*, not recommended for cryptography usage.
| `+sha224+` | SHA-224 | 28 bytes (224 bits) |
| `+sha256+` | SHA-256 | 32 bytes (256 bits) |
| `+sha384+` | SHA-384 | 48 bytes (384 bits) |
| `+sha512+` | SHA-512 | 64 bytes (512 bits) |
| `+sha3-224+` | SHA3-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| Value | Algorithm | Hash size | Notes
| `+crc32+` | CRC32 | 4 bytes (32 bits) | Not a hash algorithm in the cryptographic sense.
| `+md5+` | MD5 | 16 bytes (128 bits) | *Weak*, not recommended for cryptography usage.
| `+sha1+` | SHA-1 | 20 bytes (160 bits) | *Weak*, not recommended for cryptography usage.
| `+sha224+` | SHA-224 | 28 bytes (224 bits) |
| `+sha256+` | SHA-256 | 32 bytes (256 bits) |
| `+sha384+` | SHA-384 | 48 bytes (384 bits) |
| `+sha512+` | SHA-512 | 64 bytes (512 bits) |
| `+sha512-224+` | SHA-512/224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.9.4.
| `+sha512-256+` | SHA-512/256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.9.4.
| `+sha3-224+` | SHA3-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+blake2b-160+` | BLAKE2B-160 | 20 bytes (160 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-256+` | BLAKE2B-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-384+` | BLAKE2B-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-512+` | BLAKE2B-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-128+` | BLAKE2S-128 | 16 bytes (128 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-160+` | BLAKE2S-160 | 20 bytes (160 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-224+` | BLAKE2S-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-256+` | BLAKE2S-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
|===
Valore restituito:
@@ -4675,7 +4685,8 @@ Argomenti:
* _to_: destination file
* _compressor_: the compressor to use, one of:
** _gzip_: gzip compression
** _zstd_: zstandard compression
** _zstd_: zstandard compression (available only if zstd was enabled when
WeeChat was compiled)
* _compression_level_: compression level, between 1 (fast, low compression) to
100 (slow, best compression)
@@ -6980,9 +6991,10 @@ my_section_read_cb (const void *pointer, void *data,
{
/* ... */
return WEECHAT_CONFIG_READ_OK;
/* return WEECHAT_CONFIG_READ_MEMORY_ERROR; */
/* return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; */
return WEECHAT_CONFIG_OPTION_SET_OK_CHANGED;
/* return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; */
/* return WEECHAT_CONFIG_OPTION_SET_ERROR; */
/* return WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND; */
}
int
@@ -7072,7 +7084,7 @@ def config_new_section(config_file: str, name: str,
callback_delete_option: str, callback_delete_option_data: str) -> str: ...
# esempio
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -7091,7 +7103,7 @@ def my_section_write_default_cb(data: str, config_file: str, section_name: str)
# return weechat.WEECHAT_CONFIG_WRITE_ERROR
# return weechat.WEECHAT_CONFIG_WRITE_MEMORY_ERROR
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -7340,7 +7352,7 @@ Script (Python):
# prototipo
def config_new_option(config_file: str, section: str, name: str, type: str, description: str,
string_values: str, min: int, max: int,
default_value: str | None, value: str | None, null_value_allowed: int,
default_value: Union[str, None], value: Union[str, None], null_value_allowed: int,
callback_check_value: str, callback_check_value_data: str,
callback_change: str, callback_change_data: str,
callback_delete: str, callback_delete_data: str) -> str: ...
@@ -10374,7 +10386,6 @@ struct t_hook *weechat_hook_process (const char *command,
void *callback_data);
----
Argomenti:
// TRANSLATION MISSING
@@ -10644,25 +10655,8 @@ available:
_/dev/null_.
|===
Per il comando "url:..." sono disponibili le seguenti opzioni (consultare
`+man curl_easy_setopt+` per la descrizione di ogni opzione):
include::{autogendir}/autogen_api_url_options.it.adoc[tag=url_options]
// TRANSLATION MISSING
[NOTE]
^(1)^ Per le opzioni con il tipo "mask" il formato è: "value1+value2+value3";
for options with type "list", the list items must be separated by a newline
(`\n`). +
^(2)^ Quando sono disponibili le costanti, esse vanno usate come valore per
l'opzione.
Per un URL, sono consentite due opzioni aggiuntive (stringhe) per il file in
input/output:
* _file_in_: file da leggere e inviare con gli URL (invio del file "post")
* _file_out_: scrive URL scaricato/file in questo file (invece dello standard
* output)
For command "url:...", see available options in function <<_hook_url,hook_url>>.
Valore restituito:
@@ -10822,6 +10816,159 @@ hook4 = weechat.hook_process_hashtable("sh",
20000, "my_process_cb", "")
----
// TRANSLATION MISSING
==== hook_url
_WeeChat ≥ 4.1.0._
URL transfer.
Prototipo:
[source,c]
----
struct t_hook *weechat_hook_url (const char *url,
struct t_hashtable *options,
int timeout,
int (*callback)(const void *pointer,
void *data,
const char *url,
struct t_hashtable *options,
struct t_hashtable *output),
const void *callback_pointer,
void *callback_data);
----
Argomenti:
* _url_: URL
* _options_: options for URL transfer (see below); la tabella hash è duplicata
nella funzione, per cui è possibile liberarla dopo questa chiamata
* _timeout_: timeout for URL transfer (in milliseconds): after this timeout,
the transfer is stopped (0 means no timeout)
* _callback_: function called when the transfer has ended, arguments and return
value:
** _const void *pointer_: pointer
** _void *data_: pointer
** _const char *url_: URL
** _struct t_hashtable *options_: options
** _struct t_hashtable *output_: result (keys and values are strings), which may
contain the following keys:
*** _response_code_: HTTP response code
*** _headers_: HTTP headers in response
*** _output_: standard output (set only if _file_out_ was not set in options)
*** _error_: error message (set only in case of error)
** return value:
*** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_
* _callback_pointer_: puntatore fornito alla callback quando chiamata da WeeChat
* _callback_data_: puntatore fornito alla callback quando chiamata da WeeChat;
if not NULL, it must have been allocated with malloc (or similar function)
and it is automatically freed when the hook is deleted
The following Curl options are available (see `+man curl_easy_setopt+` for
a description of each option):
include::{autogendir}/autogen_api_url_options.it.adoc[tag=url_options]
// TRANSLATION MISSING
[NOTE]
^(1)^ Per le opzioni con il tipo "mask" il formato è: "value1+value2+value3";
for options with type "list", the list items must be separated by a newline
(`\n`). +
^(2)^ Quando sono disponibili le costanti, esse vanno usate come valore per
l'opzione.
These two extra options (strings) are allowed for input/output file:
[width="100%",cols="2,^1,7",options="header"]
|===
| Option | Type | Description
| file_in | string | file da leggere e inviare con gli URL (invio del file "post")
| file_out | string | scrive URL scaricato/file in questo file (invece dello standard output)
|===
Valore restituito:
* puntatore al nuovo hook, NULL in caso di errore
Esempio in C:
[source,c]
----
int
my_url_cb (const void *pointer, void *data, const char *url,
struct t_hashtable *options, struct t_hashtable *output)
{
weechat_printf (NULL, "response_code: %s", weechat_hashtable_get (output, "response_code"));
weechat_printf (NULL, "headers: %s", weechat_hashtable_get (output, "headers"));
weechat_printf (NULL, "output: %s", weechat_hashtable_get (output, "output"));
weechat_printf (NULL, "error: %s", weechat_hashtable_get (output, "error"));
return WEECHAT_RC_OK;
}
/* example 1: output to a file */
struct t_hashtable *options_url1 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url1)
{
weechat_hashtable_set (options_url1, "file_out", "/tmp/weechat.org.html");
struct t_hook *my_url_hook = weechat_hook_url ("https://weechat.org/",
options_url1,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url1);
}
/* example 2: custom HTTP headers, output sent to callback */
struct t_hashtable *options_url2 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url2)
{
weechat_hashtable_set (options_url2, "httpheader",
"Header1: value1\n"
"Header2: value2");
struct t_hook *my_url_hook = weechat_hook_url ("http://localhost:8080/",
options_url2,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url2);
}
----
Script (Python):
[source,python]
----
# prototipo
def hook_url(url: str, options: Dict[str, str], timeout: int, callback: str, callback_data: str) -> str: ...
# esempio
def my_url_cb(data: str, url: str, options: Dict[str, str], output: Dict[str, str]) -> int:
weechat.prnt("", "output: %s" % output)
return weechat.WEECHAT_RC_OK
# example 1: output to a file
hook1 = weechat.hook_url("https://weechat.org/",
{"file_out": "/tmp/weechat.org.html"},
20000, "my_url_cb", "")
# example 2: custom HTTP headers, output sent to callback
options = {
"httpheader": "\n".join([
"Header1: value1",
"Header2: value2",
]),
}
hook2 = weechat.hook_url("http://localhost:8080/", options, 20000, "my_url_cb", "")
----
==== hook_connect
// TRANSLATION MISSING
@@ -11016,7 +11163,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
// TRANSLATION MISSING
==== hook_line
_WeeChat ≥ 2.3, updated in 3.7, 4.1.0._
_WeeChat ≥ 2.3, updated in 3.7._
Hook a line to be printed in a buffer.
@@ -11087,13 +11234,13 @@ Line data sent to the callback is a hashtable, with following values
| Key | Value (formatted buffer) | Value (free buffer) | Examples
| buffer
| Comma-separated list of buffer pointers.
| Comma-separated list of buffer pointers.
| Buffer pointer.
| Buffer pointer.
| `+0x1234abcd+`
| buffer_name
| Comma-separated list of buffer names.
| Comma-separated list of buffer names.
| Buffer name.
| Buffer name.
| `+core.weechat+` +
`+irc.server.libera+` +
`+irc.libera.#weechat+`
@@ -11181,20 +11328,16 @@ in this hashtable):
| Key | Allowed value (formatted buffer) | Allowed value (free buffer) | Result
| buffer
| Comma-separated list buffer pointers (with formatted content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Comma-separated list buffer pointers (with free content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| The line is displayed on these buffers. +
| Pointer of a buffer with formatted content.
| Pointer of a buffer with free content.
| The line is displayed on this buffer. +
If the value is empty, the line is deleted (anything else in the hashtable
is then ignored); the next hooks of type "line" are not called.
| buffer_name
| Comma-separated list buffer names (with formatted content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Comma-separated list buffer names (with free content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| The line is displayed on these buffers. +
| Name of a buffer with formatted content.
| Name of a buffer with free content.
| The line is displayed on this buffer. +
If `buffer` is also set, the value of `+buffer_name+` has higher priority and is used. +
If the value is empty, the line is deleted (anything else in the hashtable
is then ignored); the next hooks of type "line" are not called.
@@ -19412,7 +19555,7 @@ for key in hash:
// TRANSLATION MISSING
==== hdata_compare
_WeeChat ≥ 1.9._
_WeeChat ≥ 1.9, updated in 4.1.0._
Compare a hdata variable of two objects.
@@ -19428,8 +19571,8 @@ Argomenti:
* _hdata_: hdata pointer
* _pointer1_: pointer to first WeeChat/plugin object
* _pointer2_: pointer to second WeeChat/plugin object
* _name_: variable name; for arrays, the name can be "N|name" where N is
the index in array (starting at 0), for example: "2|name"
* _name_: variable name or path to a variable name; for arrays, the name can be
"N|name" where N is the index in array (starting at 0), for example: "2|name"
* _case_sensitive_: 1 for case sensitive comparison of strings, otherwise 0
Valore restituito:
@@ -19445,8 +19588,12 @@ Esempio in C:
struct t_hdata *hdata = weechat_hdata_get ("buffer");
struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat");
struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr");
weechat_printf (NULL, "number comparison = %d",
weechat_printf (NULL, "comparison of buffer number = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
weechat_printf (NULL, "comparison of number of lines = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0));
weechat_printf (NULL, "comparison of local variable = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0));
----
Script (Python):
@@ -19460,7 +19607,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens
hdata = weechat.hdata_get("buffer")
buffer1 = weechat.buffer_search("irc", "libera.#weechat")
buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr")
weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparison of buffer number = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparison of number of lines = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0))
weechat.prnt("", "comparison of local variable = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0))
----
// TRANSLATION MISSING
+132 -85
View File
@@ -159,11 +159,6 @@ WeeChat:
| Logger plugin: compression of rotated log files (gzip). +
Relay plugin: compression of messages (WeeChat -> client) with https://zlib.net/[zlib ^↗^^] (weechat protocol). +
Script plugin: read of repository index file (gzip).
// TRANSLATION MISSING
| libzstd-dev | ≥ 0.8.1
| Logger plugin: compression of rotated log files. +
Relay plugin: compression of messages (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat protocol).
|===
[NOTE]
@@ -181,32 +176,75 @@ WeeChat:
[width="100%",cols="5,^3,.^15",options="header"]
|===
// TRANSLATION MISSING
| Pacchetto ^(1)^ | Versione | Features
| Pacchetto ^(1)^ | Versione | Features
// TRANSLATION MISSING
| {cpp} compiler (pass:[g++ / clang++]) | | Build and run tests, plugin JavaScript.
| gettext | | Internazionalizzazione (traduzione dei messaggi; la lingua base è l'inglese).
| ca-certificates | | Certificati per le connessioni TLS.
| libaspell-dev / libenchant-dev | | Plugin spell.
| python3-dev | ≥ 3.0 | Plugin python.
| libperl-dev | | Plugin perl.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1 | Plugin ruby.
| liblua5.4-dev | | Plugin lua.
| tcl-dev | ≥ 8.5 | Plugin tcl.
| guile-3.0-dev | ≥ 2.0 | Plugin guile (scheme).
| libv8-dev | ≤ 3.24.3 | Plugin javascript.
| php-dev | ≥ 7.0 | Plugin php.
| libphp-embed | ≥ 7.0 | Plugin php.
| libxml2-dev | | Plugin php.
| {cpp} compiler (pass:[g++ / clang++]) |
| Build and run tests, plugin JavaScript.
| gettext |
| Internazionalizzazione (traduzione dei messaggi; la lingua base è l'inglese).
| ca-certificates |
| Certificati per le connessioni TLS.
// TRANSLATION MISSING
| libargon2-dev | | Plugin php (if PHP ≥ 7.2).
| libzstd-dev | ≥ 0.8.1
| Logger plugin: compression of rotated log files (zstandard). +
Relay plugin: compression of messages (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat protocol).
| libaspell-dev / libenchant-dev |
| Plugin spell.
| python3-dev | ≥ 3.0
| Plugin python.
| libperl-dev |
| Plugin perl.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1
| Plugin ruby.
| liblua5.4-dev |
| Plugin lua.
| tcl-dev | ≥ 8.5
| Plugin tcl.
| guile-3.0-dev | ≥ 2.0
| Plugin guile (scheme).
| libv8-dev | ≤ 3.24.3
| Plugin javascript.
| php-dev | ≥ 7.0
| Plugin php.
| libphp-embed | ≥ 7.0
| Plugin php.
| libxml2-dev |
| Plugin php.
// TRANSLATION MISSING
| libsodium-dev | | Plugin php (if PHP ≥ 7.2).
| libargon2-dev |
| Plugin php (if PHP ≥ 7.2).
// TRANSLATION MISSING
| asciidoctor | ≥ 1.5.4 | Build man page and documentation.
| libsodium-dev |
| Plugin php (if PHP ≥ 7.2).
// TRANSLATION MISSING
| ruby-pygments.rb | | Build documentation.
| asciidoctor | ≥ 1.5.4
| Build man page and documentation.
// TRANSLATION MISSING
| libcpputest-dev | ≥ 3.4 | Build and run tests.
| ruby-pygments.rb |
| Build documentation.
// TRANSLATION MISSING
| libcpputest-dev | ≥ 3.4
| Build and run tests.
|===
[NOTE]
@@ -252,7 +290,7 @@ $ make install
Options can be used for CMake, with format: `-DOPTION=VALUE`.
// TRANSLATION MISSING
List of commonly used options:
List of available options:
// TRANSLATION MISSING
[width="100%",cols="3m,3,3m,10",options="header"]
@@ -266,7 +304,6 @@ List of commonly used options:
| CMAKE_INSTALL_PREFIX | directory | /usr/local
| The directory where WeeChat will be installed.
// TRANSLATION MISSING
| WEECHAT_HOME | directory | (empty string)
| The default home directory when running WeeChat. +
With an empty value (recommended), XDG directories are used by default.
@@ -289,7 +326,6 @@ List of commonly used options:
| ENABLE_DOC | `ON`, `OFF` | OFF
| Build HTML documentation.
// TRANSLATION MISSING
| ENABLE_DOC_INCOMPLETE | `ON`, `OFF` | OFF
| Force build of documentation even if some plugins are not compiled
(not recommended: docs will be incomplete).
@@ -309,6 +345,9 @@ List of commonly used options:
| ENABLE_GUILE | `ON`, `OFF` | ON
| Compile <<scripting_plugins,Guile plugin>> (Scheme).
| ENABLE_HEADLESS | `ON`, `OFF` | ON
| Compile headless binary.
| ENABLE_IRC | `ON`, `OFF` | ON
| Compile <<irc,IRC plugin>>.
@@ -367,6 +406,10 @@ List of commonly used options:
| ENABLE_XFER | `ON`, `OFF` | ON
| Compile <<xfer,Xfer plugin>>.
// TRANSLATION MISSING
| ENABLE_ZSTD | `ON`, `OFF` | ON
| Enable https://facebook.github.io/zstd/[Zstandard ^↗^^] compression.
| ENABLE_TESTS | `ON`, `OFF` | OFF
| Compile tests.
@@ -988,6 +1031,10 @@ Other items available (not used in bars by default):
| buffer_short_name | `#test` | Current buffer short name.
| buflist2 | `1.weechat` | List of buffers, second bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist3 | `1.weechat` | List of buffers, third bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| buflist4 | `1.weechat` | List of buffers, fourth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| buflist5 | `1.weechat` | List of buffers, fifth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
| fset | `+buflist.look.sort: …+` | Help on currently selected option on fset buffer.
| irc_channel | `#test` | Current IRC channel name.
| irc_host | `+user@host.com+` | Current IRC host.
@@ -1532,7 +1579,8 @@ External plugins and scripts can define and use other local variables.
// TRANSLATION MISSING
Buflist plugin displays a list of buffers in a bar item called "buflist"
(two other bar items "buflist2" and "buflist3" are available as well). +
(four other bar items "buflist2", "buflist3", "buflist4" and "buflist5" are
available as well). +
A default bar "buflist" is created on startup with this item.
[[buflist_commands]]
@@ -1691,6 +1739,16 @@ They can be changed and new ones can be added with the <<command_weechat_key,/ke
| kbd:[Ctrl+↓] | Chiama il comando/messaggio successivo nella cronologia globale (identico per tutti i buffer). | `+/input history_global_next+`
|===
// TRANSLATION MISSING
[[key_bindings_cmdline_system]]
==== System
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Tasti | Descrizione | Comando
| kbd:[Ctrl+z] | Suspend WeeChat process. | `+/sys suspend+`
|===
// TRANSLATION MISSING
[[key_bindings_buffers]]
=== Buffers
@@ -1932,13 +1990,13 @@ These mouse actions are possible only if mouse is enabled with key kbd:[Alt+m]
// TRANSLATION MISSING
| kbd:[□ □ ■] | - | chat: /list buffer | Join IRC channel on selected line. | `+hsignal:irc_list_mouse+`
// TRANSLATION MISSING
| kbd:[▲] | - | chat: script buffer | Move 5 lines up in script buffer. | `+/script up 5+`
| kbd:[▲] | - | chat: script buffer | Move 5 lines up in script buffer. | `+/script -up 5+`
// TRANSLATION MISSING
| kbd:[▼] | - | chat: script buffer | Move 5 lines down in script buffer. | `+/script down 5+`
| kbd:[▼] | - | chat: script buffer | Move 5 lines down in script buffer. | `+/script -down 5+`
// TRANSLATION MISSING
| kbd:[■ □ □] | - | chat: script buffer | Select line in script buffer. | `+/script go ${_chat_line_y}+`
| kbd:[■ □ □] | - | chat: script buffer | Select line in script buffer. | `+/script -go ${_chat_line_y}+`
// TRANSLATION MISSING
| kbd:[□ □ ■] | - | chat: script buffer | Install/remove script. | `+/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[□ □ ■] | - | chat: script buffer | Install/remove script. | `+/script -go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
// TRANSLATION MISSING
| kbd:[■ □ □] | up / left | buflist | Move buffer to a lower number. | Signal `+buflist_mouse+`.
// TRANSLATION MISSING
@@ -2011,8 +2069,8 @@ These keys and actions are used on the fset buffer (see <<fset,Fset plugin>>).
| kbd:[Ctrl+l] (`L`) | | Refresh options and whole screen. | `+/fset -refresh+`
| | `$` | Refresh options (keep marked options). |
| | `$$` | Refresh options (unmark all options). |
| kbd:[Alt+p] | | Toggle plugin description options (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | | Toggle help bar. | `+/bar toggle fset+`
| kbd:[Alt+p] | `p` | Toggle plugin description options (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | `v` | Toggle help bar. | `+/bar toggle fset+`
| | `s:x,y` | Sort options by fields x,y (see option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /set fset.look.sort x,y+`
| | `s:` | Reset sort to its default value (see option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /unset fset.look.sort+`
| | `w:xxx` | Export options in file "xxx". | `+/fset -export xxx+`
@@ -2071,17 +2129,22 @@ These keys and actions are used on the script buffer (see <<script_manager,scrip
[width="100%",cols="^.^3,^.^2,.^8,.^5",options="header"]
|===
| Key | Action ^(1)^ | Description | Command
| kbd:[↑] | | Move one line up. | `+/script up+`
| kbd:[↓] | | Move one line down. | `+/script down+`
| kbd:[↑] | | Move one line up. | `+/script -up+`
| kbd:[↓] | | Move one line down. | `+/script -down+`
| kbd:[PgUp] | | Move one page up. | `+/window page_up+`
| kbd:[PgDn] | | Move one page down. | `+/window page_down+`
| kbd:[Alt+i] | `i` | Install script. | `+/script install+`
| kbd:[Alt+r] | `r` | Remove script. | `+/script remove+`
| kbd:[Alt+l] (`L`) | `l` | Load script. | `+/script load+`
| kbd:[Alt+l] | `l` | Load script. | `+/script load+`
| kbd:[Alt+L] | `L` | Reload script. | `+/script reload+`
| kbd:[Alt+u] | `u` | Unload script. | `+/script unload+`
| kbd:[Alt+Shift+A] | `A` | Autoload script. | `+/script toggleautoload+`
| kbd:[Alt+h] | `h` | Hold/unhold script. | `+/script hold+`
| kbd:[Alt+v] | `v` | View script. | `+/script show+`
| | `s:x,y` | Sort scripts by fields x,y (see option <<option_script.look.sort,script.look.sort>>). |
| | `s:` | Reset sort to its default value (see option <<option_script.look.sort,script.look.sort>>). |
| | `$` | Refresh list. |
| | `q` | Close buffer. | `+/buffer close+`
|===
// TRANSLATION MISSING
@@ -2460,14 +2523,9 @@ and for each nick the max hotlist level to trigger, possible levels are:
For example to disable highlights from "joe" and "mike" on current buffer:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
[NOTE]
The buffer property "hotlist_max_level_nicks" is not saved in configuration. +
You can easily save it with the script _buffer_autoset.py_: you can install it
with `+/script install buffer_autoset.py+` and get help with `+/help buffer_autoset+`.
// TRANSLATION MISSING
[[highlights]]
=== Highlights
@@ -2494,15 +2552,9 @@ This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
/buffer setauto highlight_disable_regex <flash.*>
----
[NOTE]
The buffer property "highlight_disable_regex" is not saved in configuration. +
You can easily save it with the script _buffer_autoset.py_: you can install it
with `+/script install buffer_autoset.py+` and get help with
`+/help buffer_autoset+`.
[[highlights_words]]
==== Add words to highlight
@@ -2557,14 +2609,9 @@ You can force highlight using a regular expression with the buffer property
For example to force the highlight on all messages in the current buffer:
----
/buffer set highlight_regex .*
/buffer setauto highlight_regex .*
----
[NOTE]
The buffer property "highlight_regex" is not saved in configuration. +
You can easily save it with the script _buffer_autoset.py_: you can install it
with `+/script install buffer_autoset.py+` and get help with `+/help buffer_autoset+`.
// TRANSLATION MISSING
[[buffer_logging]]
=== Buffer logging
@@ -3489,32 +3536,34 @@ Sections in file _weechat.conf_:
// TRANSLATION MISSING
[width="100%",cols="3m,6m,16",options="header"]
|===
| Section | Control command | Description
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Debug level, for core and plugins (options can be added/removed in section).
| startup | /set weechat.startup.* | Startup options.
| look | /set weechat.look.* | Look and feel.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Color aliases (options can be added/removed in section).
| color | /set weechat.color.* | Colors.
| completion | /set weechat.completion.* | Completion options.
| history | /set weechat.history.* | History options (commands and buffers).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Proxy options.
| network | /set weechat.network.* | Network/TLS options.
| Section | Control command | Description
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Debug level, for core and plugins (options can be added/removed in section).
| startup | /set weechat.startup.* | Startup options.
| look | /set weechat.look.* | Look and feel.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Color aliases (options can be added/removed in section).
| color | /set weechat.color.* | Colors.
| completion | /set weechat.completion.* | Completion options.
| history | /set weechat.history.* | History options (commands and buffers).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Proxy options.
| network | /set weechat.network.* | Network/TLS options.
// TRANSLATION MISSING
| plugin | /set weechat.plugin.* | Options on plugins.
| plugin | /set weechat.plugin.* | Options on plugins.
// TRANSLATION MISSING
| signal | /set weechat.signal.* | Options on signals.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Bar options.
| layout | <<command_weechat_layout,/layout>> | Layouts.
| notify | <<command_weechat_buffer,/buffer notify>> | Notify levels for buffers (options can be added/removed in section).
| filter | <<command_weechat_filter,/filter>> | Filters.
| key | <<command_weechat_key,/key>> | Keys in default context.
| key_search | <<command_weechat_key,/key>> | Keys in search context.
| key_cursor | <<command_weechat_key,/key>> | Keys in cursor context.
| key_mouse | <<command_weechat_key,/key>> | Keys in mouse context.
| signal | /set weechat.signal.* | Options on signals.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Bar options.
| layout | <<command_weechat_layout,/layout>> | Layouts.
// TRANSLATION MISSING
| buffer | <<command_weechat_buffer,/buffer setauto>> | Properties auto-applied on buffers when they are opened.
| notify | <<command_weechat_buffer,/buffer notify>> | Notify levels for buffers (options can be added/removed in section).
| filter | <<command_weechat_filter,/filter>> | Filters.
| key | <<command_weechat_key,/key>> | Keys in default context.
| key_search | <<command_weechat_key,/key>> | Keys in search context.
| key_cursor | <<command_weechat_key,/key>> | Keys in cursor context.
| key_mouse | <<command_weechat_key,/key>> | Keys in mouse context.
|===
// TRANSLATION MISSING
@@ -4420,7 +4469,7 @@ the following extra variables are available:
|===
// TRANSLATION MISSING
| Variable | Descrizione | Valore/esempio
| `+${clientinfo}+` | Elenco di CTCP supportate | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| `+${clientinfo}+` | Elenco di CTCP supportate | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| `+${version}+` | Versione di WeeChat | `+4.1.0-dev+`
// TRANSLATION MISSING
| `+${versiongit}+` | Versione di WeeChat + Git version ^(1)^ | `+4.1.0-dev (git: v4.0.0-51-g8f98b922a)+`
@@ -4446,11 +4495,9 @@ The default CTCP replies are:
[width="100%",cols="2,4,8",options="header"]
|===
| CTCP | Formato risposta | Esempio
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| FINGER | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| SOURCE | `+${download}+` | `+https://weechat.org/download/+`
| TIME | `+${time}+` | `+Sat, 08 Jul 2023 21:11:19 +0200+`
| USERINFO | `+${username} (${realname})+` | `+name (John Doe)+`
| VERSION | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
|===
+7
View File
@@ -152,6 +152,8 @@ WeeChat "core" は以下のディレクトリに配置されています:
// TRANSLATION MISSING
|    wee-signal.c | Signal functions.
|    wee-string.c | 文字列関数
// TRANSLATION MISSING
|    wee-sys.c | System functions.
|    wee-upgrade-file.c | 内部アップグレードシステム
|    wee-upgrade.c | WeeChat コアのアップグレード (バッファ、行、履歴、...)
|    wee-url.c | URL 転送 (libcurl を使う)
@@ -178,6 +180,7 @@ WeeChat "core" は以下のディレクトリに配置されています:
|       wee-hook-process.c | "process" フック
|       wee-hook-signal.c | "signal" フック
|       wee-hook-timer.c | "timer" フック
|       wee-hook-url.c | "url" フック
| gui/ | バッファ、ウィンドウなどの関数 (全てのインターフェースで利用)
|    gui-bar-item.c | バー要素
|    gui-bar-window.c | バーウィンドウ
@@ -248,6 +251,8 @@ WeeChat "core" は以下のディレクトリに配置されています:
|       buflist.c | buflist の主要関数
|       buflist-bar-item.c | buflist バー要素
|       buflist-command.c | buflist コマンド
// TRANSLATION MISSING
|       buflist-completion.c | Buflist completions.
|       buflist-config.c | buflist 設定オプション (buflist.conf ファイル)
|       buflist-info.c | buflist の情報/インフォリスト/hdata
|       buflist-mouse.c | buflist マウス動作
@@ -452,6 +457,8 @@ WeeChat "core" は以下のディレクトリに配置されています:
|          test-core-url.cpp | テスト: URL
|          test-core-utf8.cpp | テスト: UTF-8
|          test-core-util.cpp | テスト: ユーティリティ関数
// TRANSLATION MISSING
|          test-core-sys.cpp | Tests: system functions.
|       gui/ | インターフェースの単体テストを収める最上位ディレクトリ
// TRANSLATION MISSING
|          test-gui-bar-window.cpp | Tests: bar window functions.
+46 -20
View File
@@ -598,6 +598,15 @@ macOS のターミナル.app を使っている場合、設定メニューのキ
キーを使用」を有効化してください。こうすることで、kbd:[Option]
キーをメタキーとして使うことが可能です。
// TRANSLATION MISSING
[[enter_key]]
=== Some keys including Enter are not working, why?
If you run a WeeChat < 4.0.0 with configuration files created by any
version ≥ 4.0.0, the keys names become invalid and many keys won't work at all. +
To repair them, exit WeeChat, remove all sections `[key*]` from weechat.conf
and start WeeChat again: all default keys will be created.
[[customize_key_bindings]]
=== どうすればキー割り当てをカスタマイズできますか。
@@ -953,34 +962,22 @@ link:weechat_user.ja.html#max_hotlist_level_nicks[hotlist_max_level_nicks_add ^
buffer property to set the max hotlist level for some nicks, per buffer,
or per group of buffers (like IRC servers).
ハイライトを無効化するだけなら、このプロパティを 2 に設定してください:
ハイライトを無効化するだけなら、このプロパティを 2 に設定してください.
// TRANSLATION MISSING
For the current buffer:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
このバッファプロパティは設定に保存されません。このバッファプロパティを自動的に適用するには、_buffer_autoset.py_
スクリプトが必要です:
// TRANSLATION MISSING
For all channels on server "libera":
----
/script install buffer_autoset.py
/set weechat.buffer.irc.libera.*.hotlist_max_level_nicks_add joe:2,mike:2
----
例えば、IRC サーバ libera のチャンネル #weechat に参加している "mike"
の発言に対してハイライトを永久的に無効化するには以下のように設定します:
----
/buffer_autoset add irc.libera.#weechat hotlist_max_level_nicks_add mike:2
----
この設定をすべての libera サーバのバッファに対して適用するには以下のように設定します:
----
/buffer_autoset add irc.libera hotlist_max_level_nicks_add mike:2
----
これ以外の例は `+/help buffer_autoset+` を参照してください。
[[irc_target_buffer]]
=== どうすればマージされたバッファ内であるコマンドを発行するターゲットバッファを変更できますか。
@@ -1186,6 +1183,35 @@ stored in _sec.conf_ with the `/secure` command).
設定ファイルに関する詳しい情報はlink:weechat_user.ja.html#files_and_directories[ユーザーズガイド / ファイルとディレクトリ ^↗^^]を参照してください。
// TRANSLATION MISSING
[[move_to_another_device]]
=== I want to move my WeeChat to another device and keep my config, what should I copy?
First check directories used by WeeChat with this command: `/debug dirs`. +
Directories home/config and home/data must be copied (all files and sub-directories).
For example if you're using XDG directories (default with WeeChat ≥ 3.2),
the directories should be `$HOME/.config/weechat` and `$HOME/.local/share/weechat`. +
If you're using a single directory (default with WeeChat < 3.2), the directory
should be `$HOME/.weechat`.
[IMPORTANT]
The WeeChat version on the new device must be greater than or equal to the version
on the initial device. +
Downgrading WeeChat configuration is *NOT SUPPORTED* and can break it,
leading to unusable WeeChat.
Steps:
. Quit Weechat: `/quit` (or `/upgrade -quit` if you want to resume the session,
which includes content of all buffers).
. Copy all directories, sub-directories and files to the new device, keeping
same names and permissions.
. Optional: copy any file outside these directories that you refer to in your
configuration (it's not recommended to use files outside WeeChat directories).
. Start WeeChat on the new device: `weechat` (or `weechat --upgrade` if you
saved the session).
[[development]]
== 開発
+208 -63
View File
@@ -2430,7 +2430,6 @@ _WeeChat バージョン 2.4 以上で利用可。_
base 16、32、64 で文字列をエンコード。
プロトタイプ:
[source,c]
@@ -4141,18 +4140,28 @@ Supported hash algorithms:
[width="100%",cols="2,2,3,6",options="header"]
|===
| Value | Algorithm | Hash size | Notes
| `+crc32+` | CRC32 | 4 bytes (32 bits) | Not a hash algorithm in the cryptographic sense.
| `+md5+` | MD5 | 16 bytes (128 bits) | *Weak*, not recommended for cryptography usage.
| `+sha1+` | SHA-1 | 20 bytes (160 bits) | *Weak*, not recommended for cryptography usage.
| `+sha224+` | SHA-224 | 28 bytes (224 bits) |
| `+sha256+` | SHA-256 | 32 bytes (256 bits) |
| `+sha384+` | SHA-384 | 48 bytes (384 bits) |
| `+sha512+` | SHA-512 | 64 bytes (512 bits) |
| `+sha3-224+` | SHA3-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| Value | Algorithm | Hash size | Notes
| `+crc32+` | CRC32 | 4 bytes (32 bits) | Not a hash algorithm in the cryptographic sense.
| `+md5+` | MD5 | 16 bytes (128 bits) | *Weak*, not recommended for cryptography usage.
| `+sha1+` | SHA-1 | 20 bytes (160 bits) | *Weak*, not recommended for cryptography usage.
| `+sha224+` | SHA-224 | 28 bytes (224 bits) |
| `+sha256+` | SHA-256 | 32 bytes (256 bits) |
| `+sha384+` | SHA-384 | 48 bytes (384 bits) |
| `+sha512+` | SHA-512 | 64 bytes (512 bits) |
| `+sha512-224+` | SHA-512/224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.9.4.
| `+sha512-256+` | SHA-512/256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.9.4.
| `+sha3-224+` | SHA3-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.7.0.
| `+blake2b-160+` | BLAKE2B-160 | 20 bytes (160 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-256+` | BLAKE2B-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-384+` | BLAKE2B-384 | 48 bytes (384 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2b-512+` | BLAKE2B-512 | 64 bytes (512 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-128+` | BLAKE2S-128 | 16 bytes (128 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-160+` | BLAKE2S-160 | 20 bytes (160 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-224+` | BLAKE2S-224 | 28 bytes (224 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
| `+blake2s-256+` | BLAKE2S-256 | 32 bytes (256 bits) | Algorithm available with libgcrypt ≥ 1.8.0.
|===
戻り値:
@@ -4592,7 +4601,8 @@ int weechat_file_compress (const char *from, const char *to,
* _to_: destination file
* _compressor_: the compressor to use, one of:
** _gzip_: gzip compression
** _zstd_: zstandard compression
** _zstd_: zstandard compression (available only if zstd was enabled when
WeeChat was compiled)
* _compression_level_: compression level, between 1 (fast, low compression) to
100 (slow, best compression)
@@ -6784,9 +6794,10 @@ my_section_read_cb (const void *pointer, void *data,
{
/* ... */
return WEECHAT_CONFIG_READ_OK;
/* return WEECHAT_CONFIG_READ_MEMORY_ERROR; */
/* return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; */
return WEECHAT_CONFIG_OPTION_SET_OK_CHANGED;
/* return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; */
/* return WEECHAT_CONFIG_OPTION_SET_ERROR; */
/* return WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND; */
}
int
@@ -6876,7 +6887,7 @@ def config_new_section(config_file: str, name: str,
callback_delete_option: str, callback_delete_option_data: str) -> str: ...
# 例
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -6895,7 +6906,7 @@ def my_section_write_default_cb(data: str, config_file: str, section_name: str)
# return weechat.WEECHAT_CONFIG_WRITE_ERROR
# return weechat.WEECHAT_CONFIG_WRITE_MEMORY_ERROR
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -7140,7 +7151,7 @@ struct t_config_option *option_enum =
# プロトタイプ
def config_new_option(config_file: str, section: str, name: str, type: str, description: str,
string_values: str, min: int, max: int,
default_value: str | None, value: str | None, null_value_allowed: int,
default_value: Union[str, None], value: Union[str, None], null_value_allowed: int,
callback_check_value: str, callback_check_value_data: str,
callback_change: str, callback_change_data: str,
callback_delete: str, callback_delete_data: str) -> str: ...
@@ -7200,7 +7211,6 @@ Ruby では、3 組のコールバックとデータ (6 つの文字列変数)
link:++weechat_scripting.ja.html#_ruby++[WeeChat スクリプト作成ガイド ^↗^^]を参照してください
_(WeeChat バージョン 0.4.1 で修正済み)_。
==== config_search_option
設定ファイルのセクションからオプションを検索。
@@ -10123,7 +10133,6 @@ struct t_hook *weechat_hook_process (const char *command,
void *callback_data);
----
引数:
* _command_: 子プロセスで実行するコマンド、URL _(WeeChat バージョン 0.3.7 以上で利用可)_
@@ -10379,22 +10388,8 @@ struct t_hook *weechat_hook_process_hashtable (const char *command,
_/dev/null_ にリダイレクトする
|===
"url:..." 型のコマンドでは、以下のコマンドを使うことができます
(それぞれのオプションについては `+man curl_easy_setopt+` を参照):
include::{autogendir}/autogen_api_url_options.ja.adoc[tag=url_options]
[NOTE]
^(1)^ "mask" タイプのオプションでは、フォーマットは "value1+value2+value3" です。
"list" タイプのオプションでは、リスト要素を改行で区切ってください。
(`\n`). +
^(2)^ 定数が利用可能な場合、定数は必ずオプションの値に含めてください。
URL では、入力/出力ファイル用に 2 つのオプション (文字列) を使うことができます:
* _file_in_: 読み込んで URL に送信するファイル (ファイルを送信)
* _file_out_: ダウンロードした URL/ファイルをこのファイルに書き込む
(標準出力を使わない)
// TRANSLATION MISSING
For command "url:...", see available options in function <<_hook_url,hook_url>>.
戻り値:
@@ -10554,6 +10549,157 @@ hook4 = weechat.hook_process_hashtable("sh",
20000, "my_process_cb", "")
----
// TRANSLATION MISSING
==== hook_url
_WeeChat ≥ 4.1.0._
URL transfer.
プロトタイプ:
[source,c]
----
struct t_hook *weechat_hook_url (const char *url,
struct t_hashtable *options,
int timeout,
int (*callback)(const void *pointer,
void *data,
const char *url,
struct t_hashtable *options,
struct t_hashtable *output),
const void *callback_pointer,
void *callback_data);
----
引数:
* _url_: URL
* _options_: options for URL transfer (see below);
ハッシュテーブルは関数の中で複製されるため、この関数を呼び出した後にハッシュテーブルを安全に開放できます。
* _timeout_: timeout for URL transfer (in milliseconds): after this timeout,
the transfer is stopped (0 means no timeout)
* _callback_: function called when the transfer has ended, arguments and return
value:
** _const void *pointer_: pointer
** _void *data_: pointer
** _const char *url_: URL
** _struct t_hashtable *options_: options
** _struct t_hashtable *output_: result (keys and values are strings), which may
contain the following keys:
*** _response_code_: HTTP response code
*** _headers_: HTTP headers in response
*** _output_: standard output (set only if _file_out_ was not set in options)
*** _error_: error message (set only in case of error)
** return value:
*** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_
* _callback_pointer_: WeeChat が _callback_ コールバックを呼び出す際にコールバックに渡すポインタ
* _callback_data_: WeeChat が _callback_ コールバックを呼び出す際にコールバックに渡すポインタ;
このポインタが NULL でない場合、このポインタは malloc (または類似の関数)
によって割り当てられたものでなければいけません。さらに、このポインタはここで作成したフックが削除された時点で自動的に開放されます
The following Curl options are available (see `+man curl_easy_setopt+` for
a description of each option):
include::{autogendir}/autogen_api_url_options.ja.adoc[tag=url_options]
[NOTE]
^(1)^ "mask" タイプのオプションでは、フォーマットは "value1+value2+value3" です。
"list" タイプのオプションでは、リスト要素を改行で区切ってください。
(`\n`). +
^(2)^ 定数が利用可能な場合、定数は必ずオプションの値に含めてください。
These two extra options (strings) are allowed for input/output file:
[width="100%",cols="2,^1,7",options="header"]
|===
| Option | Type | Description
| file_in | string | 読み込んで URL に送信するファイル (ファイルを送信)
| file_out | string | ダウンロードした URL/ファイルをこのファイルに書き込む (標準出力を使わない)
|===
戻り値:
* 新しいフックへのポインタ、エラーが起きた場合は NULL
C 言語での使用例:
[source,c]
----
int
my_url_cb (const void *pointer, void *data, const char *url,
struct t_hashtable *options, struct t_hashtable *output)
{
weechat_printf (NULL, "response_code: %s", weechat_hashtable_get (output, "response_code"));
weechat_printf (NULL, "headers: %s", weechat_hashtable_get (output, "headers"));
weechat_printf (NULL, "output: %s", weechat_hashtable_get (output, "output"));
weechat_printf (NULL, "error: %s", weechat_hashtable_get (output, "error"));
return WEECHAT_RC_OK;
}
/* example 1: output to a file */
struct t_hashtable *options_url1 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url1)
{
weechat_hashtable_set (options_url1, "file_out", "/tmp/weechat.org.html");
struct t_hook *my_url_hook = weechat_hook_url ("https://weechat.org/",
options_url1,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url1);
}
/* example 2: custom HTTP headers, output sent to callback */
struct t_hashtable *options_url2 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url2)
{
weechat_hashtable_set (options_url2, "httpheader",
"Header1: value1\n"
"Header2: value2");
struct t_hook *my_url_hook = weechat_hook_url ("http://localhost:8080/",
options_url2,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url2);
}
----
スクリプト (Python) での使用例:
[source,python]
----
# プロトタイプ
def hook_url(url: str, options: Dict[str, str], timeout: int, callback: str, callback_data: str) -> str: ...
# 例
def my_url_cb(data: str, url: str, options: Dict[str, str], output: Dict[str, str]) -> int:
weechat.prnt("", "output: %s" % output)
return weechat.WEECHAT_RC_OK
# example 1: output to a file
hook1 = weechat.hook_url("https://weechat.org/",
{"file_out": "/tmp/weechat.org.html"},
20000, "my_url_cb", "")
# example 2: custom HTTP headers, output sent to callback
options = {
"httpheader": "\n".join([
"Header1: value1",
"Header2: value2",
]),
}
hook2 = weechat.hook_url("http://localhost:8080/", options, 20000, "my_url_cb", "")
----
==== hook_connect
_WeeChat バージョン 1.5 と 2.0 で更新。_
@@ -10741,7 +10887,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
==== hook_line
// TRANSLATION MISSING
_WeeChat ≥ 2.3, updated in 3.7, 4.1.0._
_WeeChat ≥ 2.3, updated in 3.7._
バッファに対する行表示をフックする。
@@ -10811,16 +10957,14 @@ struct t_hook *weechat_hook_line (const char *buffer_type,
|===
| キー | 値 (フォーマット済みバッファ) | 値 (自由内容バッファ) | 例
// TRANSLATION MISSING
| buffer
| Comma-separated list of buffer pointers.
| Comma-separated list of buffer pointers.
| バッファポインタ
| バッファポインタ
| `+0x1234abcd+`
// TRANSLATION MISSING
| buffer_name
| Comma-separated list of buffer names.
| Comma-separated list of buffer names.
| バッファ名
| バッファ名
| `+core.weechat+` +
`+irc.server.libera+` +
`+irc.libera.#weechat+`
@@ -10908,23 +11052,17 @@ WeeChat はそれらを無視します。
|===
| キー | 設定可能な値 (フォーマット済みバッファ) | 設定可能な値 (自由内容バッファ) | 結果
// TRANSLATION MISSING
| buffer
| Comma-separated list buffer pointers (with formatted content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Comma-separated list buffer pointers (with free content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| The line is displayed on these buffers. +
| フォーマット済みバッファへのポインタ
| 自由内容バッファへのポインタ
| 行を表示するバッファ。 +
この値が空の場合、行は削除されます (ハッシュテーブルに含まれるその他の情報も無視されます);
"line" 型の次のフックも呼び出されません。
// TRANSLATION MISSING
| buffer_name
| Comma-separated list buffer names (with formatted content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Comma-separated list buffer names (with free content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| The line is displayed on these buffers. +
| フォーマット済み内容バッファの名前.
| 自由内容バッファの名前
| 行を表示するバッファ。 +
`buffer` と `+buffer_name+` の両方が設定された場合、`+buffer_name+` の値が優先されます +
この値が空の場合、行は削除されます (ハッシュテーブルに含まれるその他の情報も無視されます);
"line" 型の次のフックも呼び出されません。
@@ -16738,7 +16876,6 @@ if (hashtable_in)
"irc_message_parse" の出力に関するより詳しい情報は
link:weechat_scripting.ja.html#irc_message_parse[WeeChat スクリプト作成ガイド / メッセージの構文解析 ^↗^^]を参照してください。
スクリプト (Python) での使用例:
[source,python]
@@ -18786,7 +18923,8 @@ for key in hash:
==== hdata_compare
_WeeChat バージョン 1.9 以上で利用可。_
// TRANSLATION MISSING
_WeeChat ≥ 1.9, updated in 4.1.0._
2 つのオブジェクトの hdata 変数を比較。
@@ -18802,8 +18940,9 @@ int weechat_hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2
* _hdata_: hdata へのポインタ
* _pointer1_: 1 番目の WeeChat およびプラグインオブジェクトへのポインタ
* _pointer2_: 2 番目の WeeChat およびプラグインオブジェクトへのポインタ
* _name_: 変数名; 配列の場合、変数名を "N|name" のように指定できます。ここで
N は配列のインデックス番号です (番号は 0 から始まります)。例: "2|name"
// TRANSLATION MISSING
* _name_: variable name or path to a variable name; 配列の場合、変数名を "N|name"
のように指定できます。ここで N は配列のインデックス番号です (番号は 0 から始まります)。例: "2|name"
* _case_sensitive_: 大文字小文字を区別する場合 1、それ以外の場合 0
戻り値:
@@ -18819,8 +18958,12 @@ C 言語での使用例:
struct t_hdata *hdata = weechat_hdata_get ("buffer");
struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat");
struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr");
weechat_printf (NULL, "number comparison = %d",
weechat_printf (NULL, "comparison of buffer number = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
weechat_printf (NULL, "comparison of number of lines = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0));
weechat_printf (NULL, "comparison of local variable = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0));
----
スクリプト (Python) での使用例:
@@ -18834,7 +18977,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens
hdata = weechat.hdata_get("buffer")
buffer1 = weechat.buffer_search("irc", "libera.#weechat")
buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr")
weechat.prnt("", "number comparison = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparison of buffer number = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparison of number of lines = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0))
weechat.prnt("", "comparison of local variable = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0))
----
==== hdata_set
+135 -82
View File
@@ -146,11 +146,6 @@ WeeChat:
| Logger plugin: compression of rotated log files (gzip). +
Relay plugin: compression of messages (WeeChat -> client) with https://zlib.net/[zlib ^↗^^] (weechat protocol). +
Script plugin: read of repository index file (gzip).
// TRANSLATION MISSING
| libzstd-dev | ≥ 0.8.1
| Logger plugin: compression of rotated log files. +
Relay plugin: compression of messages (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat protocol).
|===
[NOTE]
@@ -167,27 +162,70 @@ WeeChat:
[width="100%",cols="5,^3,.^15",options="header"]
|===
// TRANSLATION MISSING
| パッケージ ^(1)^ | バージョン | Features
| {cpp} コンパイラ (pass:[g++ / clang++]) | | ビルドとテストの実行、JavaScript プラグイン
| gettext | | 国際化 (メッセージの翻訳; ベース言語は英語です)
| ca-certificates | | TLS 接続に必要な証明書、relay プラグインで TLS サポート
| libaspell-dev / libenchant-dev | | spell プラグイン
| python3-dev | 3.0 以上 | python プラグイン
| libperl-dev | | perl プラグイン
| ruby3.1, ruby3.1-dev | 1.9.1 以上 | ruby プラグイン
| liblua5.4-dev | | lua プラグイン
| tcl-dev | 8.5 以上 | tcl プラグイン
| guile-3.0-dev | 2.0 以上 | guile (scheme) プラグイン
| libv8-dev | 3.24.3 以下 | javascript プラグイン
| php-dev | 7.0 以上 | PHP プラグイン
| libphp-embed | 7.0 以上 | PHP プラグイン
| libxml2-dev | | PHP プラグイン
| libargon2-dev | | PHP プラグイン (PHP 7.2 以上の場合)
| libsodium-dev | | PHP プラグイン (PHP 7.2 以上の場合)
| asciidoctor | 1.5.4 以上 | man ページと文書のビルド
| パッケージ ^(1)^ | バージョン | Features
| {cpp} コンパイラ (pass:[g++ / clang++]) |
| ビルドとテストの実行、JavaScript プラグイン
| gettext |
| 国際化 (メッセージの翻訳; ベース言語は英語です)
| ca-certificates |
| TLS 接続に必要な証明書、relay プラグインで TLS サポート
// TRANSLATION MISSING
| ruby-pygments.rb | | Build documentation.
| libcpputest-dev | 3.4 以上 | ビルドとテストの実行
| libzstd-dev | ≥ 0.8.1
| Logger plugin: compression of rotated log files (zstandard). +
Relay plugin: compression of messages (WeeChat -> client) with https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat protocol).
| libaspell-dev / libenchant-dev |
| spell プラグイン
| python3-dev | 3.0 以上
| python プラグイン
| libperl-dev |
| perl プラグイン
| ruby3.1, ruby3.1-dev | 1.9.1 以上
| ruby プラグイン
| liblua5.4-dev |
| lua プラグイン
| tcl-dev | 8.5 以上
| tcl プラグイン
| guile-3.0-dev | 2.0 以上
| guile (scheme) プラグイン
| libv8-dev | 3.24.3 以下
| javascript プラグイン
| php-dev | 7.0 以上
| PHP プラグイン
| libphp-embed | 7.0 以上
| PHP プラグイン
| libxml2-dev |
| PHP プラグイン
| libargon2-dev |
| PHP プラグイン (PHP 7.2 以上の場合)
| libsodium-dev |
| PHP プラグイン (PHP 7.2 以上の場合)
| asciidoctor | 1.5.4 以上
| man ページと文書のビルド
// TRANSLATION MISSING
| ruby-pygments.rb |
| Build documentation.
| libcpputest-dev | 3.4 以上
| ビルドとテストの実行
|===
[NOTE]
@@ -229,7 +267,8 @@ $ make install
CMake に対するオプションを指定するには、以下の書式を使ってください: `-DOPTION=VALUE`。
よく利用されるオプションのリスト:
// TRANSLATION MISSING
List of available options:
[width="100%",cols="3m,3,3m,10",options="header"]
|===
@@ -285,6 +324,10 @@ CMake に対するオプションを指定するには、以下の書式を使
| ENABLE_GUILE | `ON`, `OFF` | ON
| <<scripting_plugins,Guile プラグイン>> (Scheme) のコンパイル。
// TRANSLATION MISSING
| ENABLE_HEADLESS | `ON`, `OFF` | ON
| Compile headless binary.
| ENABLE_IRC | `ON`, `OFF` | ON
| <<irc,IRC プラグイン>>のコンパイル
@@ -343,6 +386,10 @@ CMake に対するオプションを指定するには、以下の書式を使
| ENABLE_XFER | `ON`, `OFF` | ON
| <<xfer,Xfer プラグイン>>のコンパイル。
// TRANSLATION MISSING
| ENABLE_ZSTD | `ON`, `OFF` | ON
| Enable https://facebook.github.io/zstd/[Zstandard ^↗^^] compression.
| ENABLE_TESTS | `ON`, `OFF` | OFF
| コンパイルテスト。
@@ -954,6 +1001,10 @@ By default, the screen is divided up into the following areas:
// TRANSLATION MISSING
| buflist3 | `1.weechat` | List of buffers, third bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| buflist4 | `1.weechat` | List of buffers, fourth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| buflist5 | `1.weechat` | List of buffers, fifth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| fset | `+buflist.look.sort: …+` | Help on currently selected option on fset buffer.
| irc_channel | `#test` | 現在の IRC チャンネル名
// TRANSLATION MISSING
@@ -1493,8 +1544,10 @@ External plugins and scripts can define and use other local variables.
[[buflist]]
=== List of buffers
// TRANSLATION MISSING
Buflist プラグインを使うことで、"buflist" と呼ばれるバー要素の中にバッファリストを表示させることが可能になります
(それ以外に "buflist2" "buflist3" と呼ばれるバー要素も利用可能です)。 +
(four other bar items "buflist2", "buflist3", "buflist4" and "buflist5" are
available as well)。 +
プラグインは開始時にバー要素 "buflist" を持つデフォルトバー "buflist" を作成します。
[[buflist_commands]]
@@ -1647,6 +1700,16 @@ They can be changed and new ones can be added with the <<command_weechat_key,/ke
| kbd:[Ctrl+↓] | グローバル履歴から次のコマンド/メッセージを呼び出す (すべてのバッファに対して共通の履歴) | `+/input history_global_next+`
|===
// TRANSLATION MISSING
[[key_bindings_cmdline_system]]
==== System
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| キー | 説明 | コマンド
| kbd:[Ctrl+z] | Suspend WeeChat process. | `+/sys suspend+`
|===
// TRANSLATION MISSING
[[key_bindings_buffers]]
=== Buffers
@@ -1875,10 +1938,10 @@ These mouse actions are possible only if mouse is enabled with key kbd:[Alt+m]
| kbd:[■ □ □] | - | chat: /list buffer | Select line in /list buffer. | `+/window ${_window_number};/list -go ${_chat_line_y}+`
// TRANSLATION MISSING
| kbd:[□ □ ■] | - | chat: /list buffer | Join IRC channel on selected line. | `+hsignal:irc_list_mouse+`
| kbd:[▲] | - | チャット: スクリプトバッファ | スクリプトバッファを 5 行上方向にスクロール | `+/script up 5+`
| kbd:[▼] | - | チャット: スクリプトバッファ | スクリプトバッファで 5 行下方向にスクロール | `+/script down 5+`
| kbd:[■ □ □] | - | チャット: スクリプトバッファ | スクリプトバッファで行選択 | `+/script go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | チャット: スクリプトバッファ | スクリプトのインストール `+/ 削除 | /script go ${_chat_line_y};/script installremove ${script_name_with_extension}+`
| kbd:[▲] | - | チャット: スクリプトバッファ | スクリプトバッファを 5 行上方向にスクロール | `+/script -up 5+`
| kbd:[▼] | - | チャット: スクリプトバッファ | スクリプトバッファで 5 行下方向にスクロール | `+/script -down 5+`
| kbd:[■ □ □] | - | チャット: スクリプトバッファ | スクリプトバッファで行選択 | `+/script -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | チャット: スクリプトバッファ | スクリプトのインストール `+/ 削除 | /script -go ${_chat_line_y};/script installremove ${script_name_with_extension}+`
| kbd:[■ □ □] | 上 / 左 | バッファリスト | 指定したバッファを下の番号に移動 | `+buflist_mouse+` シグナル
| kbd:[■ □ □] | 下 / 右 | バッファリスト | 指定したバッファを上の番号に移動 | `+buflist_mouse+` シグナル
| kbd:[■ □ □] | - | バッファリスト | 指定したバッファに切り替える (現在のバッファを指定した場合、バッファ切り替え履歴で前のバッファに切り替える) | `+buflist_mouse+` シグナル
@@ -1945,8 +2008,8 @@ These keys and actions are used on the fset buffer (see <<fset,Fset plugin>>).
| kbd:[Ctrl+l] (`L`) | | Refresh options and whole screen. | `+/fset -refresh+`
| | `$` | Refresh options (keep marked options). |
| | `$$` | Refresh options (unmark all options). |
| kbd:[Alt+p] | | Toggle plugin description options (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | | Toggle help bar. | `+/bar toggle fset+`
| kbd:[Alt+p] | `p` | Toggle plugin description options (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | `v` | Toggle help bar. | `+/bar toggle fset+`
| | `s:x,y` | Sort options by fields x,y (see option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /set fset.look.sort x,y+`
| | `s:` | Reset sort to its default value (see option <<option_fset.look.sort,fset.look.sort>>). | `+/mute /unset fset.look.sort+`
| | `w:xxx` | Export options in file "xxx". | `+/fset -export xxx+`
@@ -2005,17 +2068,22 @@ These keys and actions are used on the script buffer (see <<script_manager,scrip
[width="100%",cols="^.^3,^.^2,.^8,.^5",options="header"]
|===
| Key | Action ^(1)^ | Description | Command
| kbd:[↑] | | Move one line up. | `+/script up+`
| kbd:[↓] | | Move one line down. | `+/script down+`
| kbd:[↑] | | Move one line up. | `+/script -up+`
| kbd:[↓] | | Move one line down. | `+/script -down+`
| kbd:[PgUp] | | Move one page up. | `+/window page_up+`
| kbd:[PgDn] | | Move one page down. | `+/window page_down+`
| kbd:[Alt+i] | `i` | Install script. | `+/script install+`
| kbd:[Alt+r] | `r` | Remove script. | `+/script remove+`
| kbd:[Alt+l] (`L`) | `l` | Load script. | `+/script load+`
| kbd:[Alt+l] | `l` | Load script. | `+/script load+`
| kbd:[Alt+L] | `L` | Reload script. | `+/script reload+`
| kbd:[Alt+u] | `u` | Unload script. | `+/script unload+`
| kbd:[Alt+Shift+A] | `A` | Autoload script. | `+/script toggleautoload+`
| kbd:[Alt+h] | `h` | Hold/unhold script. | `+/script hold+`
| kbd:[Alt+v] | `v` | View script. | `+/script show+`
| | `s:x,y` | Sort scripts by fields x,y (see option <<option_script.look.sort,script.look.sort>>). |
| | `s:` | Reset sort to its default value (see option <<option_script.look.sort,script.look.sort>>). |
| | `$` | Refresh list. |
| | `q` | Close buffer. | `+/buffer close+`
|===
// TRANSLATION MISSING
@@ -2373,14 +2441,9 @@ irc サーバ "libera" に含まれる全てのバッファに対して設定す
例えば現在のバッファで "joe" と "mike" からのメッセージに対するハイライトを無効化するには以下のように設定します:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
[NOTE]
バッファプロパティ "hotlist_max_level_nicks" は設定ファイルに保存されません。 +
これを保存するには _buffer_autoset.py_ スクリプトを使ってください: このスクリプトをインストールするには
`+/script install buffer_autoset.py+` コマンドを使い、ヘルプを見るには `+/help buffer_autoset+` コマンドを使ってください。
[[highlights]]
=== ハイライト
@@ -2406,14 +2469,9 @@ This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
/buffer setauto highlight_disable_regex <flash.*>
----
[NOTE]
バッファプロパティ "highlight_disable_regex" は設定ファイルに保存されません。 +
これを保存するには _buffer_autoset.py_ スクリプトを使ってください: このスクリプトをインストールするには
`+/script install buffer_autoset.py+` コマンドを使い、ヘルプを見るには `+/help buffer_autoset+` コマンドを使ってください。
[[highlights_words]]
==== ハイライトする単語の追加
@@ -2468,14 +2526,9 @@ Same example, specific to the current buffer:
例えば現在のバッファ宛のすべてのメッセージをハイライトするには以下のように設定します:
----
/buffer set highlight_regex .*
/buffer setauto highlight_regex .*
----
[NOTE]
バッファプロパティ "highlight_regex" は設定ファイルに保存されません。 +
これを保存するには _buffer_autoset.py_ スクリプトを使ってください: このスクリプトをインストールするには
`+/script install buffer_autoset.py+` コマンドを使い、ヘルプを見るには `+/help buffer_autoset+` コマンドを使ってください。
// TRANSLATION MISSING
[[buffer_logging]]
=== Buffer logging
@@ -3365,32 +3418,34 @@ _weechat.conf_ ファイル内のセクション:
[width="100%",cols="3m,6m,16",options="header"]
|===
| セクション | 操作コマンド | 説明
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | core とプラグインのデバッグレベル (オプションをセクションに追加/削除出来ます)
| startup | /set weechat.startup.* | 起動オプション
| look | /set weechat.look.* | 外観
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | 色の別名 (オプションをセクションに追加/削除出来ます)
| color | /set weechat.color.* | 色
| completion | /set weechat.completion.* | 補完オプション
| history | /set weechat.history.* | 履歴オプション (コマンドとバッファ)
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | プロキシオプション
| network | /set weechat.network.* | ネットワーク/TLS オプション
| セクション | 操作コマンド | 説明
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | core とプラグインのデバッグレベル (オプションをセクションに追加/削除出来ます)
| startup | /set weechat.startup.* | 起動オプション
| look | /set weechat.look.* | 外観
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | 色の別名 (オプションをセクションに追加/削除出来ます)
| color | /set weechat.color.* | 色
| completion | /set weechat.completion.* | 補完オプション
| history | /set weechat.history.* | 履歴オプション (コマンドとバッファ)
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | プロキシオプション
| network | /set weechat.network.* | ネットワーク/TLS オプション
// TRANSLATION MISSING
| plugin | /set weechat.plugin.* | Options on plugins.
| plugin | /set weechat.plugin.* | Options on plugins.
// TRANSLATION MISSING
| signal | /set weechat.signal.* | Options on signals.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | バーオプション
| layout | <<command_weechat_layout,/layout>> | レイアウト
| notify | <<command_weechat_buffer,/buffer notify>> | バッファに対する通知レベル (オプションをセクションに追加/削除出来ます)
| filter | <<command_weechat_filter,/filter>> | フィルタ
| key | <<command_weechat_key,/key>> | デフォルトコンテキストのキー
| key_search | <<command_weechat_key,/key>> | 検索コンテキストのキー
| key_cursor | <<command_weechat_key,/key>> | カーソルコンテキストのキー
| key_mouse | <<command_weechat_key,/key>> | マウスコンテキストのキー
| signal | /set weechat.signal.* | Options on signals.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | バーオプション
| layout | <<command_weechat_layout,/layout>> | レイアウト
// TRANSLATION MISSING
| buffer | <<command_weechat_buffer,/buffer setauto>> | Properties auto-applied on buffers when they are opened.
| notify | <<command_weechat_buffer,/buffer notify>> | バッファに対する通知レベル (オプションをセクションに追加/削除出来ます)
| filter | <<command_weechat_filter,/filter>> | フィルタ
| key | <<command_weechat_key,/key>> | デフォルトコンテキストのキー
| key_search | <<command_weechat_key,/key>> | 検索コンテキストのキー
| key_cursor | <<command_weechat_key,/key>> | カーソルコンテキストのキー
| key_mouse | <<command_weechat_key,/key>> | マウスコンテキストのキー
|===
オプション:
@@ -4281,7 +4336,7 @@ the following extra variables are available:
|===
// TRANSLATION MISSING
| Variable | 説明 | 値/例
| `+${clientinfo}+` | サポートしている CTCP オプションのリスト | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| `+${clientinfo}+` | サポートしている CTCP オプションのリスト | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| `+${version}+` | WeeChat バージョン | `+4.1.0-dev+`
| `+${versiongit}+` | WeeChat バージョン + Git バージョン ^(1)^ | `+4.1.0-dev (git: v4.0.0-51-g8f98b922a)+`
| `+${git}+` | Git バージョン ^(1)^ | `+v4.0.0-51-g8f98b922a+`
@@ -4304,11 +4359,9 @@ The default CTCP replies are:
[width="100%",cols="2,4,8",options="header"]
|===
| CTCP | 応答書式 | 例
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| FINGER | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| SOURCE | `+${download}+` | `+https://weechat.org/download/+`
| TIME | `+${time}+` | `+Sat, 08 Jul 2023 21:11:19 +0200+`
| USERINFO | `+${username} (${realname})+` | `+name (John Doe)+`
| VERSION | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
|===
+46 -20
View File
@@ -582,6 +582,15 @@ Jeśli używasz aplikacji Terminal na macOS włącz opcję
"Use option as meta key" w menu Settings/Keyboard. Następnie możesz używać klawisza
kbd:[Option] jako klawisza meta.
// TRANSLATION MISSING
[[enter_key]]
=== Some keys including Enter are not working, why?
If you run a WeeChat < 4.0.0 with configuration files created by any
version ≥ 4.0.0, the keys names become invalid and many keys won't work at all. +
To repair them, exit WeeChat, remove all sections `[key*]` from weechat.conf
and start WeeChat again: all default keys will be created.
[[customize_key_bindings]]
=== Jak mogę zmienić przypisania klawiszy?
@@ -927,34 +936,22 @@ link:weechat_user.pl.html#max_hotlist_level_nicks[hotlist_max_level_nicks_add ^
do ustawienia maksymalnego poziomu hotlisty dla niektórych nicków, dla buforów
lub grup buforów (jak serwery IRC).
W celu wyłączenia tylko podświetleń wystarczy ustawić ja na 2:
W celu wyłączenia tylko podświetleń wystarczy ustawić ja na 2.
// TRANSLATION MISSING
For the current buffer:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
To utawienie nie jest zapisywane jednak w konfiguracji.
W celu automatycznego ustawiania tej właściwości należy użyć skryptu _buffer_autoset.py_:
// TRANSLATION MISSING
For all channels on server "libera":
----
/script install buffer_autoset.py
/set weechat.buffer.irc.libera.*.hotlist_max_level_nicks_add joe:2,mike:2
----
Na przykład w celu wyłączenia powiadomień od "mike" na #weechat w sieci libera:
on the IRC server libera:
----
/buffer_autoset add irc.libera.#weechat hotlist_max_level_nicks_add mike:2
----
Dla całego serwera libera:
----
/buffer_autoset add irc.libera hotlist_max_level_nicks_add mike:2
----
Więcej przykładów można znaleźć wykonując komende `+/help buffer_autoset+`.
[[irc_target_buffer]]
=== Jak mogę zmienić docelowy bufor dla komendy w połączonym buforze (jak bufor z serwerami)?
@@ -1157,6 +1154,35 @@ w _sec.conf_ za pomocą komendy `/secure`).
Przejrzyj link:weechat_user.pl.html#files_and_directories[Poradnik użytkownika / Pliki i foldery ^↗^^],
gdzie znajdziesz więcej informacji o plikach konfiguracyjnych.
// TRANSLATION MISSING
[[move_to_another_device]]
=== I want to move my WeeChat to another device and keep my config, what should I copy?
First check directories used by WeeChat with this command: `/debug dirs`. +
Directories home/config and home/data must be copied (all files and sub-directories).
For example if you're using XDG directories (default with WeeChat ≥ 3.2),
the directories should be `$HOME/.config/weechat` and `$HOME/.local/share/weechat`. +
If you're using a single directory (default with WeeChat < 3.2), the directory
should be `$HOME/.weechat`.
[IMPORTANT]
The WeeChat version on the new device must be greater than or equal to the version
on the initial device. +
Downgrading WeeChat configuration is *NOT SUPPORTED* and can break it,
leading to unusable WeeChat.
Steps:
. Quit Weechat: `/quit` (or `/upgrade -quit` if you want to resume the session,
which includes content of all buffers).
. Copy all directories, sub-directories and files to the new device, keeping
same names and permissions.
. Optional: copy any file outside these directories that you refer to in your
configuration (it's not recommended to use files outside WeeChat directories).
. Start WeeChat on the new device: `weechat` (or `weechat --upgrade` if you
saved the session).
[[development]]
== Rozwój
+139 -81
View File
@@ -134,10 +134,6 @@ WeeChat:
| Wtyczka logger: kompresja rotowanych plików z logami (gzip). +
Wtyczka relay: kompresja wiadomości (WeeChat -> klient) za pomocą https://zlib.net/[zlib ^↗^^] (protokół weechat). +
Wtyczka script: odczyt repozytorium ze skryptami (gzip).
| libzstd-dev | ≥ 0.8.1
| Wtyczka logger: kompresja rotowanych plików z logami. +
Wtyczka Relay: kompresja wiadomości (WeeChat -> klient) za pomocą https://facebook.github.io/zstd/[Zstandard ^↗^^] (protokół weechat).
|===
[NOTE]
@@ -151,26 +147,68 @@ WeeChat:
[width="100%",cols="5,^3,.^15",options="header"]
|===
| Pakiet ^(1)^ | Wersja | Funkcje
| kompilator {cpp} (pass:[g++ / clang++]) | | Kompilacja i uruchamianie testów, wtyczka JavaScript.
| gettext | | Internacjonalizacja (tłumaczenie wiadomości; język bazowy to Angielski).
| ca-certificates | | Certyfikaty dla połączeń TLS.
| libaspell-dev / libenchant-dev | | Wtyczka spell.
| python3-dev | ≥ 3.0 | Wtyczka python.
| libperl-dev | | Wtyczka perl.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1 | Wtyczka ruby.
| liblua5.4-dev | | Wtyczka lua.
| tcl-dev | ≥ 8.5 | Wtyczka tcl.
| guile-3.0-dev | ≥ 2.0 | Wtyczka guile (scheme).
| libv8-dev | ≤ 3.24.3 | Wtyczka javascript.
| php-dev | ≥ 7.0 | Wtyczka PHP.
| libphp-embed | ≥ 7.0 | Wtyczka PHP.
| libxml2-dev | | Wtyczka PHP.
| libargon2-dev | | Wtyczka PHP (jeśli PHP ≥ 7.2).
| libsodium-dev | | Wtyczka PHP (jeśli PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4 | Tworzenie strony man i dokumentacji.
| ruby-pygments.rb | | Dokumentacja budowania.
| libcpputest-dev | ≥ 3.4 | Kompilacja i uruchamianie testów.
| Pakiet ^(1)^ | Wersja | Funkcje
| kompilator {cpp} (pass:[g++ / clang++]) |
| Kompilacja i uruchamianie testów, wtyczka JavaScript.
| gettext |
| Internacjonalizacja (tłumaczenie wiadomości; język bazowy to Angielski).
| ca-certificates |
| Certyfikaty dla połączeń TLS.
| libzstd-dev | ≥ 0.8.1
| Wtyczka logger: kompresja rotowanych plików z logami (zstandard). +
Wtyczka Relay: kompresja wiadomości (WeeChat -> klient) za pomocą https://facebook.github.io/zstd/[Zstandard ^↗^^] (protokół weechat).
| libaspell-dev / libenchant-dev |
| Wtyczka spell.
| python3-dev | ≥ 3.0
| Wtyczka python.
| libperl-dev |
| Wtyczka perl.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1
| Wtyczka ruby.
| liblua5.4-dev |
| Wtyczka lua.
| tcl-dev | ≥ 8.5
| Wtyczka tcl.
| guile-3.0-dev | ≥ 2.0
| Wtyczka guile (scheme).
| libv8-dev | ≤ 3.24.3
| Wtyczka javascript.
| php-dev | ≥ 7.0
| Wtyczka PHP.
| libphp-embed | ≥ 7.0
| Wtyczka PHP.
| libxml2-dev |
| Wtyczka PHP.
| libargon2-dev |
| Wtyczka PHP (jeśli PHP ≥ 7.2).
| libsodium-dev |
| Wtyczka PHP (jeśli PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4
| Tworzenie strony man i dokumentacji.
| ruby-pygments.rb |
| Dokumentacja budowania.
| libcpputest-dev | ≥ 3.4
| Kompilacja i uruchamianie testów.
|===
[NOTE]
@@ -210,7 +248,8 @@ $ make install
Opcje mogą zostać przekazane do CMake, format `-DOPCJA=WARTOŚĆ`.
Lista popularnych opcji:
// TRANSLATION MISSING
List of available options:
[width="100%",cols="3m,3,3m,10",options="header"]
|===
@@ -264,6 +303,10 @@ Lista popularnych opcji:
| ENABLE_GUILE | `ON`, `OFF` | ON
| Kompilacja <<scripting_plugins,wtyczki guile>> (Scheme).
// TRANSLATION MISSING
| ENABLE_HEADLESS | `ON`, `OFF` | ON
| Compile headless binary.
| ENABLE_IRC | `ON`, `OFF` | ON
| Kompilacja <<irc,wtyczki IRC>>.
@@ -322,6 +365,10 @@ Lista popularnych opcji:
| ENABLE_XFER | `ON`, `OFF` | ON
| Kompilacja <<xfer,wtyczki xfer>>.
// TRANSLATION MISSING
| ENABLE_ZSTD | `ON`, `OFF` | ON
| Enable https://facebook.github.io/zstd/[Zstandard ^↗^^] compression.
| ENABLE_TESTS | `ON`, `OFF` | OFF
| Kompiluje testy.
@@ -899,6 +946,10 @@ Inne dostępne elementy (nie używane domyślnie w paskach):
| buffer_short_name | `#test` | Skrócona nazwa obecnego buforu.
| buflist2 | `1.weechat` | Lista buforów, drugi element paska (zobacz opcję <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist3 | `1.weechat` | Lista buforów, trzeci element paska (zobac opcję <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| buflist4 | `1.weechat` | List of buffers, fourth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| buflist5 | `1.weechat` | List of buffers, fifth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
| fset | `+buflist.look.sort: …+` | Pomoc dla obecnie wybranej opcji w buforze fset.
| irc_channel | `#test` | Nazwa bieżącego kanału IRC.
| irc_host | `+user@host.com+` | Aktualny host IRC.
@@ -1421,8 +1472,10 @@ External plugins and scripts can define and use other local variables.
[[buflist]]
=== Lista buforów
// TRANSLATION MISSING
Wtyczka buflist wyświetla listę buforów w elemencie paska nazwanym "buflist"
(dostępne są również dwa dodatkowe elementy "buflist2" oraz "buflist3"). +
(four other bar items "buflist2", "buflist3", "buflist4" and "buflist5" are
available as well). +
Domyślny pasek "buflist" jest tworzony podczas uruchomieina z włączoną wtyczką.
[[buflist_commands]]
@@ -1555,6 +1608,16 @@ Można je zmienić oraz dodać nowe za pomocą komendy <<command_weechat_key,/ke
| kbd:[Ctrl+↓] | Pokaż następną komendę/wiadomość w historii globalnej (wspólnej dla wszystkich buforów). | `+/input history_global_next+`
|===
// TRANSLATION MISSING
[[key_bindings_cmdline_system]]
==== System
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Skrót | Opis | Komenda
| kbd:[Ctrl+z] | Suspend WeeChat process. | `+/sys suspend+`
|===
[[key_bindings_buffers]]
=== Bufory
@@ -1760,10 +1823,10 @@ za pomocą skrótu kbd:[Alt+m] (komenda: `+/mouse toggle+`).
| kbd:[■ □ □] | - | chat: /list buffer | Select line in /list buffer. | `+/window ${_window_number};/list -go ${_chat_line_y}+`
// TRANSLATION MISSING
| kbd:[□ □ ■] | - | chat: /list buffer | Join IRC channel on selected line. | `+hsignal:irc_list_mouse+`
| kbd:[▲] | - | chat: bufor skryptów | Przejdź 5 linii w górę w buforze skryptów. | `+/script up 5+`
| kbd:[▼] | - | chat: bufor skryptów | Przejdź 5 linii w dół w buforze skryptów. | `+/script down 5+`
| kbd:[■ □ □] | - | chat: bufor skryptów | Zaznacz linię w buforze skryptów. | `+/script go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat: bufor skryptów | Zainstaluj/usuń skrypt. | `+/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[▲] | - | chat: bufor skryptów | Przejdź 5 linii w górę w buforze skryptów. | `+/script -up 5+`
| kbd:[▼] | - | chat: bufor skryptów | Przejdź 5 linii w dół w buforze skryptów. | `+/script -down 5+`
| kbd:[■ □ □] | - | chat: bufor skryptów | Zaznacz linię w buforze skryptów. | `+/script -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | chat: bufor skryptów | Zainstaluj/usuń skrypt. | `+/script -go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[■ □ □] | góra / lewo | buflist | Przenieś bufor na niższy numer. | Sygnał `+buflist_mouse+`.
| kbd:[■ □ □] | dół / prawo | buflist | Przenieś bufor na wyższy numer. | Sygnał `+buflist_mouse+`.
| kbd:[■ □ □] | - | buflist | Przełącz na bufor (poprzednio odwiedzony bufor, jeśli jest to obecny bufor). | Sygnał `+buflist_mouse+`.
@@ -1829,8 +1892,8 @@ Poniższe skróty i akcje mogą zostać użyte w buforze fset (zobacz <<fset,wty
| kbd:[Ctrl+l] (`L`) | | Odświerz opcje i cały ekran. | `+/fset -refresh+`
| | `$` | Odświerz opcje (zachowuje zaznaczone opcje). |
| | `$$` | Odświerz opcje (odznacza zaznaczone kompilację). |
| kbd:[Alt+p] | | Przełącz opcje opisu wtyczki (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | | Przełącz pasek pomocy. | `+/bar toggle fset+`
| kbd:[Alt+p] | `p` | Przełącz opcje opisu wtyczki (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | `v` | Przełącz pasek pomocy. | `+/bar toggle fset+`
| | `s:x,y` | Sortuj opcje po polach x,y (zobacz opcję <<option_fset.look.sort,fset.look.sort>>). | `+/mute /set fset.look.sort x,y+`
| | `s:` | Zresetuj soerowanie do domyślnej wartości (zobacz opcję <<option_fset.look.sort,fset.look.sort>>). | `+/mute /unset fset.look.sort+`
| | `w:xxx` | Wyeksportuj opcje do pliku "xxx". | `+/fset -export xxx+`
@@ -1885,17 +1948,27 @@ Te skróty klawiszowe i akcje mogą zostać użyte w buforze skryptów (zobacz <
[width="100%",cols="^.^3,^.^2,.^8,.^5",options="header"]
|===
| Skrót | Akcja ^(1)^ | Opis | Komenda
| kbd:[↑] | | Przejdź linię wyżej. | `+/script up+`
| kbd:[↓] | | Przejdź linię niżej. | `+/script down+`
| kbd:[↑] | | Przejdź linię wyżej. | `+/script -up+`
| kbd:[↓] | | Przejdź linię niżej. | `+/script -down+`
| kbd:[PgUp] | | Przewiń stronę do góry. | `+/window page_up+`
| kbd:[PgDn] | | Przewiń stronę w dół. | `+/window page_down+`
| kbd:[Alt+i] | `i` | Zainstaluj skrypt. | `+/script install+`
| kbd:[Alt+r] | `r` | Usuń skrypt. | `+/script remove+`
| kbd:[Alt+l] (`L`) | `l` | Załaduj skrypt. | `+/script load+`
| kbd:[Alt+l] | `l` | Załaduj skrypt. | `+/script load+`
// TRANSLATION MISSING
| kbd:[Alt+L] | `L` | Reload script. | `+/script reload+`
| kbd:[Alt+u] | `u` | Wyładuj skrypt. | `+/script unload+`
| kbd:[Alt+Shift+A] | `A` | Automatycznie ładuj skrypt. | `+/script toggleautoload+`
| kbd:[Alt+h] | `h` | Zablokuj/odblokuj skrypt. | `+/script hold+`
| kbd:[Alt+v] | `v` | Pokarz skrypt. | `+/script show+`
// TRANSLATION MISSING
| | `s:x,y` | Sort scripts by fields x,y (see option <<option_script.look.sort,script.look.sort>>). |
// TRANSLATION MISSING
| | `s:` | Reset sort to its default value (see option <<option_script.look.sort,script.look.sort>>). |
// TRANSLATION MISSING
| | `$` | Refresh list. |
// TRANSLATION MISSING
| | `q` | Close buffer. | `+/buffer close+`
|===
[NOTE]
@@ -2253,14 +2326,9 @@ z ustawonym dla każdego z nich maksymalnym poziomem hotlisty, możliwe poziomy
Na przykład, żeby wyłączyć podświetlenia od "joe" oraz "mike" w obecnym buforze:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
[NOTE]
Właściwość bufora "hotlist_max_level_nicks" nie jest zapisywana w konfiguracji. +
Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalować za pomocą
`+/script install buffer_autoset.py+`, informacje o używaniu `+/help buffer_autoset+`.
[[highlights]]
=== Podświetlenia
@@ -2285,14 +2353,9 @@ Można to także osiągnąć za pomocą właściwości bufora "highlight_disable
Ten sam przykład, tylko dla konkretnego bufora:
----
/buffer set highlight_disable_regex <flash.*>
/buffer setauto highlight_disable_regex <flash.*>
----
[NOTE]
Właściwość bufora "highlight_disable_regex" nie jest zapisywana w konfiguracji. +
Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalować za pomocą
`+/script install buffer_autoset.py+`, informacje o używaniu `+/help buffer_autoset+`.
[[highlights_words]]
==== Dodawanie słów do podświetleń
@@ -2346,14 +2409,9 @@ Możesz wymusić podświetlenia używając wyrażenia regularnego z właściwoś
Na przykład żeby wymusić podświetlenie dla wszytkich wiadomości w obecnym buforze:
----
/buffer set highlight_regex .*
/buffer setauto highlight_regex .*
----
[NOTE]
Właściwość bufora "highlight_regex" nie jest zapisywana w konfiguracji. +
Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalować za pomocą
`+/script install buffer_autoset.py+`, informacje o używaniu `+/help buffer_autoset+`.
[[buffer_logging]]
=== Bufor logera
@@ -3241,30 +3299,32 @@ Sekcje w pliku _weechat.conf_:
[width="100%",cols="3m,6m,16",options="header"]
|===
| Sekcja | Komenda | Opis
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Poziom debugowania dla rdzenia i wtyczek (opcje mogą być dodawane/usuwane w sekcji).
| startup | /set weechat.startup.* | Opcje dla startu aplikacji.
| look | /set weechat.look.* | Wygląd.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Aliasy kolorów (opcje mogą być dodawane/usuwane w sekcji).
| color | /set weechat.color.* | Kolory.
| completion | /set weechat.completion.* | Opcje dopełnień.
| history | /set weechat.history.* | Opcje historii (komend i buforów).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Opcje proxy.
| network | /set weechat.network.* | Opcje sieci/TLS.
| plugin | /set weechat.plugin.* | Opcje wtyczek.
| signal | /set weechat.signal.* | Opcje sygnałów.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Opcje pasków.
| layout | <<command_weechat_layout,/layout>> | Układy.
| notify | <<command_weechat_buffer,/buffer notify>> | Poziomy powiadomień dla buforów (opcje mogą być dodawane/usuwane w sekcji).
| filter | <<command_weechat_filter,/filter>> | Filtry.
| key | <<command_weechat_key,/key>> | Skróty klawiszowe dla domyślnego kontekstu.
| key_search | <<command_weechat_key,/key>> | Skróty klawiszowe dla kontekstu wyszukiwania.
| key_cursor | <<command_weechat_key,/key>> | Skróty klawiszowe dla kontekstu kursora.
| key_mouse | <<command_weechat_key,/key>> | Skróty klawiszowe dla kontekstu myszy.
| Sekcja | Komenda | Opis
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Poziom debugowania dla rdzenia i wtyczek (opcje mogą być dodawane/usuwane w sekcji).
| startup | /set weechat.startup.* | Opcje dla startu aplikacji.
| look | /set weechat.look.* | Wygląd.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Aliasy kolorów (opcje mogą być dodawane/usuwane w sekcji).
| color | /set weechat.color.* | Kolory.
| completion | /set weechat.completion.* | Opcje dopełnień.
| history | /set weechat.history.* | Opcje historii (komend i buforów).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Opcje proxy.
| network | /set weechat.network.* | Opcje sieci/TLS.
| plugin | /set weechat.plugin.* | Opcje wtyczek.
| signal | /set weechat.signal.* | Opcje sygnałów.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Opcje pasków.
| layout | <<command_weechat_layout,/layout>> | Układy.
// TRANSLATION MISSING
| buffer | <<command_weechat_buffer,/buffer setauto>> | Properties auto-applied on buffers when they are opened.
| notify | <<command_weechat_buffer,/buffer notify>> | Poziomy powiadomień dla buforów (opcje mogą być dodawane/usuwane w sekcji).
| filter | <<command_weechat_filter,/filter>> | Filtry.
| key | <<command_weechat_key,/key>> | Skróty klawiszowe dla domyślnego kontekstu.
| key_search | <<command_weechat_key,/key>> | Skróty klawiszowe dla kontekstu wyszukiwania.
| key_cursor | <<command_weechat_key,/key>> | Skróty klawiszowe dla kontekstu kursora.
| key_mouse | <<command_weechat_key,/key>> | Skróty klawiszowe dla kontekstu myszy.
|===
Opcje:
@@ -4144,7 +4204,7 @@ the following extra variables are available:
|===
// TRANSLATION MISSING
| Variable | Opis | Wartość/Przykład
| `+${clientinfo}+` | Lista wspieranych CTCP | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| `+${clientinfo}+` | Lista wspieranych CTCP | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| `+${version}+` | Wersja WeeChat | `+4.1.0-dev+`
| `+${versiongit}+` | Wersja WeeChat + wersja Git ^(1)^ | `+4.1.0-dev (git: v4.0.0-51-g8f98b922a)+`
| `+${git}+` | Wersja git ^(1)^ | `+v4.0.0-51-g8f98b922a+`
@@ -4167,11 +4227,9 @@ The default CTCP replies are:
[width="100%",cols="2,4,8",options="header"]
|===
| CTCP | Format odpowiedzi | Przykład
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| FINGER | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| SOURCE | `+${download}+` | `+https://weechat.org/download/+`
| TIME | `+${time}+` | `+Sat, 08 Jul 2023 21:11:19 +0200+`
| USERINFO | `+${username} (${realname})+` | `+name (John Doe)+`
| VERSION | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
|===
+1 -1
View File
@@ -37,7 +37,7 @@ STUB_HEADER = """\
# DO NOT EDIT BY HAND!
#
from typing import Dict
from typing import Dict, Union
"""
CONSTANT_RE = (
+6 -1
View File
@@ -142,10 +142,11 @@ WeeChat „језгро” се налази у следећим директо
|    wee-secure-buffer.c | Бафер обезбеђених података.
|    wee-secure-config.c | Опције обезбеђених података (фајл sec.conf).
|    wee-string.c | Функције над стринговима.
|    wee-sys.c | Системске функције.
|    wee-upgrade-file.c | Интерни систем ажурирања.
|    wee-upgrade.c | Ажурирање за WeeChat језгро (бафери, линије, историја, ...).
|    wee-url.c | URL трансфер (помоћу libcurl).
|    wee-utf8.c | UTF-8 фунцкије.
|    wee-utf8.c | UTF-8 функције.
|    wee-util.c | Неке друге функције.
|    wee-version.c | Функције за WeeChat верзију.
|    weechat.c | Основне функције: опције командне линије, покретање.
@@ -168,6 +169,7 @@ WeeChat „језгро” се налази у следећим директо
|       wee-hook-process.c | Кука "process".
|       wee-hook-signal.c | Кука "signal".
|       wee-hook-timer.c | Кука "timer".
|       wee-hook-url.c | Кука "url".
| gui/ | Функције за бафере, прозоре, ... (користе их сви интерфејси).
|    gui-bar-item.c | Ставке трака.
|    gui-bar-window.c | Прозори трака.
@@ -238,6 +240,8 @@ WeeChat „језгро” се налази у следећим директо
|       buflist.c | Главне buflist функције.
|       buflist-bar-item.c | Buflist ставке траке.
|       buflist-command.c | Buflist команде.
// TRANSLATION MISSING
|       buflist-completion.c | Buflist completions.
|       buflist-config.c | Buflist опције кофиг (фајл buflist.conf).
|       buflist-info.c | Buflist info/infolists/hdata.
|       buflist-mouse.c | Buflist акције мишем.
@@ -422,6 +426,7 @@ WeeChat „језгро” се налази у следећим директо
|          test-core-url.cpp | Тестови: URL адресе.
|          test-core-utf8.cpp | Тестови: UTF-8.
|          test-core-util.cpp | Тестови: помоћне функције.
|          test-core-sys.cpp | Тестови: системске функције.
|       gui/ | Корен unit тестова интерфејса.
|          test-gui-bar-window.cpp | Тестови: функције прозора траке.
|          test-gui-buffer.cpp | Тестови: бафер функције.
+48 -25
View File
@@ -517,6 +517,15 @@ UXTerm*metaSendsEscape: true
Ако користите macOS Terminal апликацију, укључите опцију „Use option as meta key” у менију Settings/Keyboard након чега можете користити тастер kbd:[Option] као meta тастер.
// TRANSLATION MISSING
[[enter_key]]
=== Some keys including Enter are not working, why?
If you run a WeeChat < 4.0.0 with configuration files created by any
version ≥ 4.0.0, the keys names become invalid and many keys won't work at all. +
To repair them, exit WeeChat, remove all sections `[key*]` from weechat.conf
and start WeeChat again: all default keys will be created.
[[customize_key_bindings]]
=== Како могу да прилагодим тастерске пречице?
@@ -821,32 +830,20 @@ link:weechat_user.sr.html#max_hotlist_level_nicks[hotlist_max_level_nicks_add ^
можете користити да за неке надимке подесите максимални ниво вруће листе, по баферу, или по
групи бафера (као на пример IRC сервери).
Ако само желите да искључите истицања, треба да је поставите на 2:
Ако само желите да искључите истицања, треба да је поставите на 2.
За текући бафер:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add пера:2,мика:2
----
Међутим, ова особина бафера се не чува у конфигурацији. Ако желите да се ове особине бафера аутоматски поново примене, биће вам потребна скрипта _buffer_autoset.py_:
За све канале на серверу „libera”:
----
/script install buffer_autoset.py
/set weechat.buffer.irc.libera.*.hotlist_max_level_nicks_add пера:2,мика:2
----
На пример, ако за стално желите да искључите истицања од надимка „mike” са #weechat на IRC серверу libera:
----
/buffer_autoset add irc.libera.#weechat hotlist_max_level_nicks_add mike:2
----
Ако уместо овога желите да се примени на комплетан libera сервер:
----
/buffer_autoset add irc.libera hotlist_max_level_nicks_add mike:2
----
За још примера, погледајте `+/help buffer_autoset+`.
[[irc_target_buffer]]
=== Како могу да променим циљни бафер за команде над спојеним баферима (као што је бафер са серверима)?
@@ -963,10 +960,8 @@ export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
Можете да следите исте савете као за <<memory_usage,меморију>>, као и следеће:
// TRANSLATION MISSING
* Сакријте „nicklist” траку: `/bar hide nicklist` (key: kbd:[Alt+Shift+N]).
// TRANSLATION MISSING
* Disable "buflist": `/buflist disable` (key: kbd:[Alt+Shift+B]).
* Сакријте „nicklist” траку: `/bar hide nicklist` (тастер: kbd:[Alt+Shift+N]).
* Искључите „buflist”: `/buflist disable` (тастер: kbd:[Alt+Shift+B]).
* Уклоните приказ секунди из времена у статусној траци: `+/set weechat.look.item_time_format "%H:%M"+` (ово је и подразумевана вредност).
* Искључите проверу неисправно написаних речи у командној линији у реалном времену (ако сте је укључили): `+/set spell.check.real_time off+`.
* Поставите променљиву _TZ_ (на пример: `export TZ="Europe/Paris"`), тиме спречавате чест приступ фајлу _/etc/localtime_.
@@ -991,9 +986,8 @@ export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
/set irc.ctcp.ping ""
----
// TRANSLATION MISSING
With WeeChat < 4.1.0, other CTCP queries were replied by default and must be
disabled as well:
Са WeeChat < 4.1.0, на остале CTCP упите се подразумевано одговарало и такође морају
да се искључе:
----
/set irc.ctcp.finger ""
@@ -1028,6 +1022,35 @@ disabled as well:
Погледајте link:weechat_user.sr.html#files_and_directories[Корисничко упутство / Фајлови и директоријуми ^↗^^] за више информација о конфигурационим фајловима.
// TRANSLATION MISSING
[[move_to_another_device]]
=== I want to move my WeeChat to another device and keep my config, what should I copy?
First check directories used by WeeChat with this command: `/debug dirs`. +
Directories home/config and home/data must be copied (all files and sub-directories).
For example if you're using XDG directories (default with WeeChat ≥ 3.2),
the directories should be `$HOME/.config/weechat` and `$HOME/.local/share/weechat`. +
If you're using a single directory (default with WeeChat < 3.2), the directory
should be `$HOME/.weechat`.
[IMPORTANT]
The WeeChat version on the new device must be greater than or equal to the version
on the initial device. +
Downgrading WeeChat configuration is *NOT SUPPORTED* and can break it,
leading to unusable WeeChat.
Steps:
. Quit Weechat: `/quit` (or `/upgrade -quit` if you want to resume the session,
which includes content of all buffers).
. Copy all directories, sub-directories and files to the new device, keeping
same names and permissions.
. Optional: copy any file outside these directories that you refer to in your
configuration (it's not recommended to use files outside WeeChat directories).
. Start WeeChat on the new device: `weechat` (or `weechat --upgrade` if you
saved the session).
[[development]]
== Развој
+207 -60
View File
@@ -3901,18 +3901,28 @@ int weechat_crypto_hash (const void *data, int data_size, const char *hash_algo,
[width="100%", cols="2,2,3,6", options="header"]
|===
| Вредност | Алгоритам | Величина хеша | Напомене
| `+crc32+` | CRC32 | 4 бајта (32 бита) | Није хеш алгоритам у криптографском смислу.
| `+md5+` | MD5 | 16 бајтова (128 бита) | *Слаб*, не препоручује се за криптографску употребу.
| `+sha1+` | SHA-1 | 20 бајтова (160 бита) | *Слаб*, не препоручује се за криптографску употребу.
| `+sha224+` | SHA-224 | 28 бајтова (224 бита) |
| `+sha256+` | SHA-256 | 32 бајта (256 бита) |
| `+sha384+` | SHA-384 | 48 бајтова (384 бита) |
| `+sha512+` | SHA-512 | 64 бајта (512 бита) |
| `+sha3-224+` | SHA3-224 | 28 бајтова (224 бита) | Алгоритам је доступан у libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 бајта (256 бита) | Алгоритам је доступан у libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 бајтова (384 бита) | Алгоритам је доступан у libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 бајта (512 бита) | Алгоритам је доступан у libgcrypt ≥ 1.7.0.
| Вредност | Алгоритам | Величина хеша | Напомене
| `+crc32+` | CRC32 | 4 бајта (32 бита) | Није хеш алгоритам у криптографском смислу.
| `+md5+` | MD5 | 16 бајтова (128 бита) | *Слаб*, не препоручује се за криптографску употребу.
| `+sha1+` | SHA-1 | 20 бајтова (160 бита) | *Слаб*, не препоручује се за криптографску употребу.
| `+sha224+` | SHA-224 | 28 бајтова (224 бита) |
| `+sha256+` | SHA-256 | 32 бајта (256 бита) |
| `+sha384+` | SHA-384 | 48 бајтова (384 бита) |
| `+sha512+` | SHA-512 | 64 бајта (512 бита) |
| `+sha512-224+` | SHA-512/224 | 28 бајтова (224 бита) | Алгоритам је доступан у libgcrypt ≥ 1.9.4.
| `+sha512-256+` | SHA-512/256 | 32 бајта (256 бита) | Алгоритам је доступан у libgcrypt ≥ 1.9.4.
| `+sha3-224+` | SHA3-224 | 28 бајтова (224 бита) | Алгоритам је доступан у libgcrypt ≥ 1.7.0.
| `+sha3-256+` | SHA3-256 | 32 бајта (256 бита) | Алгоритам је доступан у libgcrypt ≥ 1.7.0.
| `+sha3-384+` | SHA3-384 | 48 бајтова (384 бита) | Алгоритам је доступан у libgcrypt ≥ 1.7.0.
| `+sha3-512+` | SHA3-512 | 64 бајта (512 бита) | Алгоритам је доступан у libgcrypt ≥ 1.7.0.
| `+blake2b-160+` | BLAKE2B-160 | 20 бајтова (160 бита) | Алгоритам је доступан у libgcrypt ≥ 1.8.0.
| `+blake2b-256+` | BLAKE2B-256 | 32 бајта (256 бита) | Алгоритам је доступан у libgcrypt ≥ 1.8.0.
| `+blake2b-384+` | BLAKE2B-384 | 48 бајтова (384 бита) | Алгоритам је доступан у libgcrypt ≥ 1.8.0.
| `+blake2b-512+` | BLAKE2B-512 | 64 бајта (512 бита) | Алгоритам је доступан у libgcrypt ≥ 1.8.0.
| `+blake2s-128+` | BLAKE2S-128 | 16 бајтова (128 бита) | Алгоритам је доступан у libgcrypt ≥ 1.8.0.
| `+blake2s-160+` | BLAKE2S-160 | 20 бајтова (160 бита) | Алгоритам је доступан у libgcrypt ≥ 1.8.0.
| `+blake2s-224+` | BLAKE2S-224 | 28 бајтова (224 бита) | Алгоритам је доступан у libgcrypt ≥ 1.8.0.
| `+blake2s-256+` | BLAKE2S-256 | 32 бајта (256 бита) ) | Алгоритам је доступан у libgcrypt ≥ 1.8.0.
|===
Повратна вредност:
@@ -4316,11 +4326,6 @@ if (weechat_file_copy ("/tmp/test.txt", "/path/to/test2.txt"))
[NOTE]
Ова функција није доступна у API скриптовања.
[[util]]
=== Алати
Неке корисне функције.
==== file_compress
_WeeChat ≥ 3.7._
@@ -4341,7 +4346,9 @@ int weechat_file_compress (const char *from, const char *to,
* _to_: одредишни фајл
* _compressor_: компресор који треба да се користи, једно од:
** _gzip_: gzip компресија
** _zstd_: zstandard компресија
// TRANSLATION MISSING
** _zstd_: zstandard компресија (available only if zstd was enabled when
WeeChat was compiled)
* _compression_level_: ниво компресије, између 1 (брзо, ниска компресија) и
100 (споро, најбоља компресија)
@@ -4362,6 +4369,11 @@ if (weechat_file_compress ("/tmp/test.txt", "/tmp/test.txt.zst", "zstd", 50))
[NOTE]
Ова функција није доступна у API скриптовања.
[[util]]
=== Алати
Неке корисне функције.
==== util_timeval_cmp
Пореди две „timeval” структуре.
@@ -6509,9 +6521,10 @@ my_section_read_cb (const void *pointer, void *data,
{
/* ... */
return WEECHAT_CONFIG_READ_OK;
/* return WEECHAT_CONFIG_READ_MEMORY_ERROR; */
/* return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; */
return WEECHAT_CONFIG_OPTION_SET_OK_CHANGED;
/* return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; */
/* return WEECHAT_CONFIG_OPTION_SET_ERROR; */
/* return WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND; */
}
int
@@ -6601,7 +6614,7 @@ def config_new_section(config_file: str, name: str,
callback_delete_option: str, callback_delete_option_data: str) -> str: ...
# пример
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -6620,7 +6633,7 @@ def my_section_write_default_cb(data: str, config_file: str, section_name: str)
# return weechat.WEECHAT_CONFIG_WRITE_ERROR
# return weechat.WEECHAT_CONFIG_WRITE_MEMORY_ERROR
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int:
def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: Union[str, None]) -> int:
# ...
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED
# return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
@@ -6846,7 +6859,7 @@ struct t_config_option *option_enum =
# прототип
def config_new_option(config_file: str, section: str, name: str, type: str, description: str,
string_values: str, min: int, max: int,
default_value: str | None, value: str | None, null_value_allowed: int,
default_value: Union[str, None], value: Union[str, None], null_value_allowed: int,
callback_check_value: str, callback_check_value_data: str,
callback_change: str, callback_change_data: str,
callback_delete: str, callback_delete_data: str) -> str: ...
@@ -9714,7 +9727,6 @@ struct t_hook *weechat_hook_process (const char *command,
void *callback_data);
----
Аргументи:
* _command_: команда која се покреће у дете процесу, URL _(WeeChat ≥ 0.3.7)_ или функција _(WeeChat ≥ 1.5)_ (погледајте испод)
@@ -9945,18 +9957,8 @@ struct t_hook *weechat_hook_process_hashtable (const char *command,
_/dev/null_.
|===
За команду „url:...” су доступне следеће опције (за опис сваке опције погледајте `+man curl_easy_setopt+`):
include::{autogendir}/autogen_api_url_options.sr.adoc[tag=url_options]
[NOTE]
^(1)^ За опције типа „mask”, формат је: „вредност1+вредност2+вредност3”; за опције типа „list”, ставке листе морају да се раздвоје преломом линије (`\n`). +
^(2)^ Ако су доступне константе, оне морају да се користе као вредност опције.
За URL су дозвољене две додатне опције (стрингови) за улазни/излазни фајл:
* _file_in_: фајл који се чита и шаље URL адресама (post фајл)
* _file_out_: преузети URL/фајл се уписује у овај фајл (уместо на стандардни излаз)
// TRANSLATION MISSING
For command "url:...", see available options in function <<_hook_url,hook_url>>.
Повратна вредност:
@@ -10116,6 +10118,152 @@ hook4 = weechat.hook_process_hashtable("sh",
20000, "my_process_cb", "")
----
// TRANSLATION MISSING
==== hook_url
_WeeChat ≥ 4.1.0._
URL transfer.
Прототип:
[source,c]
----
struct t_hook *weechat_hook_url (const char *url,
struct t_hashtable *options,
int timeout,
int (*callback)(const void *pointer,
void *data,
const char *url,
struct t_hashtable *options,
struct t_hashtable *output),
const void *callback_pointer,
void *callback_data);
----
Аргументи:
* _url_: URL
* _options_: options for URL transfer (see below); хеш табела се дуплира у функцији, тако да након овог позива безбедно можете да ослободите меморију коју заузима
* _timeout_: timeout for URL transfer (in milliseconds): after this timeout,
the transfer is stopped (0 means no timeout)
* _callback_: function called when the transfer has ended, arguments and return
value:
** _const void *pointer_: pointer
** _void *data_: pointer
** _const char *url_: URL
** _struct t_hashtable *options_: options
** _struct t_hashtable *output_: result (keys and values are strings), which may
contain the following keys:
*** _response_code_: HTTP response code
*** _headers_: HTTP headers in response
*** _output_: standard output (set only if _file_out_ was not set in options)
*** _error_: error message (set only in case of error)
** return value:
*** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_
* _callback_pointer_: показивач који се прослеђује функцији повратног позива када је позове програм WeeChat
* _callback_data_: показивач који се прослеђује функцији повратног позива када је позове програм WeeChat; ако није NULL, алоцирала га је malloc (или нека слична функција) и аутоматски се ослобађа када се кука обрише
The following Curl options are available (see `+man curl_easy_setopt+` for
a description of each option):
include::{autogendir}/autogen_api_url_options.sr.adoc[tag=url_options]
[NOTE]
^(1)^ За опције типа „mask”, формат је: „вредност1+вредност2+вредност3”; за опције типа „list”, ставке листе морају да се раздвоје преломом линије (`\n`). +
^(2)^ Ако су доступне константе, оне морају да се користе као вредност опције.
These two extra options (strings) are allowed for input/output file:
[width="100%",cols="2,^1,7",options="header"]
|===
| Option | Type | Description
| file_in | string | фајл који се чита и шаље URL адресама (post фајл)
| file_out | string | преузети URL/фајл се уписује у овај фајл (уместо на стандардни излаз)
|===
Повратна вредност:
* показивач на нову куку, NULL у случају грешке
C пример:
[source,c]
----
int
my_url_cb (const void *pointer, void *data, const char *url,
struct t_hashtable *options, struct t_hashtable *output)
{
weechat_printf (NULL, "response_code: %s", weechat_hashtable_get (output, "response_code"));
weechat_printf (NULL, "headers: %s", weechat_hashtable_get (output, "headers"));
weechat_printf (NULL, "output: %s", weechat_hashtable_get (output, "output"));
weechat_printf (NULL, "error: %s", weechat_hashtable_get (output, "error"));
return WEECHAT_RC_OK;
}
/* example 1: output to a file */
struct t_hashtable *options_url1 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url1)
{
weechat_hashtable_set (options_url1, "file_out", "/tmp/weechat.org.html");
struct t_hook *my_url_hook = weechat_hook_url ("https://weechat.org/",
options_url1,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url1);
}
/* example 2: custom HTTP headers, output sent to callback */
struct t_hashtable *options_url2 = weechat_hashtable_new (8,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
if (options_url2)
{
weechat_hashtable_set (options_url2, "httpheader",
"Header1: value1\n"
"Header2: value2");
struct t_hook *my_url_hook = weechat_hook_url ("http://localhost:8080/",
options_url2,
20000,
&my_url_cb, NULL, NULL);
weechat_hashtable_free (options_url2);
}
----
Скрипта (Python):
[source,python]
----
# прототип
def hook_url(url: str, options: Dict[str, str], timeout: int, callback: str, callback_data: str) -> str: ...
# пример
def my_url_cb(data: str, url: str, options: Dict[str, str], output: Dict[str, str]) -> int:
weechat.prnt("", "output: %s" % output)
return weechat.WEECHAT_RC_OK
# example 1: output to a file
hook1 = weechat.hook_url("https://weechat.org/",
{"file_out": "/tmp/weechat.org.html"},
20000, "my_url_cb", "")
# example 2: custom HTTP headers, output sent to callback
options = {
"httpheader": "\n".join([
"Header1: value1",
"Header2: value2",
]),
}
hook2 = weechat.hook_url("http://localhost:8080/", options, 20000, "my_url_cb", "")
----
==== hook_connect
_Ажурирано у верзијама 1.5, 2.0._
@@ -10293,7 +10441,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
==== hook_line
_WeeChat ≥ 2.3, ажурирано у 3.7, 4.1.0._
_WeeChat ≥ 2.3, ажурирано у 3.7._
Качи се на линију која треба да се испише у бафер.
@@ -10349,16 +10497,14 @@ struct t_hook *weechat_hook_line (const char *buffer_type,
|===
| Кључ | Вредност (форматирани бафер) | Вредност (слободни бафер) | Примери
// TRANSLATION MISSING
| buffer
| Comma-separated list of buffer pointers.
| Comma-separated list of buffer pointers.
| Показивач на бафер.
| Показивач на бафер.
| `+0x1234abcd+`
// TRANSLATION MISSING
| buffer_name
| Comma-separated list of buffer names.
| Comma-separated list of buffer names.
| Име бафера.
| Име бафера.
| `+core.weechat+` +
`+irc.server.libera+` +
`+irc.libera.#weechat+`
@@ -10443,23 +10589,17 @@ struct t_hook *weechat_hook_line (const char *buffer_type,
|===
| Кључ | Дозвољена вредност (форматирани бафер) | Дозвољена вредност (слободни бафер) | Резултат
// TRANSLATION MISSING
| buffer
| Comma-separated list buffer pointers (with formatted content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Comma-separated list buffer pointers (with free content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| The line is displayed on these buffers. +
| Показивач на бафер са форматираним садржајем.
| Показивач на бафер са слободним садржајем.
| Линија се приказује у овом баферу. +
Ако је вредност празна, линија се брише (тада се све остало у хеш табели
игнорише); наредне куке типа „line” се не позивају.
// TRANSLATION MISSING
| buffer_name
| Comma-separated list buffer names (with formatted content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| Comma-separated list buffer names (with free content)
(multiple buffers are supported only with WeeChat ≥ 4.1.0).
| The line is displayed on these buffers. +
| Име бафера са форматираним садржајем.
| Име бафера са слободним садржајем.
| Линија се приказује у овом баферу. +
Ако је и `buffer` постављено, вредност `+buffer_name+` има виши приоритет и она се користи. +
Ако је вредност празна, линија се брише (тада се све остало у хеш табели
игнорише); наредне куке типа „line” се не позивају.
@@ -18019,7 +18159,7 @@ for key in hash:
==== hdata_compare
_WeeChat ≥ 1.9._
_WeeChat ≥ 1.9, ажурирано у верзији 4.1.0._
Пореди hdata променљиву два објекта.
@@ -18035,7 +18175,8 @@ int weechat_hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2
* _hdata_: показивач на hdata
* _pointer1_: показивач на први објекат програма WeeChat/додатка
* _pointer2_: показивач на други објекат програма WeeChat/додатка
* _name_: име променљиве; у случају низова, име може бити „N|име” где је N индекс низа (који почиње од 0), на пример: „2|име”
* _name_: назив променљиве или путања до назива променљиве; у случају низова, име може
бити „N|име” где је N индекс низа (који почиње од 0), на пример: „2|име”
* _case_sensitive_: 1 за поређење стрингова које разликује величину слова, у супротном 0
Повратна вредност:
@@ -18051,8 +18192,12 @@ C пример:
struct t_hdata *hdata = weechat_hdata_get ("buffer");
struct t_gui_buffer *buffer1 = weechat_buffer_search ("irc", "libera.#weechat");
struct t_gui_buffer *buffer2 = weechat_buffer_search ("irc", "libera.#weechat-fr");
weechat_printf (NULL, "number comparison = %d",
weechat_printf (NULL, "comparison of buffer number = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "number", 0));
weechat_printf (NULL, "comparison of number of lines = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "own_lines.lines_count", 0));
weechat_printf (NULL, "comparison of local variable = %d",
weechat_hdata_compare (hdata, buffer1, buffer2, "local_variables.myvar", 0));
----
Скрипта (Python):
@@ -18066,7 +18211,9 @@ def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sens
hdata = weechat.hdata_get("buffer")
buffer1 = weechat.buffer_search("irc", "libera.#weechat")
buffer2 = weechat.buffer_search("irc", "libera.#weechat-fr")
weechat.prnt("", "бројно поређење = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparison of buffer number = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "number", 0))
weechat.prnt("", "comparison of number of lines = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "own_lines.lines_count", 0))
weechat.prnt("", "comparison of local variable = %d" % weechat.hdata_compare(hdata, buffer1, buffer2, "local_variables.myvar", 0))
----
==== hdata_set
-1
View File
@@ -92,7 +92,6 @@ _клијенти_ су повезани са _релејем_ као што ј
[[command_handshake]]
=== handshake
// TRANSLATION MISSING
_WeeChat ≥ 2.9, ажурирано у верзијама 3.5, 4.0.0._
Извршава руковање између клијента и програма WeeChat: ово је у већини случајева неопходно како би се сазнале поставке сесије и припремила аутентификација командом _init_.
+135 -78
View File
@@ -129,10 +129,6 @@ WeeChat мора да се изгради са CMake.
| Logger додатак: компресија ротирајућих лог фајлова (gzip). +
Relay додатак: компресија порука (WeeChat -> клијент) са https://zlib.net/[zlib ^↗^^] (weechat протокол). +
Script додатак: читање индекс фајла репозиторијума (gzip).
| libzstd-dev | ≥ 0.8.1
| Logger додатак: компресија ротирајућих лог фајлова. +
Relay додатак: компресија порука (WeeChat -> клијент) са https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat протокол).
|===
[NOTE]
@@ -144,26 +140,68 @@ WeeChat мора да се изгради са CMake.
[width="100%", cols="5,^3,.^15", options="header"]
|===
| Пакет ^(1)^ | Верзија | Могућности
| {cpp} компајлер (pass:[g++ / clang++]) | | Изградња и покретање тестова, JavaScript додатак.
| gettext | | Интернационализација (превод порука; основни језик је енглески).
| ca-certificates | | Сертификати за TLS везе.
| libaspell-dev / libenchant-dev | | Spell додатак.
| python3-dev | ≥ 3.0 | Python додатак.
| libperl-dev | | Perl додатак.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1 | Ruby додатак.
| liblua5.4-dev | | Lua додатак.
| tcl-dev | ≥ 8.5 | Tcl додатак.
| guile-3.0-dev | ≥ 2.0 | Guile (scheme) додатак.
| libv8-dev | ≤ 3.24.3 | JavaScript додатак.
| php-dev | ≥ 7.0 | PHP додатак.
| libphp-embed | ≥ 7.0 | PHP додатак.
| libxml2-dev | | PHP додатак.
| libargon2-dev | | PHP додатак (ако је PHP ≥ 7.2).
| libsodium-dev | | PHP додатак (ако је PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4 | Изградња man странице и документације.
| ruby-pygments.rb | | Документација изградње.
| libcpputest-dev | ≥ 3.4 | Изградња и покретање тестова.
| Пакет ^(1)^ | Верзија | Могућности
| {cpp} компајлер (pass:[g++ / clang++]) |
| Изградња и покретање тестова, JavaScript додатак.
| gettext |
| Интернационализација (превод порука; основни језик је енглески).
| ca-certificates |
| Сертификати за TLS везе.
| libzstd-dev | ≥ 0.8.1
| Logger додатак: компресија ротирајућих лог фајлова (zstandard). +
Relay додатак: компресија порука (WeeChat -> клијент) са https://facebook.github.io/zstd/[Zstandard ^↗^^] (weechat протокол).
| libaspell-dev / libenchant-dev |
| Spell додатак.
| python3-dev | ≥ 3.0
| Python додатак.
| libperl-dev |
| Perl додатак.
| ruby3.1, ruby3.1-dev | ≥ 1.9.1
| Ruby додатак.
| liblua5.4-dev |
| Lua додатак.
| tcl-dev | ≥ 8.5
| Tcl додатак.
| guile-3.0-dev | ≥ 2.0
| Guile (scheme) додатак.
| libv8-dev | ≤ 3.24.3
| JavaScript додатак.
| php-dev | ≥ 7.0
| PHP додатак.
| libphp-embed | ≥ 7.0
| PHP додатак.
| libxml2-dev |
| PHP додатак.
| libargon2-dev |
| PHP додатак (ако је PHP ≥ 7.2).
| libsodium-dev |
| PHP додатак (ако је PHP ≥ 7.2).
| asciidoctor | ≥ 1.5.4
| Изградња man странице и документације.
| ruby-pygments.rb |
| Документација изградње.
| libcpputest-dev | ≥ 3.4
| Изградња и покретање тестова.
|===
[NOTE]
@@ -201,7 +239,8 @@ $ make install
Можете да користите опције за CMake, у формату: `-DОПЦИЈА=ВРЕДНОСТ`.
Листа често коришћених опција:
// TRANSLATION MISSING
List of available options:
[width="100%", cols="3m,3,3m,10", options="header"]
|===
@@ -255,6 +294,10 @@ $ make install
| ENABLE_GUILE | `ON`, `OFF` | ON
| Компајлира <<scripting_plugins,Guile додатак>> (Scheme).
// TRANSLATION MISSING
| ENABLE_HEADLESS | `ON`, `OFF` | ON
| Compile headless binary.
| ENABLE_IRC | `ON`, `OFF` | ON
| Компајлира <<irc,IRC додатак>>.
@@ -313,6 +356,10 @@ $ make install
| ENABLE_XFER | `ON`, `OFF` | ON
| Компајлира <<xfer,Xfer додатак>>.
// TRANSLATION MISSING
| ENABLE_ZSTD | `ON`, `OFF` | ON
| Enable https://facebook.github.io/zstd/[Zstandard ^↗^^] compression.
| ENABLE_TESTS | `ON`, `OFF` | OFF
| Компајлира тестове.
@@ -843,6 +890,10 @@ _nicklist_ трака садржи следеће подразумеване с
| buffer_short_name | `#test` | Кратко име текућег бафера.
| buflist2 | `1.weechat` | Листа бафера, друга ставка траке (погледајте опцију <<option_buflist.look.use_items,buflist.look.use_items>>).
| buflist3 | `1.weechat` | Листа бафера, трећа ставка траке (погледајте опцију <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| buflist4 | `1.weechat` | List of buffers, fourth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
// TRANSLATION MISSING
| buflist5 | `1.weechat` | List of buffers, fifth bar item (see option <<option_buflist.look.use_items,buflist.look.use_items>>).
| fset | `+buflist.look.sort: …+` | Помоћ у вези тренутно изабране опције у fset баферу.
| irc_channel | `#test` | Име тренутног IRC канала.
| irc_host | `+user@host.com+` | Име тренутног IRC хоста.
@@ -1328,7 +1379,10 @@ _прозор_ је површина екрана која приказује б
[[buflist]]
=== Листа бафера
Buflist додатак приказује листу бафера у ставки траке која се зове „buflist” (такође су доступне још две ставке траке „buflist2” и „buflist3”). +
// TRANSLATION MISSING
Buflist додатак приказује листу бафера у ставки траке која се зове „buflist”
(four other bar items "buflist2", "buflist3", "buflist4" and "buflist5" are
available as well). +
Подразумевана трака „buflist” са овом ставком се креира током покретања програма.
[[buflist_commands]]
@@ -1459,6 +1513,15 @@ WeeChat нуди доста подразумеваних тастерских п
| kbd:[Ctrl+↓] | Позив наредне команде/поруке у глобалној историји (заједничкој за све бафере). | `+/input history_global_next+`
|===
[[key_bindings_cmdline_system]]
==== Систем
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Тастер | Опис | Команда
| kbd:[Ctrl+z] | Суспендује WeeChat процес. | `+/sys suspend+`
|===
[[key_bindings_buffers]]
=== Бафери
@@ -1650,10 +1713,10 @@ WeeChat нуди доста подразумеваних тастерских п
| kbd:[▼] | - | чет: /list бафер | Помера за пет линија наниже у /list баферу. | `+/list -down 5+`
| kbd:[■ □ □] | - | чет: /list бафер | Бира линију у /list баферу. | `+/window ${_window_number};/list -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | чет: /list бафер | Приступа IRC каналу на изабраној линији. | `+hsignal:irc_list_mouse+`
| kbd:[▲] | - | чет: script бафер | Помера за пет линија навише у script баферу. | `+/script up 5+`
| kbd:[▼] | - | чет: script бафер | Помера за пет линија наниже у script баферу. | `+/script down 5+`
| kbd:[■ □ □] | - | чет: script бафер | Бира линију у script баферу. | `+/script go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | чет: script бафер | Инсталира/уклања скрипту. | `+/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[▲] | - | чет: script бафер | Помера за пет линија навише у script баферу. | `+/script -up 5+`
| kbd:[▼] | - | чет: script бафер | Помера за пет линија наниже у script баферу. | `+/script -down 5+`
| kbd:[■ □ □] | - | чет: script бафер | Бира линију у script баферу. | `+/script -go ${_chat_line_y}+`
| kbd:[□ □ ■] | - | чет: script бафер | Инсталира/уклања скрипту. | `+/script -go ${_chat_line_y};/script installremove -q ${script_name_with_extension}+`
| kbd:[■ □ □] | горе / лево | листа бафера | Помера бафер на нижи број. | Signal `+buflist_mouse+`.
| kbd:[■ □ □] | доле / десно | листа бафера | Помера бафер на виши број. | Signal `+buflist_mouse+`.
| kbd:[■ □ □] | - | листа бафера | Пребацивање на бафер (претходно посећени багер ако је бафер текући). | Signal `+buflist_mouse+`.
@@ -1716,8 +1779,8 @@ kbd:[▼]: точкић доле
| kbd:[Ctrl+l] (`L`) | | Освежава опције и цео екран. | `+/fset -refresh+`
| | `$` | Освежава опције (маркиране опције остају маркиране). |
| | `$$` | Освежава опције (уклања се маркирање са свих опција). |
| kbd:[Alt+p] | | Пребацује стање опција описа додатка (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | | Пребацује стање видљивости траке помоћи. | `+/bar toggle fset+`
| kbd:[Alt+p] | `p` | Пребацује стање опција описа додатка (`pass:[plugins.desc.*]`). | `+/mute /set fset.look.show_plugins_desc toggle+`
| kbd:[Alt+v] | `v` | Пребацује стање видљивости траке помоћи. | `+/bar toggle fset+`
| | `s:x,y` | Сортира опције по пољима x,y (погледајте опцију <<option_fset.look.sort,fset.look.sort>>). | `+/mute /set fset.look.sort x,y+`
| | `s:` | Ресетује сортирање на подразумевану вредност (погледајте опцију <<option_fset.look.sort,fset.look.sort>>). | `+/mute /unset fset.look.sort+`
| | `w:xxx` | Извози опције у фајл „xxx”. | `+/fset -export xxx+`
@@ -1771,17 +1834,24 @@ kbd:[▼]: точкић доле
[width="100%", cols="^.^3,^.^2,.^8,.^5", options="header"]
|===
| Тастер | Акција ^(1)^ | Опис | Команда
| kbd:[↑] | | Помера једну линију навише. | `+/script up+`
| kbd:[↓] | | Помера једну линију наниже. | `+/script down+`
| kbd:[↑] | | Помера једну линију навише. | `+/script -up+`
| kbd:[↓] | | Помера једну линију наниже. | `+/script -down+`
| kbd:[PgUp] | | Помера једну страну навише. | `+/window page_up+`
| kbd:[PgDn] | | Помера једну страну наниже. | `+/window page_down+`
| kbd:[Alt+i] | `i` | Инсталира скрипту. | `+/script install+`
| kbd:[Alt+r] | `r` | Брише скрипту. | `+/script remove+`
| kbd:[Alt+l] (`L`) | `l` | Учитава скрипту. | `+/script load+`
| kbd:[Alt+l] | `l` | Учитава скрипту. | `+/script load+`
// TRANSLATION MISSING
| kbd:[Alt+L] | `L` | Reload script. | `+/script reload+`
| kbd:[Alt+u] | `u` | Уклања скрипту из меморије. | `+/script unload+`
| kbd:[Alt+Shift+A] | `A` | Аутоучитавање скрипте. | `+/script toggleautoload+`
| kbd:[Alt+h] | `h` | Задржава/отпушта скрипту. | `+/script hold+`
| kbd:[Alt+v] | `v` | Преглед скрипте. | `+/script show+`
// TRANSLATION MISSING
| | `s:x,y` | Sort scripts by fields x,y (погледајте опцију <<option_script.look.sort,script.look.sort>>). |
| | `s:` | Ресетује сортирање на подразумевану вредност (погледајте опцију <<option_script.look.sort,script.look.sort>>). |
| | `$` | Освежава листу. |
| | `q` | Затвара бафер. | `+/buffer close+`
|===
[NOTE]
@@ -2111,13 +2181,9 @@ include::{autogendir}/autogen_user_options.sr.adoc[tag=charset_options]
На пример, ако желите да искључите истицања од „joe” и „mike” у текућем баферу:
----
/buffer set hotlist_max_level_nicks_add joe:2,mike:2
/buffer setauto hotlist_max_level_nicks_add joe:2,mike:2
----
[NOTE]
Особина бафера „hotlist_max_level_nicks” се не чува у конфигурацији. +
Лако можете да је сачувате скриптом _buffer_autoset.py_: инсталирате је командом `+/script install buffer_autoset.py+`, а помоћ добијате са `+/help buffer_autoset+`.
[[highlights]]
=== Истицања
@@ -2141,13 +2207,9 @@ include::{autogendir}/autogen_user_options.sr.adoc[tag=charset_options]
Исти пример, који функционише само на текућем баферу:
----
/buffer set highlight_disable_regex <flash.*>
/buffer setauto highlight_disable_regex <flash.*>
----
[NOTE]
Особина бафера „highlight_disable_regex” се не чува у конфигурацији. +
Лако можете да је сачувате скриптом _buffer_autoset.py_: инсталирате је командом `+/script install buffer_autoset.py+`, а помоћ добијате са `+/help buffer_autoset+`.
[[highlights_words]]
==== Додавање речи које се истичу
@@ -2189,13 +2251,9 @@ include::{autogendir}/autogen_user_options.sr.adoc[tag=charset_options]
На пример, да форсирате истицање свих порука у текућем баферу:
----
/buffer set highlight_regex .*
/buffer setauto highlight_regex .*
----
[NOTE]
Особина бафера „highlight_regex” се не чува у конфигурацији. +
Лако можете да је сачувате скриптом _buffer_autoset.py_: инсталирате је командом `+/script install buffer_autoset.py+`, а помоћ добијате са `+/help buffer_autoset+`.
[[buffer_logging]]
=== Логовање бафера
@@ -3007,30 +3065,31 @@ include::{autogendir}/autogen_user_options.sr.adoc[tag=sec_options]
[width="100%", cols="3m,6m,16", options="header"]
|===
| Одељак | Команда за контролу | Опис
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Дибаг ниво, за језгро и додатке (у одељку је могуће додавање/уклањање опција).
| startup | /set weechat.startup.* | Опције покретања програма.
| look | /set weechat.look.* | Изглед и осећај.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Алијаси боја (у одељку је могуће додавање/уклањање опција).
| color | /set weechat.color.* | Боје.
| completion | /set weechat.completion.* | Опције довршавања.
| history | /set weechat.history.* | Опције историје (команди и бафера).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Прокси опције.
| network | /set weechat.network.* | Мрежне/TLS опције.
| plugin | /set weechat.plugin.* | Опције додатака.
| signal | /set weechat.signal.* | Опције сигнала.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Опције трака.
| layout | <<command_weechat_layout,/layout>> | Распореди.
| notify | <<command_weechat_buffer,/buffer notify>> | Нивои обавештавања за бафере (у одељку је могуће додавање/уклањање опција).
| filter | <<command_weechat_filter,/filter>> | Филтери.
| key | <<command_weechat_key,/key>> | Тастери у подразумеваном контексту.
| key_search | <<command_weechat_key,/key>> | Тастери у search контексту.
| key_cursor | <<command_weechat_key,/key>> | Тастери у cursor контексту.
| key_mouse | <<command_weechat_key,/key>> | Тастери у mouse конексту.
| Одељак | Команда за контролу | Опис
| debug | <<command_weechat_debug,/debug set>> +
/set weechat.debug.* | Дибаг ниво, за језгро и додатке (у одељку је могуће додавање/уклањање опција).
| startup | /set weechat.startup.* | Опције покретања програма.
| look | /set weechat.look.* | Изглед и осећај.
| palette | <<command_weechat_color,/color alias>> +
/set weechat.palette.* | Алијаси боја (у одељку је могуће додавање/уклањање опција).
| color | /set weechat.color.* | Боје.
| completion | /set weechat.completion.* | Опције довршавања.
| history | /set weechat.history.* | Опције историје (команди и бафера).
| proxy | <<command_weechat_proxy,/proxy>> +
/set weechat.proxy.* | Прокси опције.
| network | /set weechat.network.* | Мрежне/TLS опције.
| plugin | /set weechat.plugin.* | Опције додатака.
| signal | /set weechat.signal.* | Опције сигнала.
| bar | <<command_weechat_bar,/bar>> +
/set weechat.bar.* | Опције трака.
| layout | <<command_weechat_layout,/layout>> | Распореди.
| buffer | <<command_weechat_buffer,/buffer setauto>> | Особине које се аутоматски примењују на бафере када се отварају.
| notify | <<command_weechat_buffer,/buffer notify>> | Нивои обавештавања за бафере (у одељку је могуће додавање/уклањање опција).
| filter | <<command_weechat_filter,/filter>> | Филтери.
| key | <<command_weechat_key,/key>> | Тастери у подразумеваном контексту.
| key_search | <<command_weechat_key,/key>> | Тастери у search контексту.
| key_cursor | <<command_weechat_key,/key>> | Тастери у cursor контексту.
| key_mouse | <<command_weechat_key,/key>> | Тастери у mouse конексту.
|===
Опције:
@@ -3872,7 +3931,7 @@ CTCP одговори се израчунавају (погледајте ком
[width="100%", cols="2,4,8", options="header"]
|===
| Променљива | Опис | Вредност/пример
| `+${clientinfo}+` | Листа подржаних CTCP | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| `+${clientinfo}+` | Листа подржаних CTCP | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| `+${version}+` | Верзија програма WeeChat | `+4.1.0-dev+`
| `+${versiongit}+` | WeeChat верзија + Git верзија ^(1)^ | `+4.1.0-dev (git: v4.0.0-51-g8f98b922a)+`
| `+${git}+` | Git верзија ^(1)^ | `+v4.0.0-51-g8f98b922a+`
@@ -3893,11 +3952,9 @@ CTCP одговори се израчунавају (погледајте ком
[width="100%", cols="2,4,8", options="header"]
|===
| CTCP | Формат одговора | Пример
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION+`
| FINGER | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
| CLIENTINFO | `+${clientinfo}+` | `+ACTION DCC CLIENTINFO PING SOURCE TIME VERSION+`
| SOURCE | `+${download}+` | `+https://weechat.org/download/+`
| TIME | `+${time}+` | `+Суб, 08 Јул 2023 21:11:19 +0200+`
| USERINFO | `+${username} (${realname})+` | `+име (Пера Перић)+`
| VERSION | `+WeeChat ${version}+` | `+WeeChat 4.1.0-dev+`
|===
+52 -56
View File
@@ -17,6 +17,11 @@
# along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
#
# Check for programs xgettext, msgmerge and msgfmt
find_program(XGETTEXT_EXECUTABLE xgettext REQUIRED)
find_program(MSGMERGE_EXECUTABLE msgmerge REQUIRED)
find_program(MSGFMT_EXECUTABLE msgfmt REQUIRED)
set(PO_FILES
cs.po
de.po
@@ -39,70 +44,61 @@ set(POT_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${POT_FILE}")
include(srcfiles.cmake)
# Looking for xgettext, msgmerge and msgfmt
find_program(XGETTEXT_EXECUTABLE xgettext)
find_program(MSGMERGE_EXECUTABLE msgmerge)
find_program(MSGFMT_EXECUTABLE msgfmt)
# Create PO template file weechat.pot
set(SRC_FILES)
set(POT_DEPENDS)
if(XGETTEXT_EXECUTABLE AND MSGMERGE_EXECUTABLE AND MSGFMT_EXECUTABLE)
foreach(srcfile ${WEECHAT_SOURCES})
set(SRC_FILES ${SRC_FILES} ${srcfile})
set(POT_DEPENDS ${POT_DEPENDS} "${CMAKE_SOURCE_DIR}/${srcfile}")
endforeach()
# Create PO template file weechat.pot
set(SRC_FILES)
set(POT_DEPENDS)
add_custom_command(
OUTPUT "${POT_FILE_PATH}"
COMMAND "${XGETTEXT_EXECUTABLE}"
ARGS -o "${POT_FILE_PATH}" --add-comments='TRANSLATORS:' --keyword='_' --keyword='weechat_gettext' --keyword='N_' --keyword='NG_:1,2' --keyword='weechat_ngettext:1,2' --no-location --from-code=UTF-8 --directory="${CMAKE_SOURCE_DIR}" --package-name='WeeChat' --package-version=${VERSION} --msgid-bugs-address=${BUGS_ADDRESS} --copyright-holder='NAME' ${SRC_FILES}
DEPENDS ${POT_DEPENDS}
COMMENT "Generating ${POT_FILE}"
)
foreach(srcfile ${WEECHAT_SOURCES})
set(SRC_FILES ${SRC_FILES} ${srcfile})
set(POT_DEPENDS ${POT_DEPENDS} "${CMAKE_SOURCE_DIR}/${srcfile}")
endforeach()
set(MO_FILES)
set(UPDATE_PO_TARGETS)
foreach(pofile ${PO_FILES})
get_filename_component(polang ${pofile} NAME_WE)
# Compile .po files in build directory (to binary .mo files)
set(modir "${CMAKE_CURRENT_BINARY_DIR}/${polang}/LC_MESSAGES")
file(MAKE_DIRECTORY "${modir}")
set(mofile "${modir}/${PROJECT_NAME}.mo")
add_custom_command(
OUTPUT "${POT_FILE_PATH}"
COMMAND "${XGETTEXT_EXECUTABLE}"
ARGS -o "${POT_FILE_PATH}" --add-comments='TRANSLATORS:' --keyword='_' --keyword='weechat_gettext' --keyword='N_' --keyword='NG_:1,2' --keyword='weechat_ngettext:1,2' --no-location --from-code=UTF-8 --directory="${CMAKE_SOURCE_DIR}" --package-name='WeeChat' --package-version=${VERSION} --msgid-bugs-address=${BUGS_ADDRESS} --copyright-holder='NAME' ${SRC_FILES}
DEPENDS ${POT_DEPENDS}
COMMENT "Generating ${POT_FILE}"
OUTPUT "${mofile}"
COMMAND "${MSGMERGE_EXECUTABLE}" ARGS --quiet -o "${CMAKE_CURRENT_BINARY_DIR}/${pofile}" "${CMAKE_CURRENT_SOURCE_DIR}/${pofile}" ${POT_FILE_PATH}
COMMAND "${MSGFMT_EXECUTABLE}" ARGS -o "${mofile}" "${CMAKE_CURRENT_BINARY_DIR}/${pofile}"
COMMAND "${MSGFMT_EXECUTABLE}" ARGS -c --statistics --verbose --output-file=/dev/null "${CMAKE_CURRENT_BINARY_DIR}/${pofile}"
DEPENDS "${POT_FILE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/${pofile}"
COMMENT "Compiling ${polang}.po"
)
set(MO_FILES)
set(UPDATE_PO_TARGETS)
foreach(pofile ${PO_FILES})
get_filename_component(polang ${pofile} NAME_WE)
# Compile .po files in build directory (to binary .mo files)
set(modir "${CMAKE_CURRENT_BINARY_DIR}/${polang}/LC_MESSAGES")
file(MAKE_DIRECTORY "${modir}")
set(mofile "${modir}/${PROJECT_NAME}.mo")
add_custom_command(
OUTPUT "${mofile}"
COMMAND "${MSGMERGE_EXECUTABLE}" ARGS --quiet -o "${CMAKE_CURRENT_BINARY_DIR}/${pofile}" "${CMAKE_CURRENT_SOURCE_DIR}/${pofile}" ${POT_FILE_PATH}
COMMAND "${MSGFMT_EXECUTABLE}" ARGS -o "${mofile}" "${CMAKE_CURRENT_BINARY_DIR}/${pofile}"
COMMAND "${MSGFMT_EXECUTABLE}" ARGS -c --statistics --verbose --output-file=/dev/null "${CMAKE_CURRENT_BINARY_DIR}/${pofile}"
DEPENDS "${POT_FILE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/${pofile}"
COMMENT "Compiling ${polang}.po"
)
# Update .po files in source directory (if needed)
add_custom_target(
update-${pofile}
COMMAND "${MSGMERGE_EXECUTABLE}" --quiet --update --previous --backup=none "${CMAKE_CURRENT_SOURCE_DIR}/${pofile}" "${POT_FILE_PATH}"
COMMENT "Updating ${polang}.po"
)
set(UPDATE_PO_TARGETS ${UPDATE_PO_TARGETS} update-${pofile})
install(FILES "${mofile}" DESTINATION "${LOCALEDIR}/${polang}/LC_MESSAGES")
set(MO_FILES ${MO_FILES} ${mofile})
endforeach()
add_custom_target(translations ALL DEPENDS ${MO_FILES})
# Update weechat.pot in source directory (if needed)
# Update .po files in source directory (if needed)
add_custom_target(
update-${POT_FILE}
COMMAND "${MSGMERGE_EXECUTABLE}" --quiet --update --backup=none "${CMAKE_CURRENT_SOURCE_DIR}/${POT_FILE}" "${POT_FILE_PATH}"
COMMENT "Updating ${POT_FILE}"
update-${pofile}
COMMAND "${MSGMERGE_EXECUTABLE}" --quiet --update --previous --backup=none "${CMAKE_CURRENT_SOURCE_DIR}/${pofile}" "${POT_FILE_PATH}"
COMMENT "Updating ${polang}.po"
)
set(UPDATE_PO_TARGETS ${UPDATE_PO_TARGETS} update-${pofile})
# Update all .po and weechat.pot in source directory (if needed)
add_custom_target(update-po DEPENDS update-${POT_FILE} ${UPDATE_PO_TARGETS})
install(FILES "${mofile}" DESTINATION "${LOCALEDIR}/${polang}/LC_MESSAGES")
set(MO_FILES ${MO_FILES} ${mofile})
endforeach()
endif()
add_custom_target(translations ALL DEPENDS ${MO_FILES})
# Update weechat.pot in source directory (if needed)
add_custom_target(
update-${POT_FILE}
COMMAND "${MSGMERGE_EXECUTABLE}" --quiet --update --backup=none "${CMAKE_CURRENT_SOURCE_DIR}/${POT_FILE}" "${POT_FILE_PATH}"
COMMENT "Updating ${POT_FILE}"
)
# Update all .po and weechat.pot in source directory (if needed)
add_custom_target(update-po DEPENDS update-${POT_FILE} ${UPDATE_PO_TARGETS})
+501 -128
View File
File diff suppressed because it is too large Load Diff
+619 -373
View File
File diff suppressed because it is too large Load Diff
+501 -132
View File
File diff suppressed because it is too large Load Diff
+578 -155
View File
File diff suppressed because it is too large Load Diff
+442 -89
View File
File diff suppressed because it is too large Load Diff
+503 -139
View File
File diff suppressed because it is too large Load Diff
+552 -137
View File
File diff suppressed because it is too large Load Diff
+663 -140
View File
File diff suppressed because it is too large Load Diff
+508 -140
View File
File diff suppressed because it is too large Load Diff
+488 -96
View File
File diff suppressed because it is too large Load Diff
+453 -94
View File
File diff suppressed because it is too large Load Diff
+731 -147
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -35,6 +35,8 @@ SET(WEECHAT_SOURCES
./src/core/hook/wee-hook-signal.h
./src/core/hook/wee-hook-timer.c
./src/core/hook/wee-hook-timer.h
./src/core/hook/wee-hook-url.c
./src/core/hook/wee-hook-url.h
./src/core/wee-arraylist.c
./src/core/wee-arraylist.h
./src/core/wee-backtrace.c
@@ -89,6 +91,8 @@ SET(WEECHAT_SOURCES
./src/core/wee-signal.h
./src/core/wee-string.c
./src/core/wee-string.h
./src/core/wee-sys.c
./src/core/wee-sys.h
./src/core/wee-upgrade.c
./src/core/wee-upgrade-file.c
./src/core/wee-upgrade-file.h
@@ -179,6 +183,8 @@ SET(WEECHAT_SOURCES
./src/plugins/buflist/buflist.c
./src/plugins/buflist/buflist-command.c
./src/plugins/buflist/buflist-command.h
./src/plugins/buflist/buflist-completion.c
./src/plugins/buflist/buflist-completion.h
./src/plugins/buflist/buflist-config.c
./src/plugins/buflist/buflist-config.h
./src/plugins/buflist/buflist.h
+581 -135
View File
File diff suppressed because it is too large Load Diff
+429 -78
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -47,6 +47,7 @@ set(LIB_CORE_SRC
wee-secure-config.c wee-secure-config.h
wee-signal.c wee-signal.h
wee-string.c wee-string.h
wee-sys.c wee-sys.h
wee-upgrade.c wee-upgrade.h
wee-upgrade-file.c wee-upgrade-file.h
wee-url.c wee-url.h
@@ -71,6 +72,7 @@ set(LIB_CORE_SRC
hook/wee-hook-process.c hook/wee-hook-process.h
hook/wee-hook-signal.c hook/wee-hook-signal.h
hook/wee-hook-timer.c hook/wee-hook-timer.h
hook/wee-hook-url.c hook/wee-hook-url.h
)
# Check for flock support
@@ -89,7 +91,9 @@ include_directories(${GNUTLS_INCLUDE_PATH})
include_directories(${CURL_INCLUDE_DIRS})
include_directories(${ZSTD_INCLUDE_DIRS})
if(ENABLE_ZSTD)
include_directories(${LIBZSTD_INCLUDE_DIRS})
endif()
include_directories("${CMAKE_BINARY_DIR}")
add_library(weechat_core STATIC ${LIB_CORE_SRC})
+3 -2
View File
@@ -101,6 +101,7 @@ int
hook_command_run_exec (struct t_gui_buffer *buffer, const char *command)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
int rc, hook_matching, length;
char *command2;
const char *ptr_string, *ptr_command;
@@ -149,13 +150,13 @@ hook_command_run_exec (struct t_gui_buffer *buffer, const char *command)
if (hook_matching)
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
rc = (HOOK_COMMAND_RUN(ptr_hook, callback)) (
ptr_hook->callback_pointer,
ptr_hook->callback_data,
buffer,
ptr_command);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
if (rc == WEECHAT_RC_OK_EAT)
{
if (command2)
+3 -2
View File
@@ -364,6 +364,7 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
struct t_hook *ptr_hook, *next_hook;
struct t_hook *hook_plugin, *hook_other_plugin, *hook_other_plugin2;
struct t_hook *hook_incomplete_command;
struct t_hook_exec_cb hook_exec_cb;
char **argv, **argv_eol;
const char *ptr_command_name;
int argc, rc, length_command_name, allow_incomplete_commands;
@@ -500,7 +501,7 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
else
{
/* execute the command! */
ptr_hook->running++;
hook_callback_start (ptr_hook, &hook_exec_cb);
rc = (int) (HOOK_COMMAND(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
@@ -508,7 +509,7 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
argc,
argv,
argv_eol);
ptr_hook->running--;
hook_callback_end (ptr_hook, &hook_exec_cb);
if (rc == WEECHAT_RC_ERROR)
rc = HOOK_COMMAND_EXEC_ERROR;
else
+3 -2
View File
@@ -107,6 +107,7 @@ hook_completion_exec (struct t_weechat_plugin *plugin,
struct t_gui_completion *completion)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
const char *pos;
char *item;
@@ -134,14 +135,14 @@ hook_completion_exec (struct t_weechat_plugin *plugin,
&& !ptr_hook->running
&& (strcmp (HOOK_COMPLETION(ptr_hook, completion_item), item) == 0))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
(void) (HOOK_COMPLETION(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
completion_item,
buffer,
completion);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
}
ptr_hook = next_hook;
+3 -2
View File
@@ -98,6 +98,7 @@ void
hook_config_exec (const char *option, const char *value)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
hook_exec_start ();
@@ -111,13 +112,13 @@ hook_config_exec (const char *option, const char *value)
&& (!HOOK_CONFIG(ptr_hook, option)
|| (string_match (option, HOOK_CONFIG(ptr_hook, option), 0))))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
(void) (HOOK_CONFIG(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
option,
value);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
}
ptr_hook = next_hook;
+1 -1
View File
@@ -270,7 +270,7 @@ hook_connect_free_data (struct t_hook *hook)
if (HOOK_CONNECT(hook, child_pid) > 0)
{
kill (HOOK_CONNECT(hook, child_pid), SIGKILL);
waitpid (HOOK_CONNECT(hook, child_pid), NULL, 0);
hook_schedule_clean_process (HOOK_CONNECT(hook, child_pid));
HOOK_CONNECT(hook, child_pid) = 0;
}
if (HOOK_CONNECT(hook, child_read) != -1)
+4 -3
View File
@@ -203,8 +203,9 @@ hook_fd (struct t_weechat_plugin *plugin, int fd, int flag_read,
void
hook_fd_exec ()
{
int i, num_fd, timeout, ready, found;
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
int i, num_fd, timeout, ready, found;
if (!weechat_hooks[HOOK_TYPE_FD])
return;
@@ -279,12 +280,12 @@ hook_fd_exec ()
}
if (found)
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
(void) (HOOK_FD(ptr_hook, callback)) (
ptr_hook->callback_pointer,
ptr_hook->callback_data,
HOOK_FD(ptr_hook, fd));
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
}
}
+5 -4
View File
@@ -153,6 +153,7 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1,
struct t_hashtable *hashtable_focus2)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
struct t_hashtable *hashtable1, *hashtable2, *hashtable_ret;
const char *focus1_chat, *focus1_bar_item_name, *keys;
char **list_keys, *new_key;
@@ -185,12 +186,12 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1,
&& (strcmp (HOOK_FOCUS(ptr_hook, area), focus1_bar_item_name) == 0))))
{
/* run callback for focus #1 */
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
hashtable_ret = (HOOK_FOCUS(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
hashtable1);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
if (hashtable_ret)
{
if (hashtable_ret != hashtable1)
@@ -209,12 +210,12 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1,
/* run callback for focus #2 */
if (hashtable2)
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
hashtable_ret = (HOOK_FOCUS(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
hashtable2);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
if (hashtable_ret)
{
if (hashtable_ret != hashtable2)
+3 -2
View File
@@ -102,6 +102,7 @@ struct t_hdata *
hook_hdata_get (struct t_weechat_plugin *plugin, const char *hdata_name)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
struct t_hdata *value;
/* make C compiler happy */
@@ -128,12 +129,12 @@ hook_hdata_get (struct t_weechat_plugin *plugin, const char *hdata_name)
&& !ptr_hook->running
&& (strcmp (HOOK_HDATA(ptr_hook, hdata_name), hdata_name) == 0))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
value = (HOOK_HDATA(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
HOOK_HDATA(ptr_hook, hdata_name));
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
hook_exec_end ();
return value;
+3 -2
View File
@@ -129,6 +129,7 @@ int
hook_hsignal_send (const char *signal, struct t_hashtable *hashtable)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
int rc;
rc = WEECHAT_RC_OK;
@@ -144,13 +145,13 @@ hook_hsignal_send (const char *signal, struct t_hashtable *hashtable)
&& !ptr_hook->running
&& (hook_hsignal_match (signal, ptr_hook)))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
rc = (HOOK_HSIGNAL(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
signal,
hashtable);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
if (rc == WEECHAT_RC_OK_EAT)
break;
+3 -2
View File
@@ -106,6 +106,7 @@ hook_info_get_hashtable (struct t_weechat_plugin *plugin, const char *info_name,
struct t_hashtable *hashtable)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
struct t_hashtable *value;
/* make C compiler happy */
@@ -125,13 +126,13 @@ hook_info_get_hashtable (struct t_weechat_plugin *plugin, const char *info_name,
&& !ptr_hook->running
&& (strcmp (HOOK_INFO_HASHTABLE(ptr_hook, info_name), info_name) == 0))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
value = (HOOK_INFO_HASHTABLE(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
info_name,
hashtable);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
hook_exec_end ();
return value;
+3 -2
View File
@@ -105,6 +105,7 @@ hook_info_get (struct t_weechat_plugin *plugin, const char *info_name,
const char *arguments)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
char *value;
/* make C compiler happy */
@@ -124,13 +125,13 @@ hook_info_get (struct t_weechat_plugin *plugin, const char *info_name,
&& !ptr_hook->running
&& (strcmp (HOOK_INFO(ptr_hook, info_name), info_name) == 0))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
value = (HOOK_INFO(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
info_name,
arguments);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
hook_exec_end ();
return value;
+3 -2
View File
@@ -106,6 +106,7 @@ hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name,
void *pointer, const char *arguments)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
struct t_infolist *value;
/* make C compiler happy */
@@ -125,14 +126,14 @@ hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name,
&& !ptr_hook->running
&& (strcmp (HOOK_INFOLIST(ptr_hook, infolist_name), infolist_name) == 0))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
value = (HOOK_INFOLIST(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
infolist_name,
pointer,
arguments);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
hook_exec_end ();
return value;
+10 -53
View File
@@ -27,7 +27,6 @@
#include <string.h>
#include "../weechat.h"
#include "../wee-arraylist.h"
#include "../wee-hashtable.h"
#include "../wee-hook.h"
#include "../wee-infolist.h"
@@ -122,31 +121,18 @@ hook_line (struct t_weechat_plugin *plugin, const char *buffer_type,
* Executes a line hook and updates the line data.
*/
struct t_arraylist *
void
hook_line_exec (struct t_gui_line *line)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
struct t_hashtable *hashtable, *hashtable2;
struct t_arraylist *buffers;
struct t_gui_buffer *ptr_buffer;
char str_value[128], *str_tags, **str_buffers;
int i, size;
hashtable = NULL;
buffers = NULL;
str_buffers = NULL;
buffers = arraylist_new (16, 0, 0, NULL, NULL, NULL, NULL);
if (!buffers)
goto end;
arraylist_add (buffers, line->data->buffer);
char str_value[128], *str_tags;
if (!weechat_hooks[HOOK_TYPE_LINE])
goto end;
return;
str_buffers = string_dyn_alloc (256);
if (!str_buffers)
goto end;
hashtable = NULL;
hook_exec_start ();
@@ -176,28 +162,8 @@ hook_line_exec (struct t_gui_line *line)
if (!hashtable)
break;
}
size = arraylist_size (buffers);
/* build list of buffer pointers */
string_dyn_copy (str_buffers, NULL);
for (i = 0; i < size; i++)
{
if (i > 0)
string_dyn_concat (str_buffers, ",", -1);
snprintf (str_value, sizeof (str_value),
"0x%lx", (unsigned long)(arraylist_get (buffers, i)));
string_dyn_concat (str_buffers, str_value, -1);
}
HASHTABLE_SET_STR("buffer", *str_buffers);
/* build list of buffer names */
string_dyn_copy (str_buffers, NULL);
for (i = 0; i < size; i++)
{
if (i > 0)
string_dyn_concat (str_buffers, ",", -1);
ptr_buffer = (struct t_gui_buffer *)arraylist_get (buffers, i);
string_dyn_concat (str_buffers, ptr_buffer->full_name, -1);
}
HASHTABLE_SET_STR("buffer_name", *str_buffers);
HASHTABLE_SET_POINTER("buffer", line->data->buffer);
HASHTABLE_SET_STR("buffer_name", line->data->buffer->full_name);
HASHTABLE_SET_STR("buffer_type",
gui_buffer_type_string[line->data->buffer->type]);
HASHTABLE_SET_INT("y", line->data->y);
@@ -217,16 +183,16 @@ hook_line_exec (struct t_gui_line *line)
HASHTABLE_SET_STR_NOT_NULL("message", line->data->message);
/* run callback */
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
hashtable2 = (HOOK_LINE(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
hashtable);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
if (hashtable2)
{
gui_line_hook_update (line, buffers, hashtable, hashtable2);
gui_line_hook_update (line, hashtable, hashtable2);
hashtable_free (hashtable2);
if (!line->data->buffer)
break;
@@ -238,17 +204,8 @@ hook_line_exec (struct t_gui_line *line)
hook_exec_end ();
end:
if (hashtable)
hashtable_free (hashtable);
if (str_buffers)
string_dyn_free (str_buffers, 1);
if (line->data->buffer && buffers && (arraylist_size (buffers) == 0))
arraylist_add (buffers, line->data->buffer);
return buffers;
}
/*
+1 -1
View File
@@ -51,7 +51,7 @@ extern struct t_hook *hook_line (struct t_weechat_plugin *plugin,
t_hook_callback_line *callback,
const void *callback_pointer,
void *callback_data);
extern struct t_arraylist *hook_line_exec (struct t_gui_line *line);
extern void hook_line_exec (struct t_gui_line *line);
extern void hook_line_free_data (struct t_hook *hook);
extern int hook_line_add_to_infolist (struct t_infolist_item *item,
struct t_hook *hook);
+3 -2
View File
@@ -100,6 +100,7 @@ hook_modifier_exec (struct t_weechat_plugin *plugin, const char *modifier,
const char *modifier_data, const char *string)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
char *new_msg, *message_modified;
/* make C compiler happy */
@@ -125,14 +126,14 @@ hook_modifier_exec (struct t_weechat_plugin *plugin, const char *modifier,
&& (string_strcasecmp (HOOK_MODIFIER(ptr_hook, modifier),
modifier) == 0))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
new_msg = (HOOK_MODIFIER(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
modifier,
modifier_data,
message_modified);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
/* empty string returned => message dropped */
if (new_msg && !new_msg[0])
+3 -2
View File
@@ -121,6 +121,7 @@ void
hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
char *prefix_no_color, *message_no_color;
if (!weechat_hooks[HOOK_TYPE_PRINT])
@@ -161,7 +162,7 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
HOOK_PRINT(ptr_hook, tags_array))))
{
/* run callback */
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
(void) (HOOK_PRINT(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
@@ -172,7 +173,7 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
(int)line->data->displayed, (int)line->data->highlight,
(HOOK_PRINT(ptr_hook, strip_colors)) ? prefix_no_color : line->data->prefix,
(HOOK_PRINT(ptr_hook, strip_colors)) ? message_no_color : line->data->message);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
}
ptr_hook = next_hook;
+9 -6
View File
@@ -146,6 +146,7 @@ hook_process_hashtable (struct t_weechat_plugin *plugin,
ptr_value = hashtable_get (options, "buffer_flush");
if (ptr_value && ptr_value[0])
{
error = NULL;
number = strtol (ptr_value, &error, 10);
if (error && !error[0]
&& (number >= 1) && (number <= HOOK_PROCESS_BUFFER_SIZE))
@@ -278,7 +279,9 @@ hook_process_child (struct t_hook *hook_process)
{
ptr_url++;
}
rc = weeurl_download (ptr_url, HOOK_PROCESS(hook_process, options));
rc = weeurl_download (ptr_url,
HOOK_PROCESS(hook_process, options),
NULL); /* output */
}
else if (strncmp (HOOK_PROCESS(hook_process, command), "func:", 5) == 0)
{
@@ -596,12 +599,11 @@ hook_process_timer_cb (const void *pointer, void *data, int remaining_calls)
if (weechat_debug_core >= 1)
{
gui_chat_printf (NULL,
_("End of command '%s', timeout reached (%.1fs)"),
_("End of command '%s', timeout reached (%.3fs)"),
HOOK_PROCESS(hook_process, command),
((float)HOOK_PROCESS(hook_process, timeout)) / 1000);
}
kill (HOOK_PROCESS(hook_process, child_pid), SIGKILL);
usleep (1000);
unhook (hook_process);
}
else
@@ -792,6 +794,7 @@ void
hook_process_exec ()
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
hook_exec_start ();
@@ -804,9 +807,9 @@ hook_process_exec ()
&& !ptr_hook->running
&& (HOOK_PROCESS(ptr_hook, child_pid) == 0))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
hook_process_run (ptr_hook);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
}
ptr_hook = next_hook;
@@ -860,7 +863,7 @@ hook_process_free_data (struct t_hook *hook)
if (HOOK_PROCESS(hook, child_pid) > 0)
{
kill (HOOK_PROCESS(hook, child_pid), SIGKILL);
waitpid (HOOK_PROCESS(hook, child_pid), NULL, 0);
hook_schedule_clean_process (HOOK_PROCESS(hook, child_pid));
HOOK_PROCESS(hook, child_pid) = 0;
}
if (HOOK_PROCESS(hook, child_read[HOOK_PROCESS_STDIN]) != -1)
+3 -2
View File
@@ -129,6 +129,7 @@ int
hook_signal_send (const char *signal, const char *type_data, void *signal_data)
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
int rc;
rc = WEECHAT_RC_OK;
@@ -144,14 +145,14 @@ hook_signal_send (const char *signal, const char *type_data, void *signal_data)
&& !ptr_hook->running
&& hook_signal_match (signal, ptr_hook))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
rc = (HOOK_SIGNAL(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
signal,
type_data,
signal_data);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
if (rc == WEECHAT_RC_OK_EAT)
break;
+4 -3
View File
@@ -302,8 +302,9 @@ end:
void
hook_timer_exec ()
{
struct timeval tv_time;
struct t_hook *ptr_hook, *next_hook;
struct t_hook_exec_cb hook_exec_cb;
struct timeval tv_time;
if (!weechat_hooks[HOOK_TYPE_TIMER])
return;
@@ -324,13 +325,13 @@ hook_timer_exec ()
&& (util_timeval_cmp (&HOOK_TIMER(ptr_hook, next_exec),
&tv_time) <= 0))
{
ptr_hook->running = 1;
hook_callback_start (ptr_hook, &hook_exec_cb);
(void) (HOOK_TIMER(ptr_hook, callback))
(ptr_hook->callback_pointer,
ptr_hook->callback_data,
(HOOK_TIMER(ptr_hook, remaining_calls) > 0) ?
HOOK_TIMER(ptr_hook, remaining_calls) - 1 : -1);
ptr_hook->running = 0;
hook_callback_end (ptr_hook, &hook_exec_cb);
if (!ptr_hook->deleted)
{
HOOK_TIMER(ptr_hook, last_exec).tv_sec = tv_time.tv_sec;
+461
View File
@@ -0,0 +1,461 @@
/*
* wee-hook-url.c - WeeChat URL hook
*
* Copyright (C) 2023 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/wait.h>
#include <poll.h>
#include <fcntl.h>
#include <errno.h>
#include <pthread.h>
#include "../weechat.h"
#include "../wee-hashtable.h"
#include "../wee-hook.h"
#include "../wee-infolist.h"
#include "../wee-log.h"
#include "../wee-string.h"
#include "../wee-url.h"
#include "../../gui/gui-chat.h"
#include "../../plugins/plugin.h"
/*
* Returns description of hook.
*
* Note: result must be freed after use.
*/
char *
hook_url_get_description (struct t_hook *hook)
{
char str_desc[1024];
snprintf (str_desc, sizeof (str_desc),
"URL: \"%s\", thread id: %d",
HOOK_URL(hook, url),
0);
return strdup (str_desc);
}
/*
* Displays keys and values of a hashtable.
*/
void
hook_url_hashtable_map_cb (void *data, struct t_hashtable *hashtable,
const void *key, const void *value)
{
/* make C compiler happy */
(void) data;
(void) hashtable;
gui_chat_printf (NULL, " %s: \"%s\"",
(const char *)key,
(const char *)value);
}
/*
* Runs callback of url hook.
*/
void
hook_url_run_callback (struct t_hook *hook)
{
if (url_debug)
{
gui_chat_printf (NULL, "Running hook_url callback for URL \"%s\":",
HOOK_URL(hook, url));
gui_chat_printf (NULL, " options:");
hashtable_map (HOOK_URL(hook, options), &hook_url_hashtable_map_cb, NULL);
gui_chat_printf (NULL, " output:");
hashtable_map (HOOK_URL(hook, output), &hook_url_hashtable_map_cb, NULL);
}
(void) (HOOK_URL(hook, callback))
(hook->callback_pointer,
hook->callback_data,
HOOK_URL(hook, url),
HOOK_URL(hook, options),
HOOK_URL(hook, output));
}
/*
* Thread cleanup function: mark thread as not running any more.
*/
void
hook_url_thread_cleanup (void *hook_pointer)
{
struct t_hook *hook;
hook = (struct t_hook *)hook_pointer;
HOOK_URL(hook, thread_running) = 0;
}
/*
* URL transfer (in a separate thread).
*/
void *
hook_url_transfer_thread (void *hook_pointer)
{
struct t_hook *hook;
int url_rc;
char str_error_code[12];
hook = (struct t_hook *)hook_pointer;
pthread_cleanup_push (&hook_url_thread_cleanup, hook);
url_rc = weeurl_download (HOOK_URL(hook, url),
HOOK_URL(hook, options),
HOOK_URL(hook, output));
if (url_rc != 0)
{
snprintf (str_error_code, sizeof (str_error_code), "%d", url_rc);
hashtable_set (HOOK_URL(hook, output), "error_code", str_error_code);
}
pthread_cleanup_pop (1);
pthread_exit (NULL);
}
/*
* Checks if thread is still alive.
*/
int
hook_url_timer_cb (const void *pointer, void *data, int remaining_calls)
{
struct t_hook *hook;
const char *ptr_error;
char str_error[1024], str_error_code[12];
/* make C compiler happy */
(void) data;
(void) remaining_calls;
hook = (struct t_hook *)pointer;
if (hook->deleted)
return WEECHAT_RC_OK;
if (!HOOK_URL(hook, thread_running))
{
hook_url_run_callback (hook);
ptr_error = hashtable_get (HOOK_URL(hook, output), "error");
if ((weechat_debug_core >= 1) && ptr_error && ptr_error[0])
{
gui_chat_printf (
NULL,
_("%sURL transfer error: %s (URL: \"%s\")"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
ptr_error,
HOOK_URL(hook, url));
}
unhook (hook);
return WEECHAT_RC_OK;
}
if (remaining_calls == 0)
{
if (!hashtable_has_key (HOOK_URL(hook, output), "error_code"))
{
snprintf (str_error, sizeof (str_error),
"transfer timeout reached (%.3fs)",
((float)HOOK_URL(hook, timeout)) / 1000);
snprintf (str_error_code, sizeof (str_error_code), "6");
hashtable_set (HOOK_URL(hook, output), "error", str_error);
hashtable_set (HOOK_URL(hook, output), "error_code", str_error_code);
}
hook_url_run_callback (hook);
if (weechat_debug_core >= 1)
{
gui_chat_printf (
NULL,
_("End of URL transfer '%s', timeout reached (%.3fs)"),
HOOK_URL(hook, url),
((float)HOOK_URL(hook, timeout)) / 1000);
}
pthread_cancel (HOOK_URL(hook, thread_id));
usleep (1000);
unhook (hook);
}
return WEECHAT_RC_OK;
}
/*
* Starts transfer for an URL hook.
*/
void
hook_url_transfer (struct t_hook *hook)
{
int rc, timeout, max_calls;
long interval;
char str_error[1024], str_error_code[12], str_error_code_pthread[12];
HOOK_URL(hook, thread_running) = 1;
/* create thread */
rc = pthread_create (&(HOOK_URL(hook, thread_id)), NULL,
&hook_url_transfer_thread, hook);
if (rc != 0)
{
snprintf (str_error, sizeof (str_error),
"error calling pthread_create (%d)", rc);
snprintf (str_error_code, sizeof (str_error_code), "5");
snprintf (str_error_code_pthread, sizeof (str_error_code_pthread),
"%d", rc);
hashtable_set (HOOK_URL(hook, output), "error", str_error);
hashtable_set (HOOK_URL(hook, output), "error_code", str_error_code);
hashtable_set (HOOK_URL(hook, output), "error_code_pthread",
str_error_code_pthread);
hook_url_run_callback (hook);
if (weechat_debug_core >= 1)
{
gui_chat_printf (NULL,
_("%sError running thread in hook_url: %s (URL: \"%s\")"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
strerror (rc),
HOOK_URL(hook, url));
}
unhook (hook);
return;
}
/* main thread */
HOOK_URL(hook, thread_created) = 1;
timeout = HOOK_URL(hook, timeout);
interval = 100;
max_calls = 0;
if (timeout > 0)
{
if (timeout <= 100)
{
interval = timeout;
max_calls = 1;
}
else
{
interval = 100;
max_calls = timeout / 100;
if (timeout % 100 == 0)
max_calls++;
}
}
HOOK_URL(hook, hook_timer) = hook_timer (hook->plugin,
interval, 0, max_calls,
&hook_url_timer_cb,
hook,
NULL);
}
/*
* Hooks a URL.
*
* Returns pointer to new hook, NULL if error.
*/
struct t_hook *
hook_url (struct t_weechat_plugin *plugin,
const char *url,
struct t_hashtable *options,
int timeout,
t_hook_callback_url *callback,
const void *callback_pointer,
void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_url *new_hook_url;
new_hook = NULL;
new_hook_url = NULL;
if (!url || !url[0] || !callback)
goto error;
new_hook = malloc (sizeof (*new_hook));
if (!new_hook)
goto error;
new_hook_url = malloc (sizeof (*new_hook_url));
if (!new_hook_url)
goto error;
hook_init_data (new_hook, plugin, HOOK_TYPE_URL, HOOK_PRIORITY_DEFAULT,
callback_pointer, callback_data);
new_hook->hook_data = new_hook_url;
new_hook_url->callback = callback;
new_hook_url->url = strdup (url);
new_hook_url->options = (options) ? hashtable_dup (options) : NULL;
new_hook_url->timeout = timeout;
new_hook_url->thread_id = 0;
new_hook_url->thread_created = 0;
new_hook_url->thread_running = 0;
new_hook_url->hook_timer = NULL;
new_hook_url->output = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
hook_add_to_list (new_hook);
if (weechat_debug_core >= 1)
{
gui_chat_printf (NULL,
"debug: hook_url: url=\"%s\", "
"options=\"%s\", timeout=%d",
new_hook_url->url,
hashtable_get_string (new_hook_url->options,
"keys_values"),
new_hook_url->timeout);
}
hook_url_transfer (new_hook);
return new_hook;
error:
if (new_hook)
free (new_hook);
if (new_hook_url)
free (new_hook_url);
return NULL;
}
/*
* Frees data in a url hook.
*/
void
hook_url_free_data (struct t_hook *hook)
{
void *retval;
if (!hook || !hook->hook_data)
return;
if (HOOK_URL(hook, url))
{
free (HOOK_URL(hook, url));
HOOK_URL(hook, url) = NULL;
}
if (HOOK_URL(hook, options))
{
hashtable_free (HOOK_URL(hook, options));
HOOK_URL(hook, options) = NULL;
}
if (HOOK_URL(hook, hook_timer))
{
unhook (HOOK_URL(hook, hook_timer));
HOOK_URL(hook, hook_timer) = NULL;
}
if (HOOK_URL(hook, thread_running))
{
pthread_cancel (HOOK_URL(hook, thread_id));
HOOK_URL(hook, thread_running) = 0;
}
if (HOOK_URL(hook, thread_created))
pthread_join (HOOK_URL(hook, thread_id), &retval);
if (HOOK_URL(hook, output))
{
hashtable_free (HOOK_URL(hook, output));
HOOK_URL(hook, output) = NULL;
}
free (hook->hook_data);
hook->hook_data = NULL;
}
/*
* Adds url hook data in the infolist item.
*
* Returns:
* 1: OK
* 0: error
*/
int
hook_url_add_to_infolist (struct t_infolist_item *item,
struct t_hook *hook)
{
if (!item || !hook || !hook->hook_data)
return 0;
if (!infolist_new_var_pointer (item, "callback", HOOK_URL(hook, callback)))
return 0;
if (!infolist_new_var_string (item, "url", HOOK_URL(hook, url)))
return 0;
if (!infolist_new_var_string (item, "options", hashtable_get_string (HOOK_URL(hook, options), "keys_values")))
return 0;
if (!infolist_new_var_integer (item, "timeout", (int)(HOOK_URL(hook, timeout))))
return 0;
if (!infolist_new_var_integer (item, "thread_created", (int)(HOOK_URL(hook, thread_created))))
return 0;
if (!infolist_new_var_integer (item, "thread_running", (int)(HOOK_URL(hook, thread_running))))
return 0;
if (!infolist_new_var_pointer (item, "hook_timer", HOOK_URL(hook, hook_timer)))
return 0;
if (!infolist_new_var_string (item, "output", hashtable_get_string (HOOK_URL(hook, output), "keys_values")))
return 0;
return 1;
}
/*
* Prints url hook data in WeeChat log file (usually for crash dump).
*/
void
hook_url_print_log (struct t_hook *hook)
{
if (!hook || !hook->hook_data)
return;
log_printf (" url data:");
log_printf (" callback. . . . . . . : 0x%lx", HOOK_URL(hook, callback));
log_printf (" url . . . . . . . . . : '%s'", HOOK_URL(hook, url));
log_printf (" options . . . . . . . : 0x%lx (hashtable: '%s')",
HOOK_URL(hook, options),
hashtable_get_string (HOOK_URL(hook, options),
"keys_values"));
log_printf (" timeout . . . . . . . : %ld", HOOK_URL(hook, timeout));
log_printf (" thread_created. . . . : %d", (int)HOOK_URL(hook, thread_created));
log_printf (" thread_running. . . . : %d", (int)HOOK_URL(hook, thread_running));
log_printf (" hook_timer. . . . . . : 0x%lx", HOOK_URL(hook, hook_timer));
log_printf (" output. . . . . . . . : 0x%lx (hashtable: '%s')",
HOOK_URL(hook, output),
hashtable_get_string (HOOK_URL(hook, output),
"keys_values"));
}
+60
View File
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2023 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef WEECHAT_HOOK_URL_H
#define WEECHAT_HOOK_URL_H
struct t_weechat_plugin;
struct t_infolist_item;
struct t_hashtable;
#define HOOK_URL(hook, var) (((struct t_hook_url *)hook->hook_data)->var)
typedef int (t_hook_callback_url)(const void *pointer, void *data,
const char *url,
struct t_hashtable *options,
struct t_hashtable *output);
struct t_hook_url
{
t_hook_callback_url *callback; /* URL callback */
char *url; /* URL */
struct t_hashtable *options; /* URL options (see doc) */
long timeout; /* timeout (ms) (0 = no timeout) */
pthread_t thread_id; /* thread id */
int thread_created; /* thread created */
int thread_running; /* 1 if thread is running */
struct t_hook *hook_timer; /* timer to check if thread has ended*/
struct t_hashtable *output; /* URL transfer output data */
};
extern char *hook_url_get_description (struct t_hook *hook);
extern struct t_hook *hook_url (struct t_weechat_plugin *plugin,
const char *url,
struct t_hashtable *options,
int timeout,
t_hook_callback_url *callback,
const void *callback_pointer,
void *callback_data);
extern void hook_url_free_data (struct t_hook *hook);
extern int hook_url_add_to_infolist (struct t_infolist_item *item,
struct t_hook *hook);
extern void hook_url_print_log (struct t_hook *hook);
#endif /* WEECHAT_HOOK_URL_H */
+383 -75
View File
@@ -59,8 +59,11 @@
#include "wee-secure.h"
#include "wee-secure-buffer.h"
#include "wee-secure-config.h"
#include "wee-signal.h"
#include "wee-string.h"
#include "wee-sys.h"
#include "wee-upgrade.h"
#include "wee-url.h"
#include "wee-utf8.h"
#include "wee-util.h"
#include "wee-version.h"
@@ -642,7 +645,7 @@ COMMAND_CALLBACK(buffer)
long number, number1, number2, numbers[3];
char *error, *value, *pos, *str_number1, *pos_number2;
int i, count, prev_number, clear_number, list_size;
int buffer_found, arg_name, type_free, switch_to_buffer;
int buffer_found, arg_name, type_free, switch_to_buffer, rc;
/* make C compiler happy */
(void) pointer;
@@ -736,6 +739,7 @@ COMMAND_CALLBACK(buffer)
else
{
ptr_buffer = gui_buffer_search_by_number_or_name (argv[i]);
error = NULL;
(void) strtol (argv[i], &error, 10);
clear_number = (error && !error[0]);
}
@@ -971,6 +975,7 @@ COMMAND_CALLBACK(buffer)
ptr_buffer = gui_buffer_search_by_number_or_name (argv[i]);
if (ptr_buffer)
{
error = NULL;
(void) strtol (argv[i], &error, 10);
if (error && !error[0])
{
@@ -1009,6 +1014,7 @@ COMMAND_CALLBACK(buffer)
ptr_buffer = gui_buffer_search_by_number_or_name (argv[i]);
if (ptr_buffer)
{
error = NULL;
(void) strtol (argv[i], &error, 10);
if (error && !error[0])
{
@@ -1328,6 +1334,41 @@ COMMAND_CALLBACK(buffer)
return WEECHAT_RC_OK;
}
/*
* set a property on buffer, saved in config, auto-applied when the buffer
* is opened
*/
if (string_strcmp (argv[1], "setauto") == 0)
{
COMMAND_MIN_ARGS(3, "setauto");
if (argc == 3)
{
/*
* default to empty value for valueless buffer "properties",
* e.g. localvar_del_xxx
*/
rc = config_weechat_buffer_set (buffer, argv[2], "");
}
else
{
value = string_remove_quotes (argv_eol[3], "'\"");
rc = config_weechat_buffer_set (buffer,
argv[2],
(value) ? value : argv_eol[3]);
if (value)
free (value);
}
if (!rc)
{
gui_chat_printf (
NULL,
_("%sUnable to create option for buffer property \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
}
return WEECHAT_RC_OK;
}
/* get a buffer property */
if (string_strcmp (argv[1], "get") == 0)
{
@@ -1953,7 +1994,8 @@ COMMAND_CALLBACK(debug)
struct t_config_option *ptr_option;
struct t_weechat_plugin *ptr_plugin;
struct timeval time_start, time_end;
char *result;
char *result, *str_threshold;
long long threshold;
int debug;
/* make C compiler happy */
@@ -1988,6 +2030,28 @@ COMMAND_CALLBACK(debug)
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "callbacks") == 0)
{
COMMAND_MIN_ARGS(3, "callbacks");
threshold = util_parse_delay (argv[2], 1);
if (threshold > 0)
{
str_threshold = util_get_microseconds_string (threshold);
debug_long_callbacks = threshold;
gui_chat_printf (NULL,
_("Debug enabled for callbacks (threshold: %s)"),
(str_threshold) ? str_threshold : "?");
if (str_threshold)
free (str_threshold);
}
else
{
debug_long_callbacks = 0;
gui_chat_printf (NULL, _("Debug disabled for callbacks"));
}
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "certs") == 0)
{
gui_chat_printf (NULL,
@@ -2163,6 +2227,15 @@ COMMAND_CALLBACK(debug)
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "url") == 0)
{
url_debug ^= 1;
gui_chat_printf (NULL,
_("Debug hook_url: %s"),
(url_debug) ? _("enabled") : _("disabled"));
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "windows") == 0)
{
debug_windows_tree ();
@@ -4048,7 +4121,7 @@ COMMAND_CALLBACK(key)
{
struct t_gui_key *ptr_new_key;
int i, old_keys_count, keys_added, context, rc;
char *key_name;
char *key_name, *value;
/* make C compiler happy */
(void) pointer;
@@ -4139,8 +4212,14 @@ COMMAND_CALLBACK(key)
}
gui_key_verbose = 1;
(void) gui_key_bind (NULL, GUI_KEY_CONTEXT_DEFAULT,
argv[2], argv_eol[3], 1);
value = string_remove_quotes (argv_eol[3], "'\"");
(void) gui_key_bind (NULL, /* buffer */
GUI_KEY_CONTEXT_DEFAULT,
argv[2],
(value) ? value : argv_eol[3],
1); /* check_key */
if (value)
free (value);
gui_key_verbose = 0;
return WEECHAT_RC_OK;
@@ -4181,7 +4260,14 @@ COMMAND_CALLBACK(key)
}
gui_key_verbose = 1;
gui_key_bind (NULL, context, argv[3], argv_eol[4], 1);
value = string_remove_quotes (argv_eol[4], "'\"");
gui_key_bind (NULL, /* buffer */
context,
argv[3],
(value) ? value : argv_eol[4],
1); /* check_key */
if (value)
free (value);
gui_key_verbose = 0;
return WEECHAT_RC_OK;
@@ -5661,6 +5747,91 @@ COMMAND_CALLBACK(reload)
return WEECHAT_RC_OK;
}
/*
* Executes a repeated command.
*/
void
command_repeat_exec (struct t_command_repeat *command_repeat)
{
struct t_gui_buffer *ptr_buffer;
struct t_hashtable *pointers, *extra_vars;
char str_number[32], *cmd_eval;
if (!command_repeat || !command_repeat->buffer_name
|| !command_repeat->command)
{
return;
}
ptr_buffer = gui_buffer_search_by_full_name (command_repeat->buffer_name);
if (!ptr_buffer)
return;
pointers = hashtable_new (
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
NULL, NULL);
if (!pointers)
return;
extra_vars = hashtable_new (
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
if (!extra_vars)
{
hashtable_free (pointers);
return;
}
hashtable_set (pointers, "buffer", ptr_buffer);
snprintf (str_number, sizeof (str_number), "%d", command_repeat->count);
hashtable_set (extra_vars, "repeat_count", str_number);
snprintf (str_number, sizeof (str_number), "%d", command_repeat->index);
hashtable_set (extra_vars, "repeat_index", str_number);
snprintf (str_number, sizeof (str_number), "%d", command_repeat->index - 1);
hashtable_set (extra_vars, "repeat_index0", str_number);
snprintf (str_number, sizeof (str_number), "%d", command_repeat->count - command_repeat->index + 1);
hashtable_set (extra_vars, "repeat_revindex", str_number);
snprintf (str_number, sizeof (str_number), "%d", command_repeat->count - command_repeat->index);
hashtable_set (extra_vars, "repeat_revindex0", str_number);
hashtable_set (extra_vars, "repeat_first",
(command_repeat->index == 1) ? "1" : "0");
hashtable_set (extra_vars, "repeat_last",
(command_repeat->index >= command_repeat->count) ? "1" : "0");
cmd_eval = eval_expression (command_repeat->command,
pointers, extra_vars, NULL);
if (cmd_eval)
{
(void) input_data (ptr_buffer,
cmd_eval,
command_repeat->commands_allowed,
0); /* split_newline */
free (cmd_eval);
}
hashtable_free (pointers);
hashtable_free (extra_vars);
if (command_repeat->index < command_repeat->count)
{
/* increment index for next execution */
command_repeat->index++;
}
else
{
/* it was the last execution, free up memory */
free (command_repeat->buffer_name);
free (command_repeat->command);
if (command_repeat->commands_allowed)
free (command_repeat->commands_allowed);
free (command_repeat);
}
}
/*
* Callback for repeat timer.
*/
@@ -5668,35 +5839,11 @@ COMMAND_CALLBACK(reload)
int
command_repeat_timer_cb (const void *pointer, void *data, int remaining_calls)
{
char **repeat_args;
int i;
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
(void) data;
(void) remaining_calls;
repeat_args = (char **)pointer;
if (!repeat_args)
return WEECHAT_RC_ERROR;
if (repeat_args[0] && repeat_args[1])
{
/* search buffer, fallback to core buffer if not found */
ptr_buffer = gui_buffer_search_by_full_name (repeat_args[0]);
if (ptr_buffer)
(void) input_data (ptr_buffer, repeat_args[1], repeat_args[2], 0);
}
if (remaining_calls == 0)
{
for (i = 0; i < 3; i++)
{
if (repeat_args[i])
free (repeat_args[i]);
}
free (repeat_args);
}
command_repeat_exec ((struct t_command_repeat *)pointer);
return WEECHAT_RC_OK;
}
@@ -5708,8 +5855,9 @@ command_repeat_timer_cb (const void *pointer, void *data, int remaining_calls)
COMMAND_CALLBACK(repeat)
{
int arg_count, count, i;
long interval;
char *error, **repeat_args;
long long interval;
char *error;
struct t_command_repeat *cmd_repeat;
/* make C compiler happy */
(void) pointer;
@@ -5722,9 +5870,10 @@ COMMAND_CALLBACK(repeat)
if ((argc >= 5) && (string_strcmp (argv[1], "-interval") == 0))
{
interval = util_parse_delay (argv[2], 1000);
if (interval < 1)
interval = util_parse_delay (argv[2], 1000000);
if (interval < 0)
interval = 0;
interval /= 1000;
arg_count = 3;
}
@@ -5740,8 +5889,25 @@ COMMAND_CALLBACK(repeat)
return WEECHAT_RC_OK;
}
cmd_repeat = malloc (sizeof (*cmd_repeat));
if (!cmd_repeat)
{
gui_chat_printf (NULL,
_("%sNot enough memory (%s)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
"/repeat");
return WEECHAT_RC_OK;
}
cmd_repeat->buffer_name = strdup (buffer->full_name);
cmd_repeat->command = strdup (argv_eol[arg_count + 1]);
cmd_repeat->commands_allowed = (input_commands_allowed) ?
string_rebuild_split_string (
(const char **)input_commands_allowed, ",", 0, -1) : NULL;
cmd_repeat->count = count;
cmd_repeat->index = 1;
/* first execute command now */
(void) input_data (buffer, argv_eol[arg_count + 1], NULL, 0);
command_repeat_exec (cmd_repeat);
/* repeat execution of command */
if (count > 1)
@@ -5751,28 +5917,14 @@ COMMAND_CALLBACK(repeat)
/* execute command multiple times now */
for (i = 0; i < count - 1; i++)
{
(void) input_data (buffer, argv_eol[arg_count + 1], NULL, 0);
command_repeat_exec (cmd_repeat);
}
}
else
{
/* schedule execution of command in future */
repeat_args = malloc (3 * sizeof (*repeat_args));
if (!repeat_args)
{
gui_chat_printf (NULL,
_("%sNot enough memory (%s)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
"/repeat");
return WEECHAT_RC_OK;
}
repeat_args[0] = strdup (buffer->full_name);
repeat_args[1] = strdup (argv_eol[arg_count + 1]);
repeat_args[2] = (input_commands_allowed) ?
string_rebuild_split_string (
(const char **)input_commands_allowed, ",", 0, -1) : NULL;
hook_timer (NULL, interval, 0, count - 1,
&command_repeat_timer_cb, repeat_args, NULL);
&command_repeat_timer_cb, cmd_repeat, NULL);
}
}
@@ -5970,7 +6122,7 @@ COMMAND_CALLBACK(save)
COMMAND_CALLBACK(secure)
{
int passphrase_was_set, count_encrypted;
int passphrase_was_set, count_encrypted, rc;
/* make C compiler happy */
(void) pointer;
@@ -6001,7 +6153,33 @@ COMMAND_CALLBACK(secure)
gui_chat_printf (NULL, _("All encrypted data has been deleted"));
return WEECHAT_RC_OK;
}
if (secure_decrypt_data_not_decrypted (argv_eol[2]) > 0)
rc = secure_decrypt_data_not_decrypted (argv_eol[2]);
if (rc == -2)
{
gui_chat_printf (
NULL,
_("%sFailed to decrypt data: hash algorithm \"%s\" is not "
"available (ligbcrypt version is too old?)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
config_file_option_string (secure_config_crypt_hash_algo));
}
else if (rc == -3)
{
gui_chat_printf (
NULL,
_("%sFailed to decrypt data: cipher \"%s\" is not "
"available (ligbcrypt version is too old?)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
config_file_option_string (secure_config_crypt_cipher));
}
else if ((rc == -1) || (rc == 0))
{
gui_chat_printf (NULL,
_("%sFailed to decrypt data: wrong passphrase?"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
}
else
{
gui_chat_printf (NULL,
_("Encrypted data has been successfully decrypted"));
@@ -6009,12 +6187,6 @@ COMMAND_CALLBACK(secure)
free (secure_passphrase);
secure_passphrase = strdup (argv_eol[2]);
}
else
{
gui_chat_printf (NULL,
_("%sFailed to decrypt data (wrong passphrase?)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
}
return WEECHAT_RC_OK;
}
@@ -6594,6 +6766,47 @@ COMMAND_CALLBACK(set)
return WEECHAT_RC_OK;
}
/*
* Callback for command "/sys": system actions.
*/
COMMAND_CALLBACK(sys)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) buffer;
COMMAND_MIN_ARGS(2, "");
if (string_strcmp (argv[1], "get") == 0)
{
COMMAND_MIN_ARGS(2, "get");
if (string_strcmp (argv[2], "rlimit") == 0)
sys_display_rlimit ();
else if (string_strcmp (argv[2], "rusage") == 0)
sys_display_rusage ();
else
COMMAND_ERROR;
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "suspend") == 0)
{
signal_suspend ();
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "waitpid") == 0)
{
sys_waitpid ();
return WEECHAT_RC_OK;
}
COMMAND_ERROR;
}
/*
* Callback for command "/toggle": toggles value of configuration option.
*/
@@ -6862,14 +7075,17 @@ COMMAND_CALLBACK(upgrade)
}
/*
* it is forbidden to upgrade while there are some background process
* (hook type "process" or "connect")
* it is forbidden to upgrade while there are some background process or
* thread (hook types: process, connect, url)
*/
if (weechat_hooks[HOOK_TYPE_PROCESS] || weechat_hooks[HOOK_TYPE_CONNECT])
if (weechat_hooks[HOOK_TYPE_PROCESS]
|| weechat_hooks[HOOK_TYPE_CONNECT]
|| weechat_hooks[HOOK_TYPE_URL])
{
gui_chat_printf (NULL,
_("%sCan't upgrade: there is one or more background "
"process (hook type 'process' or 'connect')"),
"process/thread running (hook type: process, "
"connect or url)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
return WEECHAT_RC_OK;
}
@@ -7221,7 +7437,7 @@ COMMAND_CALLBACK(version)
COMMAND_CALLBACK(wait)
{
long delay;
long long delay;
/* make C compiler happy */
(void) pointer;
@@ -7229,10 +7445,12 @@ COMMAND_CALLBACK(wait)
COMMAND_MIN_ARGS(3, "");
delay = util_parse_delay (argv[1], 1000);
delay = util_parse_delay (argv[1], 1000000);
if (delay < 1)
COMMAND_ERROR;
delay /= 1000;
if (input_data_delayed (buffer, argv_eol[2], NULL, 0, delay) != WEECHAT_RC_OK)
COMMAND_ERROR;
@@ -7645,6 +7863,7 @@ command_init ()
hook_command (
NULL, "allbuf",
N_("execute a command on all buffers"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("<command>"),
N_("command: command to execute (or text to send to buffer if "
"command does not start with '/')\n"
@@ -7656,6 +7875,7 @@ command_init ()
hook_command (
NULL, "away",
N_("set or remove away status"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[-all] [<message>]"),
N_(" -all: set or remove away status on all connected servers\n"
"message: message for away (if no message is given, away status is "
@@ -7664,6 +7884,7 @@ command_init ()
hook_command (
NULL, "bar",
N_("manage bars"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("list|listfull|listitems"
" || add <name> <type>[,<conditions>] <position> <size> <separator> "
"<item1>[,<item2>...]"
@@ -7739,6 +7960,7 @@ command_init ()
hook_command (
NULL, "buffer",
N_("manage buffers"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("list"
" || add [-free] [-switch] <name>"
" || clear [<number>|<name>|-merged|-all [<number>|<name>...]]"
@@ -7758,6 +7980,7 @@ command_init ()
" || setvar <name> [<value>]"
" || delvar <name>"
" || set <property> [<value>]"
" || setauto <property> [<value>]"
" || get <property>"
" || jump smart|last_displayed|prev_visited|next_visited"
" || <number>|-|+|<name>"),
@@ -7795,6 +8018,9 @@ command_init ()
" setvar: set a local variable in the current buffer\n"
" delvar: delete a local variable from the current buffer\n"
" set: set a property in the current buffer\n"
" setauto: like \"set\" and also define option "
"\"weechat.buffer.<name>.<property>\" so that the property is saved "
"in configuration and applied each time this buffer is opened\n"
" get: display a property of current buffer\n"
" jump: jump to another buffer:\n"
" smart: next buffer with activity\n"
@@ -7861,6 +8087,7 @@ command_init ()
" || setvar %(buffer_local_variables) %(buffer_local_variable_value)"
" || delvar %(buffer_local_variables)"
" || set %(buffer_properties_set)"
" || setauto %(buffer_properties_setauto)"
" || get %(buffer_properties_get)"
" || jump smart|last_displayed|prev_visited|next_visited"
" || %(buffers_plugins_names)|%(buffers_names)|%(irc_channels)|"
@@ -7869,6 +8096,7 @@ command_init ()
hook_command (
NULL, "color",
N_("define color aliases and display palette of colors"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("alias <color> <name>"
" || unalias <color>"
" || reset"
@@ -7910,6 +8138,7 @@ command_init ()
hook_command (
NULL, "50000|command",
N_("launch explicit WeeChat or plugin command"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[-buffer <name>] <plugin> <command>"),
N_("-buffer: execute the command on this buffer\n"
" plugin: execute the command from this plugin; 'core' for a "
@@ -7925,6 +8154,7 @@ command_init ()
NULL, "cursor",
N_("free movement of cursor on screen to execute actions on specific "
"areas of screen"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("go chat|<bar> [top_left|top_right|bottom_left|bottom_right]"
" || go <x>,<y>"
" || move up|down|left|right|"
@@ -7976,11 +8206,13 @@ command_init ()
hook_command (
NULL, "debug",
N_("debug functions"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("list"
" || set <plugin> <level>"
" || dump|hooks [<plugin>]"
" || buffer|certs|color|dirs|infolists|libs|memory|tags|"
"term|windows"
"term|url|windows"
" || callbacks <duration>[<unit>]"
" || mouse|cursor [verbose]"
" || hdata [free]"
" || time <command>"
@@ -7993,7 +8225,16 @@ command_init ()
"written when WeeChat crashes)\n"
" hooks: display infos about hooks (with a plugin: display "
"detailed info about hooks created by the plugin)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
" buffer: dump buffer content with hexadecimal values in WeeChat "
"log file\n"
"callbacks: write hook and bar item callbacks that took more than "
"\"duration\" in the WeeChat log file (0 = disable), where optional "
"unit is one of:\n"
" us: microseconds (default)\n"
" ms: milliseconds\n"
" s: seconds\n"
" m: minutes\n"
" h: hours\n"
" certs: display number of loaded trusted certificate authorities\n"
" color: display infos about current color pairs\n"
" cursor: toggle debug for cursor mode\n"
@@ -8008,6 +8249,7 @@ command_init ()
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"
" term: display infos about terminal\n"
" url: toggle debug for calls to hook_url (display output hashtable)\n"
" windows: display windows tree\n"
" time: measure time to execute a command or to send text to "
"the current buffer\n"
@@ -8023,6 +8265,7 @@ command_init ()
" || set %(plugins_names)|" PLUGIN_CORE
" || dump %(plugins_names)|" PLUGIN_CORE
" || buffer"
" || callbacks"
" || certs"
" || color"
" || cursor verbose"
@@ -8036,6 +8279,7 @@ command_init ()
" || mouse verbose"
" || tags"
" || term"
" || url"
" || windows"
" || time %(commands:/)"
" || unicode",
@@ -8043,6 +8287,7 @@ command_init ()
hook_command (
NULL, "eval",
N_("evaluate expression"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[-n|-s] [-d] <expression>"
" || [-n] [-d [-d]] -c <expression1> <operator> <expression2>"),
N_(" -n: display result without sending it to buffer "
@@ -8213,12 +8458,13 @@ command_init ()
" /eval -n -c abcd !~ abc ==> 0\n"
" /eval -n -c abcd =* a*d ==> 1\n"
" /eval -n -c abcd =- bc ==> 1"),
"-n|-s|-c -n|-s|-c",
"-n|-s|-c|%(eval_variables)|%*",
&command_eval, NULL, NULL);
hook_command (
NULL, "filter",
N_("filter messages in buffers, to hide/show them according to tags or "
"regex"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("list"
" || enable|disable|toggle [<name>|@]"
" || add|addreplace <name> <buffer>[,<buffer>...] <tags> <regex>"
@@ -8308,6 +8554,7 @@ command_init ()
hook_command (
NULL, "help",
N_("display help about commands and options"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("-list|-listfull [<plugin> [<plugin>...]] || <command> || <option>"),
N_(" -list: list commands, by plugin (without argument, this list is "
"displayed)\n"
@@ -8322,6 +8569,7 @@ command_init ()
hook_command (
NULL, "history",
N_("show buffer command history"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("clear || <value>"),
N_("clear: clear history\n"
"value: number of history entries to show"),
@@ -8330,6 +8578,7 @@ command_init ()
hook_command (
NULL, "hotlist",
N_("manage hotlist"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("add [low|message|private|highlight]"
" || clear [<level>]"
" || remove"
@@ -8357,6 +8606,7 @@ command_init ()
hook_command (
NULL, "50000|input",
N_("functions for command line"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("<action> [<arguments>]"),
N_("list of actions:\n"
" return: simulate key \"enter\"\n"
@@ -8443,6 +8693,7 @@ command_init ()
hook_command (
NULL, "item",
N_("manage custom bar items"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("list"
" || add|addreplace <name> \"<conditions>\" \"<content>\""
" || rename <name> <new_name>"
@@ -8506,6 +8757,7 @@ command_init ()
hook_command (
NULL, "key",
N_("bind/unbind keys"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[list|listdefault|listdiff] [<context>]"
" || bind <key> [<command> [<args>]]"
" || bindctxt <context> <key> [<command> [<args>]]"
@@ -8525,7 +8777,9 @@ command_init ()
"key (for context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to "
"key, for given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); "
"quotes can be used to preserve spaces at the beginning/end of "
"command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context "
@@ -8602,6 +8856,7 @@ command_init ()
hook_command (
NULL, "layout",
N_("manage buffers/windows layouts"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("store [<name>] [buffers|windows]"
" || apply [<name>] [buffers|windows]"
" || leave"
@@ -8637,6 +8892,7 @@ command_init ()
hook_command (
NULL, "mouse",
N_("mouse control"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("enable|disable|toggle [<delay>]"),
N_(" enable: enable mouse\n"
"disable: disable mouse\n"
@@ -8656,6 +8912,7 @@ command_init ()
hook_command (
NULL, "mute",
N_("execute a command silently"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[-core | -current | -buffer <name>] <command>"),
N_(" -core: no output on WeeChat core buffer\n"
"-current: no output on current buffer\n"
@@ -8682,6 +8939,7 @@ command_init ()
hook_command (
NULL, "plugin",
N_("list/load/unload plugins"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("list [-o|-ol|-i|-il|<name>]"
" || listfull [<name>]"
" || load <filename> [<arguments>]"
@@ -8718,6 +8976,7 @@ command_init ()
hook_command (
NULL, "print",
N_("display text on a buffer"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[-buffer <number>|<name>] [-newbuffer <name>] [-free] [-switch] "
"[-core|-current] [-y <line>] [-escape] [-date <date>] "
"[-tags <tags>] [-action|-error|-join|-network|-quit] [<text>]"
@@ -8784,6 +9043,7 @@ command_init ()
hook_command (
NULL, "proxy",
N_("manage proxies"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("list"
" || add <name> <type> <address> <port> [<username> [<password>]]"
" || del <name>|-all"
@@ -8820,6 +9080,7 @@ command_init ()
hook_command (
NULL, "quit",
N_("quit WeeChat"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[-yes] [<arguments>]"),
N_(" -yes: required if option \"weechat.look.confirm_quit\" "
"is enabled\n"
@@ -8836,6 +9097,7 @@ command_init ()
hook_command (
NULL, "reload",
N_("reload configuration files from disk"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[<file> [<file>...]]"),
N_("file: configuration file to reload (without extension \".conf\")\n"
"\n"
@@ -8845,16 +9107,31 @@ command_init ()
hook_command (
NULL, "repeat",
N_("execute a command several times"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[-interval <delay>[<unit>]] <count> <command>"),
N_(" delay: delay between execution of commands\n"
N_(" delay: delay between execution of commands (minimum: 1 millisecond)\n"
" unit: optional, values are:\n"
" us: microseconds\n"
" ms: milliseconds\n"
" s: seconds (default)\n"
" m: minutes\n"
" h: hours\n"
" count: number of times to execute command\n"
"command: command to execute (or text to send to buffer if command "
"does not start with '/')\n"
"does not start with '/'), evaluated and the following variables "
"are set each time the command is executed:\n"
" ${buffer}: buffer pointer\n"
" ${repeat_count}: number of times the command is executed\n"
" ${repeat_index}: current index (from 1 to \"count\")\n"
" ${repeat_index0}: current index (from 0 to \"count\" - 1)\n"
" ${repeat_revindex}: current index from the end "
"(from \"count\" to 1)\n"
" ${repeat_revindex0}: current index from the end "
"(from \"count\" - 1 to 0)\n"
" ${repeat_first}: \"1\" for the first execution, "
"\"0\" for the others\n"
" ${repeat_last}: \"1\" for the last execution, "
"\"0\" for the others\n"
"\n"
"Note: the command is executed on buffer where /repeat was executed "
"(if the buffer does not exist any more, the command is not "
@@ -8862,12 +9139,16 @@ command_init ()
"\n"
"Example:\n"
" scroll 2 pages up:\n"
" /repeat 2 /window page_up"),
" /repeat 2 /window page_up\n"
" print a countdown, starting at 5:\n"
" /repeat -interval 1 6 "
"/print ${if:${repeat_last}?Boom!:${repeat_revindex0}}"),
"%- %(commands:/)",
&command_repeat, NULL, NULL);
hook_command (
NULL, "reset",
N_("reset config options"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("<option>"
" || -mask <option>"),
N_("option: name of an option\n"
@@ -8885,6 +9166,7 @@ command_init ()
hook_command (
NULL, "save",
N_("save configuration files to disk"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[<file> [<file>...]]"),
N_("file: configuration file to save (without extension \".conf\")\n"
"\n"
@@ -8898,6 +9180,7 @@ command_init ()
NULL, "secure",
N_("manage secured data (passwords or private data encrypted in file "
"sec.conf)"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("passphrase <passphrase>|-delete"
" || decrypt <passphrase>|-discard"
" || set <name> <value>"
@@ -8957,6 +9240,7 @@ command_init ()
hook_command (
NULL, "set",
N_("set config options and environment variables"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[<option> [<value>]]"
" || diff [<option> [<option>...]]"
" || env [<variable> [<value>]]"),
@@ -8994,9 +9278,28 @@ command_init ()
" || diff %(config_options)|%*"
" || env %(env_vars) %(env_value)",
&command_set, NULL, NULL);
hook_command (
NULL, "sys",
N_("system actions"),
"get rlimit|rusage"
" || suspend"
" || waitpid",
N_(" get: display system info\n"
" rlimit: display resource limits "
"(see /help weechat.startup.sys_rlimit and \"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending "
"signal SIGTSTP to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent "
"\"zombie\" processes)"),
"get rlimit|rusage"
" || suspend"
" || waitpid",
&command_sys, NULL, NULL);
hook_command (
NULL, "toggle",
N_("toggle value of a config option"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("<option> [<value> [<value>...]]"),
N_("option: name of an option\n"
" value: possible values for the option (values are split like the "
@@ -9033,6 +9336,7 @@ command_init ()
hook_command (
NULL, "unset",
N_("unset/reset config options"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("<option>"
" || -mask <option>"),
N_("option: name of an option\n"
@@ -9054,6 +9358,7 @@ command_init ()
NULL, "upgrade",
N_("save WeeChat session and reload the WeeChat binary without "
"disconnecting from servers"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("[-yes] [<path_to_binary>|-save|-quit]"),
N_(" -yes: required if option \"weechat.look.confirm_upgrade\" "
"is enabled\n"
@@ -9131,9 +9436,11 @@ command_init ()
hook_command (
NULL, "wait",
N_("schedule a command execution in future"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
N_("<number>[<unit>] <command>"),
N_(" number: amount of time to wait (integer number)\n"
N_(" number: amount of time to wait (minimum: 1 millisecond)\n"
" unit: optional, values are:\n"
" us: microseconds\n"
" ms: milliseconds\n"
" s: seconds (default)\n"
" m: minutes\n"
@@ -9157,6 +9464,7 @@ command_init ()
hook_command (
NULL, "window",
N_("manage windows"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated */
/* xgettext:no-c-format */
N_("list"
" || -1|+1|b#|up|down|left|right [-window <number>]"
+10 -1
View File
@@ -21,6 +21,8 @@
#ifndef WEECHAT_COMMAND_H
#define WEECHAT_COMMAND_H
struct t_gui_buffer;
#define COMMAND_CALLBACK(__command) \
int \
command_##__command (const void *pointer, void *data, \
@@ -80,7 +82,14 @@
return WEECHAT_RC_ERROR; \
}
struct t_gui_buffer;
struct t_command_repeat
{
char *buffer_name; /* full buffer name */
char *command; /* cmd to exec (or text for buffer) */
char *commands_allowed; /* commands currently allowed */
int count; /* number of times the cmd is exec. */
int index; /* current index (starts at 1) */
};
extern const char *command_help_option_color_values ();
extern void command_version_display (struct t_gui_buffer *buffer,
+189
View File
@@ -489,6 +489,76 @@ completion_list_add_buffer_properties_set_cb (const void *pointer, void *data,
return WEECHAT_RC_OK;
}
/*
* Adds a buffer local variable to completions list (for `/buffer setauto`).
*/
void
completion_list_map_buffer_local_variable_setauto_cb (void *data,
struct t_hashtable *hashtable,
const void *key,
const void *value)
{
char str_localvar[4096];
/* make C compiler happy */
(void) hashtable;
(void) value;
snprintf (str_localvar, sizeof (str_localvar),
"localvar_set_%s", (const char *)key);
gui_completion_list_add ((struct t_gui_completion *)data,
str_localvar,
0, WEECHAT_LIST_POS_SORT);
}
/*
* Adds buffer properties (that can be set), local variables and key bindings
* to completion list.
*/
int
completion_list_add_buffer_properties_setauto_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_gui_key *ptr_key;
char str_key[1024];
int i;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
/* add buffer properties */
for (i = 0; gui_buffer_properties_set[i]; i++)
{
gui_completion_list_add (completion,
gui_buffer_properties_set[i],
0, WEECHAT_LIST_POS_SORT);
}
/* add buffer local variables */
hashtable_map (completion->buffer->local_variables,
&completion_list_map_buffer_local_variable_setauto_cb,
completion);
/* add buffer keys */
for (ptr_key = completion->buffer->keys; ptr_key;
ptr_key = ptr_key->next_key)
{
snprintf (str_key, sizeof (str_key), "key_bind_%s", ptr_key->key);
gui_completion_list_add (completion, str_key, 0, WEECHAT_LIST_POS_SORT);
snprintf (str_key, sizeof (str_key), "key_unbind_%s", ptr_key->key);
gui_completion_list_add (completion, str_key, 0, WEECHAT_LIST_POS_SORT);
}
return WEECHAT_RC_OK;
}
/*
* Adds buffer properties (that can be read) to completion list.
*/
@@ -2001,6 +2071,119 @@ completion_list_add_env_value_cb (const void *pointer, void *data,
return WEECHAT_RC_OK;
}
/*
* Adds a buffer local variable for /eval to completions list.
*/
void
completion_list_map_eval_buffer_local_variable_cb (void *data,
struct t_hashtable *hashtable,
const void *key, const void *value)
{
char *name;
int length;
/* make C compiler happy */
(void) hashtable;
(void) value;
length = strlen (key) + 3 + 1;
name = malloc (length);
if (name)
{
snprintf (name, length, "${%s}", (const char *)key);
gui_completion_list_add ((struct t_gui_completion *)data,
name, 0, WEECHAT_LIST_POS_SORT);
free (name);
}
}
/*
* Adds /eval variables to completion list.
*/
int
completion_list_add_eval_variables_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
char *eval_variables[] = {
"${\\xxx}",
"${base_decode:base,xxx}",
"${base_encode:base,xxx}",
"${calc:xxx}",
"${chars:range}",
"${color:xxx}",
"${cut:+max,suffix,string}",
"${cut:max,suffix,string}",
"${cutscr:+max,suffix,string}",
"${cutscr:max,suffix,string}",
"${date:format}",
"${date}",
"${define:name,value}",
"${env:XXX}",
"${esc:xxx}",
"${eval:xxx}",
"${eval_cond:xxx}",
"${file.section.option}",
"${hdata.var1.var2}",
"${hdata[list].var1.var2}",
"${hdata[ptr].var1.var2}",
"${hdata[ptr_name].var1.var2}",
"${hide:char,string}",
"${if:condition?value_if_true:value_if_false}",
"${info:name,arguments}",
"${length:xxx}",
"${lengthscr:xxx}",
"${lower:xxx}",
"${modifier:name,data,xxx}",
"${random:min,max}",
"${raw:xxx}",
"${re:+}",
"${re:N}",
"${repeat:count,string}",
"${rev:xxx}",
"${revscr:xxx}",
"${sec.data.xxx}",
"${split:count,separators,flags,xxx}",
"${split:number,separators,flags,xxx}",
"${split:random,separators,flags,xxx}",
"${split_shell:count,xxx}",
"${split_shell:number,xxx}",
"${split_shell:random,xxx}",
"${translate:xxx}",
"${upper:xxx}",
"${weechat_cache_dir}",
"${weechat_config_dir}",
"${weechat_data_dir}",
"${weechat_runtime_dir}",
"${window}",
"${window.buffer}",
"${window.buffer.xxx}",
NULL,
};
int i;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
for (i = 0; eval_variables[i]; i++)
{
gui_completion_list_add (completion, eval_variables[i],
0, WEECHAT_LIST_POS_SORT);
}
hashtable_map (completion->buffer->local_variables,
&completion_list_map_eval_buffer_local_variable_cb,
completion);
return WEECHAT_RC_OK;
}
/*
* Adds hooks for completions done by WeeChat core.
*/
@@ -2026,6 +2209,9 @@ completion_init ()
hook_completion (NULL, "buffer_properties_set",
N_("properties that can be set on a buffer"),
&completion_list_add_buffer_properties_set_cb, NULL, NULL);
hook_completion (NULL, "buffer_properties_setauto",
N_("properties that can be automatically set on a buffer"),
&completion_list_add_buffer_properties_setauto_cb, NULL, NULL);
hook_completion (NULL, "buffer_properties_get",
N_("properties that can be read on a buffer"),
&completion_list_add_buffer_properties_get_cb, NULL, NULL);
@@ -2142,4 +2328,7 @@ completion_init ()
hook_completion (NULL, "env_value",
N_("value of an environment variable"),
&completion_list_add_env_value_cb, NULL, NULL);
hook_completion (NULL, "eval_variables",
N_("variables that can be used in /eval command"),
&completion_list_add_eval_variables_cb, NULL, NULL);
}
+105 -5
View File
@@ -37,6 +37,7 @@
#include "wee-config-file.h"
#include "wee-arraylist.h"
#include "wee-config.h"
#include "wee-dir.h"
#include "wee-hashtable.h"
#include "wee-hdata.h"
#include "wee-hook.h"
@@ -3254,6 +3255,10 @@ config_file_parse_version (const char *version)
long number;
char *error;
if (!version)
return -1;
error = NULL;
number = strtoll (version, &error, 10);
if (!error || error[0])
return -1;
@@ -3261,6 +3266,66 @@ config_file_parse_version (const char *version)
return (number < 1) ? -1 : (int)number;
}
/*
* Backups a configuration file if its version is unsupported and cannot be
* loaded.
*/
void
config_file_backup (const char *filename)
{
char *filename_backup, str_time[32], str_index[32];
int length, index;
struct tm *local_time;
time_t date;
if (!filename)
return;
length = strlen (filename) + 128;
filename_backup = malloc (length);
if (!filename_backup)
return;
date = time (NULL);
local_time = localtime (&date);
if (strftime (str_time, sizeof (str_time), ".%Y%m%d.%H%M%S", local_time) == 0)
str_time[0] = '\0';
index = 1;
while (1)
{
if (index == 1)
str_index[0] = '\0';
else
snprintf (str_index, sizeof (str_index), ".%d", index);
snprintf (filename_backup, length,
"%s.backup%s%s",
filename, str_time, str_index);
if (access (filename_backup, F_OK) != 0)
break;
index++;
}
if (dir_file_copy (filename, filename_backup))
{
gui_chat_printf (NULL,
_("%sFile %s has been backed up as %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
filename, filename_backup);
}
else
{
gui_chat_printf (NULL,
_("%sError: unable to backup file %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
filename);
}
free (filename_backup);
}
/*
* Updates data read from config file: either section or option + value.
* The update callback (if defined in config) is called if the config version
@@ -3273,16 +3338,22 @@ config_file_parse_version (const char *version)
*
* Section can be updated only if option and value are NULL (ie if we are
* reading a section line like "[section]").
*
* Integer warning_update_displayed is set to 1 if a warning is displayed,
* when the file is updated to a newer version (then it's not compatible any
* more with previous versions).
*/
void
config_file_update_data_read (struct t_config_file *config_file,
const char *filename,
const char *section,
const char *option,
const char *value,
char **ret_section,
char **ret_option,
char **ret_value)
char **ret_value,
int *warning_update_displayed)
{
struct t_hashtable *data_read, *hashtable;
const char *ptr_section, *ptr_option, *ptr_value;
@@ -3292,6 +3363,21 @@ config_file_update_data_read (struct t_config_file *config_file,
if (config_file->version_read >= config_file->version)
return;
if (!*warning_update_displayed
&& (config_file->version_read < config_file->version))
{
gui_chat_printf (
NULL,
_("%sImportant: file %s has been updated from version %d to %d, "
"it is not compatible and can not be loaded any more with any "
"older version"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
filename,
config_file->version_read,
config_file->version);
*warning_update_displayed = 1;
}
/* do nothing if there's no update callback */
if (!config_file->callback_update)
return;
@@ -3389,6 +3475,7 @@ int
config_file_read_internal (struct t_config_file *config_file, int reload)
{
int filename_length, line_number, rc, length, version;
int warning_update_displayed;
char *filename, *section, *option, *value;
struct t_config_section *ptr_section;
struct t_config_option *ptr_option;
@@ -3398,6 +3485,7 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
return WEECHAT_CONFIG_READ_FILE_NOT_FOUND;
config_file->version_read = 1;
warning_update_displayed = 0;
/* build filename */
filename_length = strlen (weechat_config_dir) + strlen (DIR_SEPARATOR) +
@@ -3496,9 +3584,10 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
section = string_strndup (ptr_line + 1, pos - ptr_line - 1);
if (section)
{
config_file_update_data_read (config_file,
config_file_update_data_read (config_file, filename,
section, NULL, NULL,
&section, NULL, NULL);
&section, NULL, NULL,
&warning_update_displayed);
ptr_section = config_file_search_section (config_file,
section);
if (!ptr_section)
@@ -3581,6 +3670,11 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
filename, line_number,
line);
config_file_backup (filename);
if (option)
free (option);
if (value)
free (value);
goto end_file;
}
else
@@ -3597,6 +3691,11 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
filename,
config_file->version_read,
config_file->version);
config_file_backup (filename);
if (option)
free (option);
if (value)
free (value);
goto end_file;
}
}
@@ -3614,9 +3713,10 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
goto end_line;
}
config_file_update_data_read (config_file,
config_file_update_data_read (config_file, filename,
ptr_section->name, option, value,
NULL, &option, &value);
NULL, &option, &value,
&warning_update_displayed);
/* option has been ignored by the update callback? */
if (!option || !option[0])
+200 -13
View File
@@ -36,6 +36,7 @@
#include <regex.h>
#include "weechat.h"
#include "wee-arraylist.h"
#include "wee-config.h"
#include "wee-eval.h"
#include "wee-hashtable.h"
@@ -43,10 +44,10 @@
#include "wee-log.h"
#include "wee-network.h"
#include "wee-utf8.h"
#include "wee-util.h"
#include "wee-list.h"
#include "wee-proxy.h"
#include "wee-string.h"
#include "wee-sys.h"
#include "wee-version.h"
#include "../gui/gui-bar.h"
#include "../gui/gui-bar-item.h"
@@ -84,6 +85,7 @@ struct t_config_section *weechat_config_section_signal = NULL;
struct t_config_section *weechat_config_section_bar = NULL;
struct t_config_section *weechat_config_section_custom_bar_item = NULL;
struct t_config_section *weechat_config_section_layout = NULL;
struct t_config_section *weechat_config_section_buffer = NULL;
struct t_config_section *weechat_config_section_notify = NULL;
struct t_config_section *weechat_config_section_filter = NULL;
struct t_config_section *weechat_config_section_key[GUI_KEY_NUM_CONTEXTS] = {
@@ -380,7 +382,7 @@ config_change_sys_rlimit (const void *pointer, void *data,
(void) option;
if (gui_init_ok)
util_setrlimit ();
sys_setrlimit ();
}
/*
@@ -1480,7 +1482,7 @@ config_weechat_init_after_read ()
{
int context;
util_setrlimit ();
sys_setrlimit ();
gui_buffer_notify_set_all ();
@@ -2195,17 +2197,20 @@ config_weechat_custom_bar_item_read_cb (const void *pointer, void *data,
if (!ptr_temp_item)
{
/* create new temporary custom bar item */
ptr_temp_item = gui_bar_item_custom_alloc (item_name);
if (ptr_temp_item)
if (gui_bar_item_search_default (item_name) < 0)
{
/* add new custom bar item at the end */
ptr_temp_item->prev_item = last_gui_temp_custom_bar_item;
ptr_temp_item->next_item = NULL;
if (last_gui_temp_custom_bar_item)
last_gui_temp_custom_bar_item->next_item = ptr_temp_item;
else
gui_temp_custom_bar_items = ptr_temp_item;
last_gui_temp_custom_bar_item = ptr_temp_item;
ptr_temp_item = gui_bar_item_custom_alloc (item_name);
if (ptr_temp_item)
{
/* add new custom bar item at the end */
ptr_temp_item->prev_item = last_gui_temp_custom_bar_item;
ptr_temp_item->next_item = NULL;
if (last_gui_temp_custom_bar_item)
last_gui_temp_custom_bar_item->next_item = ptr_temp_item;
else
gui_temp_custom_bar_items = ptr_temp_item;
last_gui_temp_custom_bar_item = ptr_temp_item;
}
}
}
@@ -2226,6 +2231,13 @@ config_weechat_custom_bar_item_read_cb (const void *pointer, void *data,
section->name, option_name, value);
}
}
else
{
gui_chat_printf (NULL,
_("%sUnable to add custom bar item \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
item_name);
}
free (item_name);
@@ -2466,6 +2478,171 @@ config_weechat_layout_write_cb (const void *pointer, void *data,
return WEECHAT_CONFIG_WRITE_OK;
}
/*
* Applies a buffer option to all matching buffers.
*/
void
config_weechat_buffer_apply_option (struct t_config_option *option)
{
struct t_arraylist *all_buffers;
struct t_gui_buffer *ptr_buffer;
int i, list_size;
if (!option)
return;
all_buffers = arraylist_new (gui_buffers_count, 0, 0,
NULL, NULL, NULL, NULL);
if (!all_buffers)
return;
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
arraylist_add (all_buffers, ptr_buffer);
}
list_size = arraylist_size (all_buffers);
for (i = 0; i < list_size; i++)
{
ptr_buffer = (struct t_gui_buffer *)arraylist_get (all_buffers, i);
if (gui_buffer_valid (ptr_buffer))
gui_buffer_apply_config_option_property (ptr_buffer, option);
}
arraylist_free (all_buffers);
}
/*
* Callback for changes on a buffer option.
*/
void
config_weechat_buffer_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
(void) pointer;
(void) data;
config_weechat_buffer_apply_option (option);
}
/*
* Callback called when an option is created in section "buffer".
*/
int
config_weechat_buffer_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
struct t_config_option *ptr_option;
const char *pos;
char *buffer_mask, description[4096];
int rc;
/* make C compiler happy */
(void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
if (!option_name)
return rc;
ptr_option = config_file_search_option (config_file, section,
option_name);
if (ptr_option)
{
rc = config_file_option_set (ptr_option, value, 1);
}
else
{
pos = strrchr (option_name, '.');
if (pos)
{
buffer_mask = strndup (option_name, pos - option_name);
if (buffer_mask)
{
snprintf (description, sizeof (description),
_("set property \"%s\" on any buffer matching "
"mask \"%s\"; "
"content is evaluated (see /help eval) for all "
"properties except \"key_bind_xxx\" and "
"\"key_unbind_xxx\"; when evaluation is done, "
"${buffer} is a pointer to the buffer being opened, "
"${property} is the name of the property being set"),
pos + 1,
buffer_mask);
ptr_option = config_file_new_option (
config_file, section,
option_name, "string",
description,
"",
0, 0, "", value, 0,
NULL, NULL, NULL,
&config_weechat_buffer_change_cb, NULL, NULL,
NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
free (buffer_mask);
}
}
}
if (ptr_option)
config_weechat_buffer_apply_option (ptr_option);
return rc;
}
/*
* Sets a buffer property.
*
* Returns:
* 1: OK
* 0: error
*/
int
config_weechat_buffer_set (struct t_gui_buffer *buffer,
const char *property, const char *value)
{
char option_name[4096];
int rc;
if (!buffer || !property || !property[0])
return 0;
snprintf (option_name, sizeof (option_name),
"%s.%s",
buffer->full_name,
property);
/* create/update option */
rc = config_weechat_buffer_create_option_cb (
NULL, NULL,
weechat_config_file,
weechat_config_section_buffer,
option_name,
(value) ? value : "");
if (rc != WEECHAT_CONFIG_OPTION_SET_ERROR)
{
gui_chat_printf (
NULL,
_("Option \"weechat.buffer.%s\" has been set to \"%s\""),
option_name,
(value) ? value : "");
}
return (rc != WEECHAT_CONFIG_OPTION_SET_ERROR) ? 1 : 0;
}
/*
* Callback for changes on a notify option.
*/
@@ -4982,6 +5159,16 @@ config_weechat_init_options ()
NULL, NULL, NULL,
NULL, NULL, NULL);
/* buffer */
weechat_config_section_buffer = config_file_new_section (
weechat_config_file, "buffer",
1, 1,
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
&config_weechat_buffer_create_option_cb, NULL, NULL,
NULL, NULL, NULL);
/* notify */
weechat_config_section_notify = config_file_new_section (
weechat_config_file, "notify",
+3
View File
@@ -142,6 +142,7 @@ extern struct t_config_section *weechat_config_section_signal;
extern struct t_config_section *weechat_config_section_bar;
extern struct t_config_section *weechat_config_section_custom_bar_item;
extern struct t_config_section *weechat_config_section_layout;
extern struct t_config_section *weechat_config_section_buffer;
extern struct t_config_section *weechat_config_section_notify;
extern struct t_config_section *weechat_config_section_filter;
extern struct t_config_section *weechat_config_section_key[];
@@ -400,6 +401,8 @@ extern struct t_config_option *config_weechat_debug_get (const char *plugin_name
extern int config_weechat_debug_set (const char *plugin_name,
const char *value);
extern void config_weechat_debug_set_all ();
extern int config_weechat_buffer_set (struct t_gui_buffer *buffer,
const char *property, const char *value);
extern int config_weechat_notify_set (struct t_gui_buffer *buffer,
const char *notify);
extern void config_get_item_time (char *text_time, int max_length);
+145 -37
View File
@@ -42,9 +42,29 @@ char *weecrypto_hash_algo_string[] = {
"crc32",
"md5",
"sha1",
"sha224", "sha256", "sha384", "sha512",
"sha224",
"sha256",
"sha384",
"sha512",
#if GCRYPT_VERSION_NUMBER >= 0x010700
"sha3-224", "sha3-256", "sha3-384", "sha3-512",
"sha3-224",
"sha3-256",
"sha3-384",
"sha3-512",
#endif
#if GCRYPT_VERSION_NUMBER >= 0x010800
"blake2b-160",
"blake2b-256",
"blake2b-384",
"blake2b-512",
"blake2s-128",
"blake2s-160",
"blake2s-224",
"blake2s-256",
#endif
#if GCRYPT_VERSION_NUMBER >= 0x010904
"sha512-224",
"sha512-256",
#endif
NULL,
};
@@ -52,10 +72,42 @@ int weecrypto_hash_algo[] = {
GCRY_MD_CRC32,
GCRY_MD_MD5,
GCRY_MD_SHA1,
GCRY_MD_SHA224, GCRY_MD_SHA256, GCRY_MD_SHA384, GCRY_MD_SHA512,
GCRY_MD_SHA224,
GCRY_MD_SHA256,
GCRY_MD_SHA384,
GCRY_MD_SHA512,
#if GCRYPT_VERSION_NUMBER >= 0x010700
GCRY_MD_SHA3_224, GCRY_MD_SHA3_256, GCRY_MD_SHA3_384, GCRY_MD_SHA3_512,
GCRY_MD_SHA3_224,
GCRY_MD_SHA3_256,
GCRY_MD_SHA3_384,
GCRY_MD_SHA3_512,
#endif
#if GCRYPT_VERSION_NUMBER >= 0x010800
GCRY_MD_BLAKE2B_160,
GCRY_MD_BLAKE2B_256,
GCRY_MD_BLAKE2B_384,
GCRY_MD_BLAKE2B_512,
GCRY_MD_BLAKE2S_128,
GCRY_MD_BLAKE2S_160,
GCRY_MD_BLAKE2S_224,
GCRY_MD_BLAKE2S_256,
#endif
#if GCRYPT_VERSION_NUMBER >= 0x010904
GCRY_MD_SHA512_224,
GCRY_MD_SHA512_256,
#endif
};
char *weecrypto_cipher_string[] = {
"aes128",
"aes192",
"aes256",
NULL,
};
int weecrypto_cipher[] = {
GCRY_CIPHER_AES128,
GCRY_CIPHER_AES192,
GCRY_CIPHER_AES256,
};
@@ -80,22 +132,53 @@ weecrypto_get_hash_algo (const char *hash_algo)
return GCRY_MD_NONE;
}
/*
* Returns the cipher with the name, or GCRY_CIPHER_NONE if not found.
*/
int
weecrypto_get_cipher (const char *cipher)
{
int i;
if (!cipher)
return GCRY_CIPHER_NONE;
for (i = 0; weecrypto_cipher_string[i]; i++)
{
if (strcmp (weecrypto_cipher_string[i], cipher) == 0)
return weecrypto_cipher[i];
}
return GCRY_CIPHER_NONE;
}
/*
* Computes hash of data using the given hash algorithm.
*
* The hash size depends on the algorithm, common ones are:
*
* GCRY_MD_CRC32 32 bits == 4 bytes
* GCRY_MD_MD5 128 bits == 16 bytes
* GCRY_MD_SHA1 160 bits == 20 bytes
* GCRY_MD_SHA224 224 bits == 28 bytes
* GCRY_MD_SHA256 256 bits == 32 bytes
* GCRY_MD_SHA384 384 bits == 48 bytes
* GCRY_MD_SHA512 512 bits == 64 bytes
* GCRY_MD_SHA3_224 224 bits == 28 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_256 256 bits == 32 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_384 384 bits == 48 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_512 512 bits == 64 bytes (libgcrypt 1.7.0)
* GCRY_MD_CRC32 32 bits == 4 bytes
* GCRY_MD_MD5 128 bits == 16 bytes
* GCRY_MD_SHA1 160 bits == 20 bytes
* GCRY_MD_SHA224 224 bits == 28 bytes
* GCRY_MD_SHA256 256 bits == 32 bytes
* GCRY_MD_SHA384 384 bits == 48 bytes
* GCRY_MD_SHA512 512 bits == 64 bytes
* GCRY_MD_SHA512_256 256 bits == 32 bytes (libgcrypt 1.9.4)
* GCRY_MD_SHA512_224 224 bits == 28 bytes (libgcrypt 1.9.4)
* GCRY_MD_SHA3_224 224 bits == 28 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_256 256 bits == 32 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_384 384 bits == 48 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_512 512 bits == 64 bytes (libgcrypt 1.7.0)
* GCRY_MD_BLAKE2B_160 160 bits == 20 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_256 256 bits == 32 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_384 384 bits == 48 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_512 512 bits == 64 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_128 128 bits == 16 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_160 160 bits == 20 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_224 224 bits == 28 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_256 256 bits == 32 bytes (libgcrypt 1.8.0)
*
* The result hash is stored in "hash" (the buffer must be large enough).
*
@@ -165,17 +248,27 @@ hash_end:
*
* The hash size depends on the algorithm, common ones are:
*
* GCRY_MD_CRC32 32 bits == 4 bytes
* GCRY_MD_MD5 128 bits == 16 bytes
* GCRY_MD_SHA1 160 bits == 20 bytes
* GCRY_MD_SHA224 224 bits == 28 bytes
* GCRY_MD_SHA256 256 bits == 32 bytes
* GCRY_MD_SHA384 384 bits == 48 bytes
* GCRY_MD_SHA512 512 bits == 64 bytes
* GCRY_MD_SHA3_224 224 bits == 28 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_256 256 bits == 32 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_384 384 bits == 48 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_512 512 bits == 64 bytes (libgcrypt 1.7.0)
* GCRY_MD_CRC32 32 bits == 4 bytes
* GCRY_MD_MD5 128 bits == 16 bytes
* GCRY_MD_SHA1 160 bits == 20 bytes
* GCRY_MD_SHA224 224 bits == 28 bytes
* GCRY_MD_SHA256 256 bits == 32 bytes
* GCRY_MD_SHA384 384 bits == 48 bytes
* GCRY_MD_SHA512 512 bits == 64 bytes
* GCRY_MD_SHA512_224 224 bits == 28 bytes (libgcrypt 1.9.4)
* GCRY_MD_SHA512_256 256 bits == 32 bytes (libgcrypt 1.9.4)
* GCRY_MD_SHA3_224 224 bits == 28 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_256 256 bits == 32 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_384 384 bits == 48 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_512 512 bits == 64 bytes (libgcrypt 1.7.0)
* GCRY_MD_BLAKE2B_160 160 bits == 20 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_256 256 bits == 32 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_384 384 bits == 48 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_512 512 bits == 64 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_128 128 bits == 16 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_160 160 bits == 20 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_224 224 bits == 28 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_256 256 bits == 32 bytes (libgcrypt 1.8.0)
*
* The result hash is stored in "hash" (the buffer must be large enough).
*
@@ -322,17 +415,27 @@ hash_pbkdf2_end:
*
* The hash size depends on the algorithm, common ones are:
*
* GCRY_MD_CRC32 32 bits == 4 bytes
* GCRY_MD_MD5 128 bits == 16 bytes
* GCRY_MD_SHA1 160 bits == 20 bytes
* GCRY_MD_SHA224 224 bits == 28 bytes
* GCRY_MD_SHA256 256 bits == 32 bytes
* GCRY_MD_SHA384 384 bits == 48 bytes
* GCRY_MD_SHA512 512 bits == 64 bytes
* GCRY_MD_SHA3_224 224 bits == 28 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_256 256 bits == 32 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_384 384 bits == 48 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_512 512 bits == 64 bytes (libgcrypt 1.7.0)
* GCRY_MD_CRC32 32 bits == 4 bytes
* GCRY_MD_MD5 128 bits == 16 bytes
* GCRY_MD_SHA1 160 bits == 20 bytes
* GCRY_MD_SHA224 224 bits == 28 bytes
* GCRY_MD_SHA256 256 bits == 32 bytes
* GCRY_MD_SHA384 384 bits == 48 bytes
* GCRY_MD_SHA512 512 bits == 64 bytes
* GCRY_MD_SHA512_224 224 bits == 28 bytes (libgcrypt 1.9.4)
* GCRY_MD_SHA512_256 256 bits == 32 bytes (libgcrypt 1.9.4)
* GCRY_MD_SHA3_224 224 bits == 28 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_256 256 bits == 32 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_384 384 bits == 48 bytes (libgcrypt 1.7.0)
* GCRY_MD_SHA3_512 512 bits == 64 bytes (libgcrypt 1.7.0)
* GCRY_MD_BLAKE2B_160 160 bits == 20 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_256 256 bits == 32 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_384 384 bits == 48 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2B_512 512 bits == 64 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_128 128 bits == 16 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_160 160 bits == 20 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_224 224 bits == 28 bytes (libgcrypt 1.8.0)
* GCRY_MD_BLAKE2S_256 256 bits == 32 bytes (libgcrypt 1.8.0)
*
* The result hash is stored in "hash" (the buffer must be large enough).
*
@@ -421,6 +524,10 @@ weecrypto_totp_generate_internal (const char *secret, int length_secret,
int rc, offset, length;
unsigned long bin_code;
#if __BYTE_ORDER == __BIG_ENDIAN
/* Big endian does not need to swap bytes here! */
moving_factor_swapped = moving_factor;
#else
moving_factor_swapped = (moving_factor >> 56)
| ((moving_factor << 40) & 0x00FF000000000000)
| ((moving_factor << 24) & 0x0000FF0000000000)
@@ -429,6 +536,7 @@ weecrypto_totp_generate_internal (const char *secret, int length_secret,
| ((moving_factor >> 24) & 0x0000000000FF0000)
| ((moving_factor >> 40) & 0x000000000000FF00)
| (moving_factor << 56);
#endif
rc = weecrypto_hmac (secret, length_secret,
&moving_factor_swapped, sizeof (moving_factor_swapped),
+1
View File
@@ -24,6 +24,7 @@
#define WEECRYPTO_TOTP_MAX_DIGITS 10
extern int weecrypto_get_hash_algo (const char *hash_algo);
extern int weecrypto_get_cipher (const char *cipher);
extern int weecrypto_hash (const void *data, int data_size, int hash_algo,
void *hash, int *hash_size);
extern int weecrypto_hash_file (const char *filename, int hash_algo,
+17 -10
View File
@@ -33,7 +33,9 @@
#include <gcrypt.h>
#include <curl/curl.h>
#include <zlib.h>
#ifdef HAVE_ZSTD
#include <zstd.h>
#endif
#include <gnutls/gnutls.h>
@@ -67,6 +69,9 @@
int debug_dump_active = 0;
long long debug_long_callbacks = 0; /* callbacks taking more than */
/* N microseconds will be traced */
/*
* Writes dump of data to WeeChat log file.
@@ -680,11 +685,13 @@ debug_libs_cb (const void *pointer, void *data,
gui_chat_printf (NULL, " zlib: (?)");
#endif /* ZLIB_VERSION */
#ifdef HAVE_ZSTD
/* display zstd version */
gui_chat_printf (NULL, " zstd: %d.%d.%d",
ZSTD_VERSION_MAJOR,
ZSTD_VERSION_MINOR,
ZSTD_VERSION_RELEASE);
#endif /* HAVE_ZSTD */
return WEECHAT_RC_OK;
}
@@ -736,29 +743,29 @@ debug_display_time_elapsed (struct timeval *time1, struct timeval *time2,
const char *message, int display)
{
struct timeval debug_timeval_end;
long long diff, diff_hour, diff_min, diff_sec, diff_usec;
char *str_diff;
long long diff;
gettimeofday (&debug_timeval_end, NULL);
diff = util_timeval_diff (time1, time2);
diff_usec = diff % 1000000;
diff_sec = (diff / 1000000) % 60;
diff_min = ((diff / 1000000) / 60) % 60;
diff_hour = (diff / 1000000) / 3600;
str_diff = util_get_microseconds_string (diff);
if (display)
{
gui_chat_printf (NULL,
"debug: time[%s] -> %lld:%02lld:%02lld.%06lld",
"debug: time[%s] -> %s",
(message) ? message : "?",
diff_hour, diff_min, diff_sec, diff_usec);
(str_diff) ? str_diff : "?");
}
else
{
log_printf ("debug: time[%s] -> %lld:%02lld:%02lld.%06lld",
log_printf ("debug: time[%s] -> %s",
(message) ? message : "?",
diff_hour, diff_min, diff_sec, diff_usec);
(str_diff) ? str_diff : "?");
}
if (str_diff)
free (str_diff);
}
/*
+2
View File
@@ -24,6 +24,8 @@
struct t_gui_window_tree;
extern long long debug_long_callbacks;
extern void debug_sigsegv_cb ();
extern void debug_windows_tree ();
extern void debug_memory ();
+28 -6
View File
@@ -45,7 +45,9 @@
#include <dirent.h>
#include <ftw.h>
#include <zlib.h>
#ifdef HAVE_ZSTD
#include <zstd.h>
#endif
#include "weechat.h"
#include "wee-config.h"
@@ -440,6 +442,9 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir,
*runtime_dir = NULL;
ptr_home = getenv ("HOME");
if (!ptr_home)
goto error_home;
xdg_config_home = getenv ("XDG_CONFIG_HOME");
xdg_data_home = getenv ("XDG_DATA_HOME");
xdg_cache_home = getenv ("XDG_CACHE_HOME");
@@ -460,7 +465,7 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir,
}
*config_dir = strdup (path);
if (!*config_dir)
goto error;
goto error_memory;
/* set data dir: $XDG_DATA_HOME/weechat or $HOME/.local/share/weechat */
if (xdg_data_home && xdg_data_home[0])
@@ -478,7 +483,7 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir,
}
*data_dir = strdup (path);
if (!*data_dir)
goto error;
goto error_memory;
/* set cache dir: $XDG_CACHE_HOME/weechat or $HOME/.cache/weechat */
if (xdg_cache_home && xdg_cache_home[0])
@@ -495,7 +500,7 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir,
}
*cache_dir = strdup (path);
if (!*cache_dir)
goto error;
goto error_memory;
/* set runtime dir: $XDG_RUNTIME_DIR/weechat or same as cache dir */
if (xdg_runtime_dir && xdg_runtime_dir[0])
@@ -510,10 +515,19 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir,
*runtime_dir = strdup (*cache_dir);
}
if (!*runtime_dir)
goto error;
goto error_memory;
return 1;
error_home:
string_fprintf (stderr,
_("Error: environment variable \"HOME\" is not defined\n"));
goto error;
error_memory:
string_fprintf (stderr, _("Error: not enough memory\n"));
goto error;
error:
if (*config_dir)
{
@@ -535,7 +549,6 @@ error:
free (*runtime_dir);
*runtime_dir = NULL;
}
string_fprintf (stderr, _("Error: not enough memory\n"));
return 0;
}
@@ -1135,6 +1148,7 @@ int
dir_file_compress_zstd (const char *from, const char *to,
int compression_level)
{
#ifdef HAVE_ZSTD
FILE *source, *dest;
void *buffer_in, *buffer_out;
size_t buffer_in_size, buffer_out_size, num_read, remaining;
@@ -1297,6 +1311,14 @@ end:
fclose (dest);
return rc;
#else
/* make C compiler happy */
(void) from;
(void) to;
(void) compression_level;
return 0;
#endif /* HAVE_ZSTD */
}
/*
@@ -1306,7 +1328,7 @@ end:
*
* Supported values for parameter "compressor":
* - "gzip": gzip compression (via zlib)
* - "zstd": zstandard compression
* - "zstd": zstandard compression (it must be enabled at build time)
*
* Parameter "compression_level" is the compression level as percentage:
* from 1 (fast, low compression) to 100 (slow, best compression).
+10 -5
View File
@@ -317,7 +317,7 @@ doc_gen_user_commands (const char *path, const char *lang)
HOOK_COMMAND(ptr_hook, command),
TRANS(HOOK_COMMAND(ptr_hook, description)));
length = 1 + utf8_strlen (HOOK_COMMAND(ptr_hook, command)) + 2;
length = 1 + utf8_strlen_screen (HOOK_COMMAND(ptr_hook, command)) + 2;
snprintf (format, sizeof (format), "%%-%ds%%s\n", length);
ptr_args = TRANS(HOOK_COMMAND(ptr_hook, args));
first_line = 1;
@@ -598,10 +598,13 @@ doc_gen_user_options (const char *path, const char *lang)
free (default_value);
}
string_fprintf (
file,
"// end::%s_options[]\n",
old_config->name);
if (old_config)
{
string_fprintf (
file,
"// end::%s_options[]\n",
old_config->name);
}
arraylist_free (list_options);
@@ -1658,9 +1661,11 @@ doc_generate (const char *path)
* (this is used to generate documentation without installing WeeChat,
* that means no need to run `make install`)
*/
#ifdef ENABLE_NLS
localedir = getenv ("WEECHAT_DOCGEN_LOCALEDIR");
if (localedir && localedir[0])
bindtextdomain (PACKAGE, localedir);
#endif /* ENABLE_NLS */
for (i = 0; locales[i]; i++)
{
+21 -10
View File
@@ -413,6 +413,7 @@ eval_string_cut (const char *text, int screen)
if (!tmp)
return strdup ("");
error = NULL;
number = strtol (tmp, &error, 10);
if (!error || error[0] || (number < 0))
{
@@ -453,6 +454,7 @@ eval_string_repeat (const char *text)
if (!tmp)
return strdup ("");
error = NULL;
number = strtol (tmp, &error, 10);
if (!error || error[0] || (number < 0))
{
@@ -538,6 +540,7 @@ eval_string_split (const char *text)
}
else
{
error = NULL;
number = strtol (str_number, &error, 10);
if (!error || error[0] || (number == 0))
goto end;
@@ -578,6 +581,7 @@ eval_string_split (const char *text)
}
else if (strncmp (list_flags[i], "max_items=", 10) == 0)
{
error = NULL;
max_items = strtol (list_flags[i] + 10, &error, 10);
if (!error || error[0] || (max_items < 0))
goto end;
@@ -686,6 +690,7 @@ eval_string_split_shell (const char *text)
}
else
{
error = NULL;
number = strtol (str_number, &error, 10);
if (!error || error[0] || (number == 0))
goto end;
@@ -766,6 +771,7 @@ eval_string_regex_group (const char *text, struct t_eval_context *eval_context)
}
else
{
error = NULL;
number = strtol (text, &error, 10);
if (!error || error[0])
number = -1;
@@ -897,6 +903,7 @@ eval_string_base_encode (const char *text)
if (!base)
goto end;
error = NULL;
number = strtol (base, &error, 10);
if (!error || error[0])
goto end;
@@ -946,6 +953,7 @@ eval_string_base_decode (const char *text)
if (!base)
goto end;
error = NULL;
number = strtol (base, &error, 10);
if (!error || error[0])
goto end;
@@ -1087,6 +1095,7 @@ eval_string_random (const char *text)
tmp = string_strndup (text, pos - text);
if (!tmp)
goto error;
error = NULL;
min_number = strtoll (tmp, &error, 10);
if (!error || error[0])
{
@@ -1095,6 +1104,7 @@ eval_string_random (const char *text)
}
free (tmp);
error = NULL;
max_number = strtoll (pos + 1, &error, 10);
if (!error || error[0])
goto error;
@@ -1167,7 +1177,7 @@ char *
eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path,
struct t_eval_context *eval_context)
{
char *value, *old_value, *var_name, str_value[128], *pos, *property;
char *value, *var_name, str_value[128], *pos, *property;
const char *ptr_value, *hdata_name, *ptr_var_name, *pos_open_paren;
int type, debug_id;
struct t_hashtable *hashtable;
@@ -1272,7 +1282,8 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path,
property = string_strndup (pos + 1,
pos_open_paren - pos - 1);
ptr_value = hashtable_get_string (hashtable, property);
free (property);
if (property)
free (property);
value = (ptr_value) ? strdup (ptr_value) : NULL;
break;
}
@@ -1326,13 +1337,12 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path,
goto end;
hdata = hook_hdata_get (NULL, hdata_name);
old_value = value;
if (value)
free (value);
value = eval_hdata_get_value (hdata,
pointer,
(pos) ? pos + 1 : NULL,
pos + 1,
eval_context);
if (old_value)
free (old_value);
}
end:
@@ -1463,7 +1473,7 @@ end:
* - a string to evaluate (format: eval:xxx)
* - a condition to evaluate (format: eval_cond:xxx)
* - a string with escaped chars (format: esc:xxx or \xxx)
* - a string with a range of chars (format: chars:xxx)
* - a string with a range of chars (format: chars:range)
* - a string converted to lower case (format: lower:xxx)
* - a string converted to upper case (format: upper:xxx)
* - a string with chars to hide (format: hide:char,string)
@@ -1478,15 +1488,15 @@ end:
* - split string (format: split:number,separators,flags,xxx
* or split:count,separators,flags,xxx
* or split:random,separators,flags,xxx)
* - split shell arguments (format: split:number,xxx or split:count,xxx
* or split:random,xxx)
* - split shell arguments (format: split_shell:number,xxx or
* split_shell:count,xxx or split_shell:random,xxx)
* - a regex group captured (format: re:N (0.99) or re:+)
* - a color (format: color:xxx)
* - a modifier (format: modifier:name,data,xxx)
* - an info (format: info:name,arguments)
* - a base 16/32/64 encoded/decoded string (format: base_encode:base,xxx
* or base_decode:base,xxx)
* - current date/time (format: date or date:xxx)
* - current date/time (format: date or date:format)
* - an environment variable (format: env:XXX)
* - a ternary operator (format: if:condition?value_if_true:value_if_false)
* - calculate result of an expression (format: calc:xxx)
@@ -2616,6 +2626,7 @@ eval_expression (const char *expr, struct t_hashtable *pointers,
ptr_value = hashtable_get (options, "debug");
if (ptr_value && ptr_value[0])
{
error = NULL;
number = strtol (ptr_value, &error, 10);
if (error && !error[0] && (number >= 1))
{
+139 -19
View File
@@ -28,6 +28,7 @@
#include "weechat.h"
#include "wee-hdata.h"
#include "wee-hook.h"
#include "wee-eval.h"
#include "wee-hashtable.h"
#include "wee-log.h"
@@ -955,12 +956,14 @@ int
hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2,
const char *name, int case_sensitive)
{
int rc, int_value1, int_value2;
int rc, type, type1, type2, int_value1, int_value2;
long long_value1, long_value2;
char char_value1, char_value2;
const char *ptr_name, *str_value1, *str_value2;
char *var_name, *property, char_value1, char_value2;
const char *ptr_var_name, *pos, *pos_open_paren, *hdata_name;
const char *str_value1, *str_value2;
void *ptr_value1, *ptr_value2;
time_t time_value1, time_value2;
struct t_hashtable *hashtable1, *hashtable2;
if (!hdata || !name)
return 0;
@@ -973,32 +976,47 @@ hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2,
return 0;
rc = 0;
ptr_value1 = NULL;
ptr_value2 = NULL;
hdata_get_index_and_name (name, NULL, &ptr_name);
switch (hdata_get_var_type (hdata, ptr_name))
pos = strchr (name, '.');
if (pos > name)
var_name = string_strndup (name, pos - name);
else
var_name = strdup (name);
if (!var_name)
goto end;
hdata_get_index_and_name (var_name, NULL, &ptr_var_name);
type = hdata_get_var_type (hdata, ptr_var_name);
if (type < 0)
goto end;
switch (type)
{
case WEECHAT_HDATA_CHAR:
char_value1 = hdata_char (hdata, pointer1, name);
char_value2 = hdata_char (hdata, pointer2, name);
char_value1 = hdata_char (hdata, pointer1, var_name);
char_value2 = hdata_char (hdata, pointer2, var_name);
rc = (char_value1 < char_value2) ?
-1 : ((char_value1 > char_value2) ? 1 : 0);
break;
case WEECHAT_HDATA_INTEGER:
int_value1 = hdata_integer (hdata, pointer1, name);
int_value2 = hdata_integer (hdata, pointer2, name);
int_value1 = hdata_integer (hdata, pointer1, var_name);
int_value2 = hdata_integer (hdata, pointer2, var_name);
rc = (int_value1 < int_value2) ?
-1 : ((int_value1 > int_value2) ? 1 : 0);
break;
case WEECHAT_HDATA_LONG:
long_value1 = hdata_long (hdata, pointer1, name);
long_value2 = hdata_long (hdata, pointer2, name);
long_value1 = hdata_long (hdata, pointer1, var_name);
long_value2 = hdata_long (hdata, pointer2, var_name);
rc = (long_value1 < long_value2) ?
-1 : ((long_value1 > long_value2) ? 1 : 0);
break;
case WEECHAT_HDATA_STRING:
case WEECHAT_HDATA_SHARED_STRING:
str_value1 = hdata_string (hdata, pointer1, name);
str_value2 = hdata_string (hdata, pointer2, name);
str_value1 = hdata_string (hdata, pointer1, var_name);
str_value2 = hdata_string (hdata, pointer2, var_name);
if (!str_value1 && !str_value2)
rc = 0;
else if (str_value1 && !str_value2)
@@ -1018,20 +1036,105 @@ hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2,
}
break;
case WEECHAT_HDATA_POINTER:
ptr_value1 = hdata_pointer (hdata, pointer1, name);
ptr_value2 = hdata_pointer (hdata, pointer2, name);
ptr_value1 = hdata_pointer (hdata, pointer1, var_name);
ptr_value2 = hdata_pointer (hdata, pointer2, var_name);
rc = (ptr_value1 < ptr_value2) ?
-1 : ((ptr_value1 > ptr_value2) ? 1 : 0);
break;
case WEECHAT_HDATA_TIME:
time_value1 = hdata_time (hdata, pointer1, name);
time_value2 = hdata_time (hdata, pointer2, name);
time_value1 = hdata_time (hdata, pointer1, var_name);
time_value2 = hdata_time (hdata, pointer2, var_name);
rc = (time_value1 < time_value2) ?
-1 : ((time_value1 > time_value2) ? 1 : 0);
break;
case WEECHAT_HDATA_HASHTABLE:
/* no comparison for hashtables */
rc = 0;
ptr_value1 = hdata_hashtable (hdata, pointer1, var_name);
ptr_value2 = hdata_hashtable (hdata, pointer2, var_name);
if (pos)
{
/*
* for a hashtable, if there is a "." after name of hdata:
* 1) If "()" is at the end, it is a function call to
* hashtable_get_string().
* 2) Otherwise, get the value for this key in hashtable.
*/
hashtable1 = ptr_value1;
hashtable2 = ptr_value2;
pos_open_paren = strchr (pos, '(');
if (pos_open_paren
&& (pos_open_paren > pos + 1)
&& (pos_open_paren[1] == ')'))
{
property = string_strndup (pos + 1,
pos_open_paren - pos - 1);
ptr_value1 = (void *)hashtable_get_string (hashtable1, property);
ptr_value2 = (void *)hashtable_get_string (hashtable2, property);
if (property)
free (property);
type1 = HASHTABLE_STRING;
type2 = HASHTABLE_STRING;
}
else
{
ptr_value1 = hashtable_get (hashtable1, pos + 1);
ptr_value2 = hashtable_get (hashtable2, pos + 1);
type1 = hashtable1->type_values;
type2 = hashtable2->type_values;
}
if (!ptr_value1 && ptr_value2)
rc = -1;
else if (ptr_value1 && !ptr_value2)
rc = 1;
else if (!ptr_value1 && !ptr_value2)
rc = 0;
else if (type1 != type2)
rc = 0;
else
{
switch (type1)
{
case HASHTABLE_INTEGER:
int_value1 = *((int *)ptr_value1);
int_value2 = *((int *)ptr_value2);
rc = (int_value1 < int_value2) ?
-1 : ((int_value1 > int_value2) ? 1 : 0);
break;
case HASHTABLE_STRING:
if (case_sensitive)
rc = strcmp ((const char *)ptr_value1,
(const char *)ptr_value2);
else
rc = string_strcasecmp ((const char *)ptr_value1,
(const char *)ptr_value2);
if (rc < 0)
rc = -1;
else if (rc > 0)
rc = 1;
break;
case HASHTABLE_POINTER:
case HASHTABLE_BUFFER:
rc = (ptr_value1 < ptr_value2) ?
-1 : ((ptr_value1 > ptr_value2) ? 1 : 0);
break;
case HASHTABLE_TIME:
time_value1 = (long long)(*((time_t *)ptr_value1));
time_value2 = (long long)(*((time_t *)ptr_value2));
rc = (time_value1 < time_value2) ?
-1 : ((time_value1 > time_value2) ? 1 : 0);
break;
case HASHTABLE_NUM_TYPES:
break;
}
}
}
else
{
/* compare hashtables by pointer */
rc = (ptr_value1 < ptr_value2) ?
-1 : ((ptr_value1 > ptr_value2) ? 1 : 0);
}
break;
case WEECHAT_HDATA_OTHER:
/* no comparison for other types */
@@ -1039,6 +1142,23 @@ hdata_compare (struct t_hdata *hdata, void *pointer1, void *pointer2,
break;
}
/*
* if we are on a pointer and that something else is in path (after "."),
* go on with this pointer and remaining path
*/
if ((type == WEECHAT_HDATA_POINTER) && pos)
{
hdata_name = hdata_get_var_hdata (hdata, var_name);
if (!hdata_name)
goto end;
hdata = hook_hdata_get (NULL, hdata_name);
rc = hdata_compare (hdata, ptr_value1, ptr_value2, pos + 1,
case_sensitive);
}
end:
if (var_name)
free (var_name);
return rc;
}
+188 -39
View File
@@ -28,15 +28,18 @@
#include <string.h>
#include <time.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <errno.h>
#include "weechat.h"
#include "wee-debug.h"
#include "wee-hook.h"
#include "wee-hashtable.h"
#include "wee-infolist.h"
#include "wee-log.h"
#include "wee-signal.h"
#include "wee-string.h"
#include "wee-util.h"
#include "../gui/gui-chat.h"
#include "../plugins/plugin.h"
@@ -44,7 +47,7 @@
char *hook_type_string[HOOK_NUM_TYPES] =
{ "command", "command_run", "timer", "fd", "process", "connect", "line",
"print", "signal", "hsignal", "config", "completion", "modifier",
"info", "info_hashtable", "infolist", "hdata", "focus" };
"info", "info_hashtable", "infolist", "hdata", "focus", "url" };
struct t_hook *weechat_hooks[HOOK_NUM_TYPES]; /* list of hooks */
struct t_hook *last_weechat_hook[HOOK_NUM_TYPES]; /* last hook */
int hooks_count[HOOK_NUM_TYPES]; /* number of hooks */
@@ -57,50 +60,98 @@ int hook_socketpair_ok = 0; /* 1 if socketpair() is OK */
/* hook callbacks */
t_callback_hook *hook_callback_add[HOOK_NUM_TYPES] =
{ NULL, NULL, NULL, &hook_fd_add_cb, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
t_callback_hook *hook_callback_remove[HOOK_NUM_TYPES] =
{ NULL, NULL, NULL, &hook_fd_remove_cb, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
t_callback_hook *hook_callback_free_data[HOOK_NUM_TYPES] =
{ &hook_command_free_data, &hook_command_run_free_data,
&hook_timer_free_data, &hook_fd_free_data,
&hook_process_free_data, &hook_connect_free_data,
&hook_line_free_data, &hook_print_free_data,
&hook_signal_free_data, &hook_hsignal_free_data,
&hook_config_free_data, &hook_completion_free_data,
&hook_modifier_free_data, &hook_info_free_data,
&hook_info_hashtable_free_data, &hook_infolist_free_data,
&hook_hdata_free_data, &hook_focus_free_data };
{
&hook_command_free_data,
&hook_command_run_free_data,
&hook_timer_free_data,
&hook_fd_free_data,
&hook_process_free_data,
&hook_connect_free_data,
&hook_line_free_data,
&hook_print_free_data,
&hook_signal_free_data,
&hook_hsignal_free_data,
&hook_config_free_data,
&hook_completion_free_data,
&hook_modifier_free_data,
&hook_info_free_data,
&hook_info_hashtable_free_data,
&hook_infolist_free_data,
&hook_hdata_free_data,
&hook_focus_free_data,
&hook_url_free_data,
};
t_callback_hook_get_desc *hook_callback_get_desc[HOOK_NUM_TYPES] =
{ &hook_command_get_description, &hook_command_run_get_description,
&hook_timer_get_description, &hook_fd_get_description,
&hook_process_get_description, &hook_connect_get_description,
&hook_line_get_description, &hook_print_get_description,
&hook_signal_get_description, &hook_hsignal_get_description,
&hook_config_get_description, &hook_completion_get_description,
&hook_modifier_get_description, &hook_info_get_description,
&hook_info_hashtable_get_description, &hook_infolist_get_description,
&hook_hdata_get_description, &hook_focus_get_description };
{
&hook_command_get_description,
&hook_command_run_get_description,
&hook_timer_get_description,
&hook_fd_get_description,
&hook_process_get_description,
&hook_connect_get_description,
&hook_line_get_description,
&hook_print_get_description,
&hook_signal_get_description,
&hook_hsignal_get_description,
&hook_config_get_description,
&hook_completion_get_description,
&hook_modifier_get_description,
&hook_info_get_description,
&hook_info_hashtable_get_description,
&hook_infolist_get_description,
&hook_hdata_get_description,
&hook_focus_get_description,
&hook_url_get_description,
};
t_callback_hook_infolist *hook_callback_add_to_infolist[HOOK_NUM_TYPES] =
{ &hook_command_add_to_infolist, &hook_command_run_add_to_infolist,
&hook_timer_add_to_infolist, &hook_fd_add_to_infolist,
&hook_process_add_to_infolist, &hook_connect_add_to_infolist,
&hook_line_add_to_infolist, &hook_print_add_to_infolist,
&hook_signal_add_to_infolist, &hook_hsignal_add_to_infolist,
&hook_config_add_to_infolist, &hook_completion_add_to_infolist,
&hook_modifier_add_to_infolist, &hook_info_add_to_infolist,
&hook_info_hashtable_add_to_infolist, &hook_infolist_add_to_infolist,
&hook_hdata_add_to_infolist, &hook_focus_add_to_infolist };
{
&hook_command_add_to_infolist,
&hook_command_run_add_to_infolist,
&hook_timer_add_to_infolist,
&hook_fd_add_to_infolist,
&hook_process_add_to_infolist,
&hook_connect_add_to_infolist,
&hook_line_add_to_infolist,
&hook_print_add_to_infolist,
&hook_signal_add_to_infolist,
&hook_hsignal_add_to_infolist,
&hook_config_add_to_infolist,
&hook_completion_add_to_infolist,
&hook_modifier_add_to_infolist,
&hook_info_add_to_infolist,
&hook_info_hashtable_add_to_infolist,
&hook_infolist_add_to_infolist,
&hook_hdata_add_to_infolist,
&hook_focus_add_to_infolist,
&hook_url_add_to_infolist,
};
t_callback_hook *hook_callback_print_log[HOOK_NUM_TYPES] =
{ &hook_command_print_log, &hook_command_run_print_log,
&hook_timer_print_log, &hook_fd_print_log,
&hook_process_print_log, &hook_connect_print_log,
&hook_line_print_log, &hook_print_print_log,
&hook_signal_print_log, &hook_hsignal_print_log,
&hook_config_print_log, &hook_completion_print_log,
&hook_modifier_print_log, &hook_info_print_log,
&hook_info_hashtable_print_log, &hook_infolist_print_log,
&hook_hdata_print_log, &hook_focus_print_log };
{
&hook_command_print_log,
&hook_command_run_print_log,
&hook_timer_print_log,
&hook_fd_print_log,
&hook_process_print_log,
&hook_connect_print_log,
&hook_line_print_log,
&hook_print_print_log,
&hook_signal_print_log,
&hook_hsignal_print_log,
&hook_config_print_log,
&hook_completion_print_log,
&hook_modifier_print_log,
&hook_info_print_log,
&hook_info_hashtable_print_log,
&hook_infolist_print_log,
&hook_hdata_print_log,
&hook_focus_print_log,
&hook_url_print_log,
};
/*
@@ -426,6 +477,67 @@ hook_exec_end ()
hook_remove_deleted ();
}
/*
* Starts execution of a hook callback.
*/
void
hook_callback_start (struct t_hook *hook, struct t_hook_exec_cb *hook_exec_cb)
{
if (hook->type == HOOK_TYPE_COMMAND)
hook->running++;
else
hook->running = 1;
if (debug_long_callbacks > 0)
{
gettimeofday (&hook_exec_cb->start_time, NULL);
}
else
{
hook_exec_cb->start_time.tv_sec = 0;
hook_exec_cb->start_time.tv_usec = 0;
}
}
/*
* Ends execution of a hook callback.
*/
void
hook_callback_end (struct t_hook *hook, struct t_hook_exec_cb *hook_exec_cb)
{
struct timeval end_time;
long long time_diff;
char *str_diff;
if (hook->type == HOOK_TYPE_COMMAND)
hook->running--;
else
hook->running = 0;
if ((debug_long_callbacks > 0)
&& (hook_exec_cb->start_time.tv_sec > 0))
{
gettimeofday (&end_time, NULL);
time_diff = util_timeval_diff (&hook_exec_cb->start_time, &end_time);
if (time_diff >= debug_long_callbacks)
{
str_diff = util_get_microseconds_string (time_diff);
log_printf (
_("debug: long callback: hook %s (%s), plugin: %s, "
"subplugin: %s, time elapsed: %s"),
hook_type_string[hook->type],
hook_get_description (hook),
plugin_get_name (hook->plugin),
(hook->subplugin) ? hook->subplugin : "-",
str_diff);
if (str_diff)
free (str_diff);
}
}
}
/*
* Returns description of hook.
*
@@ -516,6 +628,43 @@ hook_set (struct t_hook *hook, const char *property, const char *value)
}
}
/*
* Callback used to clean a process (forked processes) by acknowledging its end.
*/
int
hook_timer_clean_process_cb (const void *pointer, void *data,
int remaining_calls)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) remaining_calls;
waitpid (*((pid_t *)data), NULL, WNOHANG);
return WEECHAT_RC_OK;
}
/*
* Schedule a cleanup timer to clean children (forked processes).
*/
void
hook_schedule_clean_process (pid_t pid)
{
pid_t *temp_pid;
/* temp_pid will be freed when the timer is removed */
temp_pid = malloc (sizeof (*temp_pid));
if (temp_pid)
{
*temp_pid = pid;
hook_timer (NULL, 100, 0, 1,
&hook_timer_clean_process_cb, NULL, temp_pid);
}
}
/*
* Unhooks something.
*/
+14
View File
@@ -40,6 +40,7 @@ struct t_hook;
#include "hook/wee-hook-process.h"
#include "hook/wee-hook-signal.h"
#include "hook/wee-hook-timer.h"
#include "hook/wee-hook-url.h"
struct t_gui_bar;
struct t_gui_buffer;
@@ -73,6 +74,7 @@ enum t_hook_type
HOOK_TYPE_INFOLIST, /* get some info as infolist */
HOOK_TYPE_HDATA, /* get hdata pointer */
HOOK_TYPE_FOCUS, /* focus event (mouse/key) */
HOOK_TYPE_URL, /* URL transfer */
/* number of hook types */
HOOK_NUM_TYPES,
};
@@ -110,6 +112,12 @@ struct t_hook
struct t_hook *next_hook; /* link to next hook */
};
struct t_hook_exec_cb
{
struct timeval start_time; /* callback exec star time (to trace */
/* long running callbacks) */
};
/* hook variables */
extern char *hook_type_string[];
@@ -118,6 +126,7 @@ extern struct t_hook *last_weechat_hook[];
extern int hooks_count[];
extern int hooks_count_total;
extern int hook_socketpair_ok;
extern long long hook_debug_long_callbacks;
/* hook functions */
@@ -130,9 +139,14 @@ extern void hook_init_data (struct t_hook *hook,
extern int hook_valid (struct t_hook *hook);
extern void hook_exec_start ();
extern void hook_exec_end ();
extern void hook_callback_start (struct t_hook *hook,
struct t_hook_exec_cb *hook_exec_cb);
extern void hook_callback_end (struct t_hook *hook,
struct t_hook_exec_cb *hook_exec_cb);
extern char *hook_get_description (struct t_hook *hook);
extern void hook_set (struct t_hook *hook, const char *property,
const char *value);
extern void hook_schedule_clean_process (pid_t pid);
extern void unhook (struct t_hook *hook);
extern void unhook_all_plugin (struct t_weechat_plugin *plugin,
const char *subplugin);
+5 -3
View File
@@ -337,11 +337,11 @@ network_is_ip_address (const char *address)
return 0;
/* valid IPv4? */
if (inet_pton (AF_INET, address, &server_addr.sin_addr))
if (inet_pton (AF_INET, address, &server_addr.sin_addr) == 1)
return 1;
/* valid IPv6? */
if (inet_pton (AF_INET6, address, &server_addr6.sin6_addr))
if (inet_pton (AF_INET6, address, &server_addr6.sin6_addr) == 1)
return 1;
/* not a valid IP address */
@@ -554,11 +554,13 @@ network_pass_socks4proxy (struct t_proxy *proxy, int sock, const char *address,
socks4.method = 1;
socks4.port = htons (port);
network_resolve (address, ip_addr, NULL);
socks4.address = inet_addr (ip_addr);
strncpy (socks4.user, username, sizeof (socks4.user) - 1);
free (username);
if (inet_pton (AF_INET, ip_addr, &socks4.address) != 1)
return 0;
length = 8 + strlen (socks4.user) + 1;
if (network_send_with_retry (sock, (char *) &socks4, length, 0) != length)
return 0;
+19 -4
View File
@@ -26,9 +26,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <gcrypt.h>
#include "weechat.h"
#include "wee-config-file.h"
#include "wee-crypto.h"
#include "wee-hashtable.h"
#include "wee-secure.h"
#include "wee-secure-buffer.h"
@@ -85,7 +87,8 @@ secure_buffer_display_data (void *data,
void
secure_buffer_display ()
{
int line, count, count_encrypted;
int line, count, count_encrypted, hash_algo;
char str_supported[1024];
if (!secure_buffer)
return;
@@ -99,10 +102,22 @@ secure_buffer_display ()
line = 0;
str_supported[0] = '\0';
hash_algo = weecrypto_get_hash_algo (
config_file_option_string (secure_config_crypt_hash_algo));
if (hash_algo == GCRY_MD_NONE)
{
snprintf (str_supported, sizeof (str_supported),
" (%s)",
/* TRANSLATORS: "hash algorithm not supported" */
_("not supported"));
}
gui_chat_printf_y (secure_buffer, line++,
"Hash algo: %s Cipher: %s Salt: %s",
secure_hash_algo_string[CONFIG_ENUM(secure_config_crypt_hash_algo)],
secure_cipher_string[CONFIG_ENUM(secure_config_crypt_cipher)],
"Hash algo: %s%s Cipher: %s Salt: %s",
config_file_option_string (secure_config_crypt_hash_algo),
str_supported,
config_file_option_string (secure_config_crypt_cipher),
(CONFIG_BOOLEAN(secure_config_crypt_salt)) ? _("on") : _("off"));
/* display passphrase */
+126 -12
View File
@@ -26,9 +26,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <gcrypt.h>
#include "weechat.h"
#include "wee-config-file.h"
#include "wee-crypto.h"
#include "wee-hashtable.h"
#include "wee-secure.h"
#include "wee-secure-config.h"
@@ -48,6 +50,8 @@ struct t_config_option *secure_config_crypt_hash_algo = NULL;
struct t_config_option *secure_config_crypt_passphrase_command = NULL;
struct t_config_option *secure_config_crypt_salt = NULL;
int secure_config_loading = 0;
/*
* Gets passphrase from user and puts it in variable "secure_passphrase".
@@ -172,6 +176,39 @@ secure_config_reload_cb (const void *pointer, void *data,
return config_file_reload (config_file);
}
/*
* Callback for changes on some options "weechat.crypt.*" (that can not be
* changed if there are encrypted data.
*/
int
secure_config_check_crypt_option_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) value;
/* any value allowed while reading config */
if (secure_config_loading)
return 1;
/* no encrypted data => changes allowed */
if (secure_hashtable_data_encrypted->items_count == 0)
return 1;
gui_chat_printf (NULL,
_("%sOption %s.%s.%s can not be changed because there "
"are still encrypted data"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
option->config_file->name,
option->section->name,
option->name);
return 0;
}
/*
* Reads a data option in secured data configuration file.
*/
@@ -183,7 +220,7 @@ secure_config_data_read_cb (const void *pointer, void *data,
const char *option_name, const char *value)
{
char *buffer, *decrypted, str_error[1024];
int length_buffer, length_decrypted, rc;
int length_buffer, length_decrypted, rc, hash_algo, cipher;
/* make C compiler happy */
(void) pointer;
@@ -237,6 +274,38 @@ secure_config_data_read_cb (const void *pointer, void *data,
return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
}
/* get hash algorithm */
hash_algo = weecrypto_get_hash_algo (
config_file_option_string (secure_config_crypt_hash_algo));
if (hash_algo == GCRY_MD_NONE)
{
gui_chat_printf (
NULL,
_("%sFailed to decrypt data \"%s\": hash algorithm \"%s\" is not "
"available (ligbcrypt version is too old?)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
option_name,
config_file_option_string (secure_config_crypt_hash_algo));
hashtable_set (secure_hashtable_data_encrypted, option_name, value);
return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
}
/* get cipher */
cipher = weecrypto_get_cipher (
config_file_option_string (secure_config_crypt_cipher));
if (cipher == GCRY_CIPHER_NONE)
{
gui_chat_printf (
NULL,
_("%sFailed to decrypt data \"%s\": cipher \"%s\" is not "
"available (ligbcrypt version is too old?)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
option_name,
config_file_option_string (secure_config_crypt_cipher));
hashtable_set (secure_hashtable_data_encrypted, option_name, value);
return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
}
/* decrypt data */
buffer = malloc (strlen (value) + 1);
if (!buffer)
@@ -250,8 +319,8 @@ secure_config_data_read_cb (const void *pointer, void *data,
rc = secure_decrypt_data (
buffer,
length_buffer,
secure_hash_algo[CONFIG_ENUM(secure_config_crypt_hash_algo)],
secure_cipher[CONFIG_ENUM(secure_config_crypt_cipher)],
hash_algo,
cipher,
secure_passphrase,
&decrypted,
&length_decrypted);
@@ -311,13 +380,41 @@ secure_config_data_write_map_cb (void *data,
{
struct t_config_file *config_file;
char *buffer, *buffer_base16;
int length_buffer, rc;
int length_buffer, rc, hash_algo, cipher;
/* make C compiler happy */
(void) hashtable;
config_file = (struct t_config_file *)data;
hash_algo = weecrypto_get_hash_algo (
config_file_option_string (secure_config_crypt_hash_algo));
if (hash_algo == GCRY_MD_NONE)
{
gui_chat_printf (
NULL,
_("%sFailed to encrypt data \"%s\": hash algorithm \"%s\" is not "
"available (ligbcrypt version is too old?)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
key,
config_file_option_string (secure_config_crypt_hash_algo));
return;
}
cipher = weecrypto_get_cipher (
config_file_option_string (secure_config_crypt_cipher));
if (cipher == GCRY_CIPHER_NONE)
{
gui_chat_printf (
NULL,
_("%sFailed to encrypt data \"%s\": cipher \"%s\" is not "
"available (ligbcrypt version is too old?)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
key,
config_file_option_string (secure_config_crypt_cipher));
return;
}
buffer = NULL;
length_buffer = 0;
@@ -326,8 +423,8 @@ secure_config_data_write_map_cb (void *data,
/* encrypt password using passphrase */
rc = secure_encrypt_data (
value, strlen (value) + 1,
secure_hash_algo[CONFIG_ENUM(secure_config_crypt_hash_algo)],
secure_cipher[CONFIG_ENUM(secure_config_crypt_cipher)],
hash_algo,
cipher,
secure_passphrase,
&buffer,
&length_buffer);
@@ -352,7 +449,7 @@ secure_config_data_write_map_cb (void *data,
else
{
gui_chat_printf (NULL,
_("%sError encrypting data \"%s\" (%d)"),
_("%sFailed to encrypt data \"%s\" (%d)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
key, rc);
}
@@ -469,13 +566,26 @@ secure_config_init_options ()
N_("cipher used to crypt data (the number after algorithm is the "
"size of the key in bits)"),
"aes128|aes192|aes256", 0, 0, "aes256", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
&secure_config_check_crypt_option_cb, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL);
secure_config_crypt_hash_algo = config_file_new_option (
secure_config_file, secure_config_section_crypt,
"hash_algo", "enum",
N_("hash algorithm used to check the decrypted data"),
"sha224|sha256|sha384|sha512", 0, 0, "sha256", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
N_("hash algorithm used to check the decrypted data; "
"some of them require a specific libgcrypt version: "
"sha3-*: libgcrypt >= 1.7.0, "
"blake2*: libgcrypt >= 1.8.0, "
"sha512-*: libgcrypt >= 1.9.4"),
"sha224|sha256|sha384|sha512"
"|sha512-224|sha512-256"
"|sha3-224|sha3-256|sha3-384|sha3-512"
"|blake2b-160|blake2b-256|blake2b-384|blake2b-512"
"|blake2s-128|blake2s-160|blake2s-224|blake2s-256",
0, 0, "sha256", NULL, 0,
&secure_config_check_crypt_option_cb, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL);
secure_config_crypt_passphrase_command = config_file_new_option (
secure_config_file, secure_config_section_crypt,
"passphrase_command", "string",
@@ -500,7 +610,9 @@ secure_config_init_options ()
"then you can turn off this option to have always same content "
"in file"),
NULL, 0, 0, "on", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
&secure_config_check_crypt_option_cb, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL);
}
/* data */
@@ -532,7 +644,9 @@ secure_config_read ()
secure_data_encrypted = 0;
secure_config_loading = 1;
rc = config_file_read (secure_config_file);
secure_config_loading = 0;
return rc;
}
+19 -17
View File
@@ -46,17 +46,6 @@ struct t_hashtable *secure_hashtable_data = NULL;
/* data still encrypted (if passphrase not set) */
struct t_hashtable *secure_hashtable_data_encrypted = NULL;
/* hash algorithms */
char *secure_hash_algo_string[] = { "sha224", "sha256", "sha384", "sha512",
NULL };
int secure_hash_algo[] = { GCRY_MD_SHA224, GCRY_MD_SHA256, GCRY_MD_SHA384,
GCRY_MD_SHA512 };
/* ciphers */
char *secure_cipher_string[] = { "aes128", "aes192", "aes256", NULL };
int secure_cipher[] = { GCRY_CIPHER_AES128, GCRY_CIPHER_AES192,
GCRY_CIPHER_AES256 };
char *secure_decrypt_error[] = { "memory", "buffer", "key", "cipher", "setkey",
"decrypt", "hash", "hash mismatch" };
@@ -427,8 +416,10 @@ decrypt_end:
* secured data configuration file (because no passphrase was given).
*
* Returns:
* > 0: number of decrypted data
* 0: error decrypting data
* >= 0: number of decrypted data
* -1: error decrypting data (bad passphrase)
* -2: unsupported hash algorithm
* -3: unsupported cipher
*/
int
@@ -436,11 +427,22 @@ secure_decrypt_data_not_decrypted (const char *passphrase)
{
char **keys, *buffer, *decrypted;
const char *value;
int num_ok, num_keys, i, length_buffer, length_decrypted, rc;
int num_ok, num_keys, i, hash_algo, cipher, rc;
int length_buffer, length_decrypted;
/* we need a passphrase to decrypt data! */
if (!passphrase || !passphrase[0])
return 0;
return -1;
hash_algo = weecrypto_get_hash_algo (
config_file_option_string (secure_config_crypt_hash_algo));
if (hash_algo == GCRY_MD_NONE)
return -2;
cipher = weecrypto_get_cipher (
config_file_option_string (secure_config_crypt_cipher));
if (cipher == GCRY_CIPHER_NONE)
return -3;
num_ok = 0;
@@ -469,8 +471,8 @@ secure_decrypt_data_not_decrypted (const char *passphrase)
rc = secure_decrypt_data (
buffer,
length_buffer,
secure_hash_algo[CONFIG_ENUM(secure_config_crypt_hash_algo)],
secure_cipher[CONFIG_ENUM(secure_config_crypt_cipher)],
hash_algo,
cipher,
passphrase,
&decrypted,
&length_decrypted);
-19
View File
@@ -28,28 +28,9 @@
#define SECURE_DATA_PASSPHRASE_FLAG "__passphrase__"
#define SECURE_SALT_SIZE 8
enum t_secure_config_hash_algo
{
SECURE_CONFIG_HASH_SHA224 = 0,
SECURE_CONFIG_HASH_SHA256,
SECURE_CONFIG_HASH_SHA384,
SECURE_CONFIG_HASH_SHA512,
};
enum t_secure_config_cipher
{
SECURE_CONFIG_CIPHER_AES128 = 0,
SECURE_CONFIG_CIPHER_AES192,
SECURE_CONFIG_CIPHER_AES256,
};
extern char *secure_passphrase;
extern struct t_hashtable *secure_hashtable_data;
extern struct t_hashtable *secure_hashtable_data_encrypted;
extern char *secure_hash_algo_string[];
extern int secure_hash_algo[];
extern char *secure_cipher_string[];
extern int secure_cipher[];
extern int secure_data_encrypted;
extern char *secure_decrypt_error[];
+13
View File
@@ -24,6 +24,7 @@
#endif
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
@@ -37,6 +38,7 @@
#include "wee-log.h"
#include "wee-string.h"
#include "../gui/gui-buffer.h"
#include "../gui/gui-window.h"
#include "../plugins/plugin.h"
@@ -293,6 +295,17 @@ signal_handle ()
signal_sigterm_count = 0;
}
/*
* Suspends WeeChat process.
*/
void
signal_suspend ()
{
kill (getpid (), SIGTSTP);
gui_window_ask_refresh (2);
}
/*
* Initializes signal.
*/
+1
View File
@@ -32,6 +32,7 @@ extern int signal_search_number (int signal_number);
extern int signal_search_name (const char *name);
extern void signal_catch (int signum, void (*handler)(int));
extern void signal_handle ();
extern void signal_suspend ();
extern void signal_init ();
#endif /* WEECHAT_SIGNAL_H */
+65
View File
@@ -394,6 +394,70 @@ string_toupper (const char *string)
return string_dyn_free (result, 0);
}
/*
* Converts string to lower case (using a range of chars).
*
* Note: result must be freed after use.
*/
char *
string_tolower_range (const char *string, int range)
{
char *result, *ptr_result;
if (!string)
return NULL;
if (range <= 0)
return string_tolower (string);
result = strdup (string);
if (!result)
return NULL;
ptr_result = result;
while (ptr_result && ptr_result[0])
{
if ((ptr_result[0] >= 'A') && (ptr_result[0] < 'A' + range))
ptr_result[0] += ('a' - 'A');
ptr_result = (char *)utf8_next_char (ptr_result);
}
return result;
}
/*
* Converts string to upper case (using a range of char).
*
* Note: result must be freed after use.
*/
char *
string_toupper_range (const char *string, int range)
{
char *result, *ptr_result;
if (!string)
return NULL;
if (range <= 0)
return string_toupper (string);
result = strdup (string);
if (!result)
return NULL;
ptr_result = result;
while (ptr_result && ptr_result[0])
{
if ((ptr_result[0] >= 'a') && (ptr_result[0] < 'a' + range))
ptr_result[0] -= ('a' - 'A');
ptr_result = (char *)utf8_next_char (ptr_result);
}
return result;
}
/*
* Compares two chars (case sensitive).
*
@@ -3279,6 +3343,7 @@ string_parse_size (const char *size)
if (!str_number)
goto end;
error = NULL;
number = strtoll (str_number, &error, 10);
if (!error || error[0])
goto end;
+2
View File
@@ -44,6 +44,8 @@ extern char *string_reverse_screen (const char *string);
extern char *string_repeat (const char *string, int count);
extern char *string_tolower (const char *string);
extern char *string_toupper (const char *string);
extern char *string_tolower_range (const char *string, int range);
extern char *string_toupper_range (const char *string, int range);
extern int string_charcmp (const char *string1, const char *string2);
extern int string_charcasecmp (const char *string1, const char *string2);
extern int string_charcasecmp_range (const char *string1, const char *string2,
+362
View File
@@ -0,0 +1,362 @@
/*
* wee-sys.c - system actions
*
* Copyright (C) 2023 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#include <sys/wait.h>
#include "weechat.h"
#include "wee-config.h"
#include "wee-log.h"
#include "wee-string.h"
#include "wee-sys.h"
#include "wee-util.h"
#include "../gui/gui-chat.h"
#include "../gui/gui-window.h"
#include "../plugins/plugin.h"
#ifdef HAVE_SYS_RESOURCE_H
struct t_rlimit_resource rlimit_resource[] =
{
#ifdef RLIMIT_AS
{ "as", RLIMIT_AS },
#endif
#ifdef RLIMIT_CORE
{ "core", RLIMIT_CORE },
#endif
#ifdef RLIMIT_CPU
{ "cpu", RLIMIT_CPU },
#endif
#ifdef RLIMIT_DATA
{ "data", RLIMIT_DATA },
#endif
#ifdef RLIMIT_FSIZE
{ "fsize", RLIMIT_FSIZE },
#endif
#ifdef RLIMIT_LOCKS
{ "locks", RLIMIT_LOCKS },
#endif
#ifdef RLIMIT_MEMLOCK
{ "memlock", RLIMIT_MEMLOCK },
#endif
#ifdef RLIMIT_MSGQUEUE
{ "msgqueue", RLIMIT_MSGQUEUE },
#endif
#ifdef RLIMIT_NICE
{ "nice", RLIMIT_NICE },
#endif
#ifdef RLIMIT_NOFILE
{ "nofile", RLIMIT_NOFILE },
#endif
#ifdef RLIMIT_NPROC
{ "nproc", RLIMIT_NPROC },
#endif
#ifdef RLIMIT_RSS
{ "rss", RLIMIT_RSS },
#endif
#ifdef RLIMIT_RTPRIO
{ "rtprio", RLIMIT_RTPRIO },
#endif
#ifdef RLIMIT_RTTIME
{ "rttime", RLIMIT_RTTIME },
#endif
#ifdef RLIMIT_SIGPENDING
{ "sigpending", RLIMIT_SIGPENDING },
#endif
#ifdef RLIMIT_STACK
{ "stack", RLIMIT_STACK },
#endif
{ NULL, 0 },
};
#endif /* HAVE_SYS_RESOURCE_H */
/*
* Sets resource limit.
*/
#ifdef HAVE_SYS_RESOURCE_H
void
sys_setrlimit_resource (const char *resource_name, long long limit)
{
int i;
struct rlimit rlim;
char str_limit[64];
if (!resource_name)
return;
if (limit == -1)
snprintf (str_limit, sizeof (str_limit), "unlimited");
else
snprintf (str_limit, sizeof (str_limit), "%lld", limit);
for (i = 0; rlimit_resource[i].name; i++)
{
if (strcmp (rlimit_resource[i].name, resource_name) == 0)
{
if (limit < -1)
{
gui_chat_printf (NULL,
_("%sInvalid limit for resource \"%s\": %s "
"(must be >= -1)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
resource_name, str_limit);
return;
}
rlim.rlim_cur = (limit >= 0) ? (rlim_t)limit : RLIM_INFINITY;
rlim.rlim_max = rlim.rlim_cur;
if (setrlimit (rlimit_resource[i].resource, &rlim) == 0)
{
log_printf (_("Limit for resource \"%s\" has been set to %s"),
resource_name, str_limit);
if (gui_init_ok)
{
gui_chat_printf (NULL,
_("Limit for resource \"%s\" has been set "
"to %s"),
resource_name, str_limit);
}
}
else
{
gui_chat_printf (NULL,
_("%sUnable to set resource limit \"%s\" to "
"%s: error %d %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
resource_name,
str_limit,
errno,
strerror (errno));
}
return;
}
}
gui_chat_printf (NULL,
_("%sUnknown resource limit \"%s\" (see /help "
"weechat.startup.sys_rlimit)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
resource_name);
}
#endif /* HAVE_SYS_RESOURCE_H */
/*
* Sets resource limits using value of option "weechat.startup.sys_rlimit".
*/
void
sys_setrlimit ()
{
#ifdef HAVE_SYS_RESOURCE_H
char **items, *pos, *error;
int num_items, i;
long long number;
items = string_split (CONFIG_STRING(config_startup_sys_rlimit), ",", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
0, &num_items);
if (items)
{
for (i = 0; i < num_items; i++)
{
pos = strchr (items[i], ':');
if (pos)
{
pos[0] = '\0';
error = NULL;
number = strtoll (pos + 1, &error, 10);
if (error && !error[0])
{
sys_setrlimit_resource (items[i], number);
}
else
{
gui_chat_printf (NULL,
_("%sInvalid limit for resource \"%s\": "
"%s (must be >= -1)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
items[i], pos + 1);
}
}
}
string_free_split (items);
}
#endif /* HAVE_SYS_RESOURCE_H */
}
/*
* Displays resource limits.
*/
void
sys_display_rlimit ()
{
#ifdef HAVE_SYS_RESOURCE_H
struct rlimit rlim;
char str_cur[128], str_max[128];
int i;
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, _("Resource limits (see \"man getrlimit\" for help):"));
for (i = 0; rlimit_resource[i].name; i++)
{
if (getrlimit (rlimit_resource[i].resource, &rlim) == 0)
{
if (rlim.rlim_cur == RLIM_INFINITY)
{
snprintf (str_cur, sizeof (str_cur), "unlimited");
}
else
{
snprintf (str_cur, sizeof (str_cur),
"%lld", (long long)rlim.rlim_cur);
}
if (rlim.rlim_max == RLIM_INFINITY)
{
snprintf (str_max, sizeof (str_max), "unlimited");
}
else
{
snprintf (str_max, sizeof (str_max),
"%lld", (long long)rlim.rlim_max);
}
gui_chat_printf (NULL,
" %-10s: %s (max: %s)",
rlimit_resource[i].name, str_cur, str_max);
}
else
{
gui_chat_printf (NULL,
_("%sUnable to get resource limit \"%s\": "
"error %d %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
rlimit_resource[i].name,
errno,
strerror (errno));
}
}
#else /* HAVE_SYS_RESOURCE_H */
gui_chat_printf (NULL,
_("System function \"%s\" is not available"),
"getrlimit");
#endif /* HAVE_SYS_RESOURCE_H */
}
/*
* Displays resource usage.
*/
void
sys_display_rusage ()
{
#ifdef HAVE_SYS_RESOURCE_H
struct rusage usage;
char *str_time;
long long microseconds;
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, _("Resource usage (see \"man getrusage\" for help):"));
getrusage (RUSAGE_SELF, &usage);
/* ru_utime: user CPU time used */
microseconds = ((long long)usage.ru_utime.tv_sec * 1000000)
+ (long long)usage.ru_utime.tv_usec;
str_time = util_get_microseconds_string (microseconds);
if (str_time)
{
gui_chat_printf (NULL, " ru_utime : %s", str_time);
free (str_time);
}
/* ru_stime: system CPU time used */
microseconds = ((long long)usage.ru_stime.tv_sec * 1000000)
+ (long long)usage.ru_stime.tv_usec;
str_time = util_get_microseconds_string (microseconds);
if (str_time)
{
gui_chat_printf (NULL, " ru_stime : %s", str_time);
free (str_time);
}
/* ru_maxrss: maximum resident set size */
gui_chat_printf (NULL, " ru_maxrss : %ld", usage.ru_maxrss);
/* ru_ixrss: integral shared memory size */
gui_chat_printf (NULL, " ru_ixrss : %ld", usage.ru_ixrss);
/* ru_idrss: integral unshared data size */
gui_chat_printf (NULL, " ru_idrss : %ld", usage.ru_idrss);
/* ru_isrss: integral unshared stack size */
gui_chat_printf (NULL, " ru_isrss : %ld", usage.ru_isrss);
/* ru_minflt: page reclaims (soft page faults) */
gui_chat_printf (NULL, " ru_minflt : %ld", usage.ru_minflt);
/* ru_majflt: page faults (hard page faults) */
gui_chat_printf (NULL, " ru_majflt : %ld", usage.ru_majflt);
/* ru_nswap: swaps */
gui_chat_printf (NULL, " ru_nswap : %ld", usage.ru_nswap);
/* ru_inblock: block input operations */
gui_chat_printf (NULL, " ru_inblock : %ld", usage.ru_inblock);
/* ru_oublock: block output operations */
gui_chat_printf (NULL, " ru_oublock : %ld", usage.ru_oublock);
/* ru_msgsnd: IPC messages sent */
gui_chat_printf (NULL, " ru_msgsnd : %ld", usage.ru_msgsnd);
/* ru_msgrcv: IPC messages received */
gui_chat_printf (NULL, " ru_msgrcv : %ld", usage.ru_msgrcv);
/* ru_nsignals: signals received */
gui_chat_printf (NULL, " ru_nsignals: %ld", usage.ru_nsignals);
/* ru_nvcsw: voluntary context switches */
gui_chat_printf (NULL, " ru_nvcsw : %ld", usage.ru_nvcsw);
/* ru_nivcsw: involuntary context switches */
gui_chat_printf (NULL, " ru_nivcsw : %ld", usage.ru_nivcsw);
#else /* HAVE_SYS_RESOURCE_H */
gui_chat_printf (NULL,
_("System function \"%s\" is not available"),
"getrusage");
#endif /* HAVE_SYS_RESOURCE_H */
}
/*
* Calls waitpid() to acknowledge the end of forked processes, thus preventing
* them to become zombies.
*/
void
sys_waitpid ()
{
int i;
/* acknowledge the end of up to 42 forked processes */
i = 0;
while ((i < 42) && (waitpid (-1, NULL, WNOHANG) > 0))
{
i++;
}
}
+36
View File
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2023 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef WEECHAT_SYS_H
#define WEECHAT_SYS_H
#ifdef HAVE_SYS_RESOURCE_H
struct t_rlimit_resource
{
char *name; /* name of resource */
int resource; /* value of resource */
};
#endif /* HAVE_SYS_RESOURCE_H */
extern void sys_setrlimit ();
extern void sys_display_rlimit ();
extern void sys_display_rusage ();
extern void sys_waitpid ();
#endif /* WEECHAT_SYS_H */

Some files were not shown because too many files have changed in this diff Show More