1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-17 16:44:47 +02:00

Compare commits

..

27 Commits

Author SHA1 Message Date
Sébastien Helleu e33da6292d Version 4.0.5 2023-09-24 09:30:58 +02:00
Sébastien Helleu be6b27c8f9 core: fix style in ChangeLog 2023-09-24 09:12:21 +02:00
Sébastien Helleu 2d9b133c77 script: only check if return value of plugin_script_search_path is NULL (issue #2019) 2023-09-22 22:59:21 +02:00
Sébastien Helleu 6c36836182 script: fix removal of script in system directory while trying to install a script (issue #2019) 2023-09-22 22:53:29 +02:00
Sébastien Helleu 15214f9538 script: fix autoload of multiple scripts at once with /script autoload (issue #2018) 2023-09-20 20:07:01 +02:00
Sébastien Helleu 7f13bdb51a irc: add option irc.look.open_pv_buffer_echo_msg (issue #2016) 2023-09-14 20:22:43 +02:00
Sébastien Helleu 49bbc53d7c irc: update title in query buffer when remote nick is myself (issue #2016) 2023-09-14 16:16:39 +02:00
Sébastien Helleu eb17fa24ee irc: fix title of query buffer for own messages received (issue #2016) 2023-09-14 15:30:10 +02:00
Sébastien Helleu c7d03668f1 irc: open a query buffer on PRIVMSG received from self nick when capability echo-message is NOT enabled (issue #2016) 2023-09-14 14:54:21 +02:00
Sébastien Helleu 8575546aa2 irc: don't open a new private buffer on /msg command when capability echo-message is enabled (issue #2016) 2023-09-14 11:21:25 +02:00
Sébastien Helleu 2c716e8154 core: move ChangeLog entry to the appropriate version 2023-09-14 11:12:16 +02:00
Sébastien Helleu 49b1cb06b5 irc: fix title of private buffers wrongly set to own address when capability echo-message is enabled (issue #2016) 2023-09-14 08:09:34 +02:00
Sébastien Helleu 75a0755107 core: translate error messages (issue #2013) 2023-09-12 15:12:15 +02:00
Sébastien Helleu 79b03d0680 core: automatically backup config file read if it has an unsupported version (issue #2013) 2023-09-12 15:03:18 +02:00
Sébastien Helleu f43ed913f5 xfer: fix memory leak on plugin unload 2023-09-12 15:03:18 +02:00
Sébastien Helleu 1fcbdb3bd9 doc/api: fix return values for callback_read in config_new_section 2023-09-12 15:03:18 +02:00
Sébastien Helleu 1aab82f20b core: add path in message displayed when a config file is updated to a newer version 2023-09-11 22:50:11 +02:00
Sébastien Helleu 58141bde79 irc: fix autojoin of channels when private buffers are opened (issue #2012) 2023-09-11 21:43:35 +02:00
Sébastien Helleu 7f6e626122 core: display a message when a configuration file is updated to a newer version 2023-09-11 09:33:39 +02:00
Sébastien Helleu 15860532f3 core: fix style for keys in ChangeLog 2023-08-29 12:32:59 +02:00
Sébastien Helleu 8b7513e883 script: fix crash when a /script command triggers another /script command (issue #923) 2023-08-27 17:22:09 +02:00
Sébastien Helleu 2566fca78c irc: use str_nicks only if not NULL in callback of message 353 2023-08-27 17:20:32 +02:00
Trygve Aaberge a82bfa0e7e 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:12:53 +02:00
Sébastien Helleu 48d33521dc irc: add tests on server functions 2023-08-24 09:23:30 +02:00
Sébastien Helleu e3f6dab366 irc: fix string comparison when CASEMAPPING is set to "ascii" 2023-08-24 09:23:30 +02:00
Sébastien Helleu 1a05f89586 irc: check that server is not NULL in function irc_server_eval_fingerprint 2023-08-24 09:23:30 +02:00
Sébastien Helleu c811072bdf Version 4.0.5-dev 2023-08-22 11:48:41 +02:00
45 changed files with 951 additions and 272 deletions
+28 -4
View File
@@ -10,6 +10,30 @@ 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.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)
@@ -55,8 +79,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::
@@ -94,7 +118,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
@@ -1708,7 +1732,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
+5
View File
@@ -11,6 +11,11 @@ It is recommended to read it when upgrading to a new stable version. +
For a complete list of changes, please look at ChangeLog.
[[v4.0.5]]
== Version 4.0.5 (2023-09-24)
No release notes.
[[v4.0.4]]
== Version 4.0.4 (2023-08-22)
+3 -3
View File
@@ -6796,7 +6796,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 +6815,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
@@ -7056,7 +7056,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: ...
+7 -6
View File
@@ -6819,9 +6819,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 +6912,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 +6931,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
@@ -7176,7 +7177,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: ...
+7 -6
View File
@@ -6980,9 +6980,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 +7073,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 +7092,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
@@ -7337,7 +7338,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: ...
+7 -6
View File
@@ -6784,9 +6784,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 +6877,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 +6896,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
@@ -7136,7 +7137,7 @@ struct t_config_option *option5 =
# プロトタイプ
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: ...
+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 = (
+7 -6
View File
@@ -6509,9 +6509,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 +6602,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 +6621,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
@@ -6844,7 +6845,7 @@ struct t_config_option *option5 =
# прототип
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: ...
+21 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-25 00:48+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4427,6 +4427,22 @@ msgstr "%sChyba: nemohu vytvořit soubor \"%s\""
msgid "%sError writing configuration file \"%s\""
msgstr "%sChyba při zápisu konfiguračního souboru \"%s\""
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: server %s%s%s byl zkopírován do %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: nemůžu načíst soubor \"%s\""
#, c-format
msgid ""
"%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"
msgstr ""
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "%sVAROVÁNÍ: selhalo čtení konfiguračního souboru \"%s\" (%s)"
@@ -9207,6 +9223,10 @@ msgstr ""
"když se změní status nepřítomnosti přezdívky (výsledek příkazu whois), "
"například: \"notify_highlight\", \"notify_message\" or \"notify_private\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "zavřít buffer, když je na kanálu spuštěn /part"
+21 -1
View File
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-07-05 21:25+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -5585,6 +5585,22 @@ msgid "%sError writing configuration file \"%s\""
msgstr ""
"%sEs ist ein Fehler beim Speichern der Konfigurationsdatei \"%s\" aufgetreten"
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: Server %s%s%s wurde nach %s%s%s kopiert"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: Kann die Datei \"%s\" nicht laden"
#, c-format
msgid ""
"%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"
msgstr ""
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "%sWARNUNG: Konfigurationsdatei \"%s\" konnte nicht geladen werden (%s)"
@@ -11444,6 +11460,10 @@ msgstr ""
"(Rückgabe durch Befehl whois), zum Beispiel: \"notify_message\", "
"\"notify_private\" oder \"notify_highlight\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "schließt den Buffer wenn \"/part\" im Kanal ausgeführt wird"
+21 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5052,6 +5052,22 @@ msgstr "%sError: no es posible crear el archivo \"%s\""
msgid "%sError writing configuration file \"%s\""
msgstr "%sError al escribir el archivo de configuración \"%s\""
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: servidor %s%s%s copiado como %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: no es posible cargar el archivo \"%s\""
#, c-format
msgid ""
"%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"
msgstr ""
#, fuzzy, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "Guardando archivo de configuración %s %s"
@@ -9906,6 +9922,10 @@ msgstr ""
"cuando un apodo cambia su estado de ausencia (resultado del comando whois), "
"por ejemplo: \"notify_highlight\", \"notify_message\" o \"notify_private\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "cerrar el buffer cuando /part es usado en un canal"
+24 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"PO-Revision-Date: 2023-07-05 21:25+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-09-14 20:21+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -5452,6 +5452,22 @@ msgstr "%sImpossible de créer le fichier \"%s\""
msgid "%sError writing configuration file \"%s\""
msgstr "%sErreur d'écriture du fichier de configuration \"%s\""
#, c-format
msgid "%sFile %s has been backed up as %s"
msgstr "%sLe fichier %s a été sauvegardé sous le nom %s"
#, c-format
msgid "%sError: unable to backup file %s"
msgstr "%sErreur : impossible de sauvegarder le fichier %s"
#, c-format
msgid ""
"%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"
msgstr ""
"%sImportant : le fichier %s a été mis à jour de la version %d à %d, il n'est "
"plus compatible et ne peut plus être chargé avec toute version plus ancienne"
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "%sATTENTION : échec de lecture du fichier de configuration \"%s\" (%s)"
@@ -11226,6 +11242,12 @@ msgstr ""
"de la commande whois), par exemple : \"notify_message\", \"notify_private\" "
"ou \"notify_highlight\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
"ouvrir un tampon privé sur son propre message quand la capacité echo-message "
"est activée"
msgid "close buffer when /part is issued on a channel"
msgstr "fermer le tampon lorsque /part est exécuté sur un canal"
+19 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3972,6 +3972,20 @@ msgstr "%s nem sikerült a \"%s\" fájlt létrehozni\n"
msgid "%sError writing configuration file \"%s\""
msgstr "szerver konfigurációs fájljának újraolvastatása"
#, fuzzy, c-format
msgid "%sFile %s has been backed up as %s"
msgstr "A %s%s%s szerver másolva lett %s%s néven\n"
#, fuzzy, c-format
msgid "%sError: unable to backup file %s"
msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n"
#, c-format
msgid ""
"%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"
msgstr ""
#, fuzzy, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "beállítások mentése kilépéskor"
@@ -8666,6 +8680,10 @@ msgid ""
"\"notify_message\", \"notify_private\" or \"notify_highlight\""
msgstr ""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr ""
+21 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4689,6 +4689,22 @@ msgstr "%sErrore: impossibile creare il file \"%s\""
msgid "%sError writing configuration file \"%s\""
msgstr "%sErrore: impossibile scrivere sul file di configurazione \"%s\""
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: il server %s%s%s è stato copiato in %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: impossibile caricare il file \"%s\""
#, c-format
msgid ""
"%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"
msgstr ""
#, fuzzy, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "Salvataggio del file di configurazione %s %s"
@@ -9631,6 +9647,10 @@ msgstr ""
"whois), ad esempio: \"notify_message\", \"notify_private\" o "
"\"notify_highlight\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "chiude buffer quando viene digitato /part nel canale"
+21 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -5294,6 +5294,22 @@ msgstr "%sエラー: ファイル \"%s\" の作成に失敗"
msgid "%sError writing configuration file \"%s\""
msgstr "%s設定ファイル \"%s\" の書き込み中にエラー"
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: サーバ %s%s%s を %s%s%s にコピーしました"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: ファイル \"%s\" をロードできません"
#, c-format
msgid ""
"%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"
msgstr ""
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "%s警告: 設定ファイル \"%s\" (%s) の読み込みに失敗"
@@ -10811,6 +10827,10 @@ msgstr ""
"よって表示されたメッセージに使われたタグのコンマ区切りリスト、例: "
"\"notify_message\"、\"notify_private\"、\"notify_highlight\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "/part を実行した場合にバッファを閉じる"
+21 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -5731,6 +5731,22 @@ msgstr "%sNie można utworzyć pliku \"%s\""
msgid "%sError writing configuration file \"%s\""
msgstr "%sBłąd podczas zapisu pliku konfiguracyjnego \"%s\""
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: serwer %s%s%s został skopiowany do %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: nie można wczytać pliku \"%s\""
#, c-format
msgid ""
"%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"
msgstr ""
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "%sUWAGA: nie powiódł się odczyt pliku konfiguracyjnego \"%s\" (%s)"
@@ -11807,6 +11823,10 @@ msgstr ""
"komendy whois), na przykład: \"notify_message\", \"notify_private\" or "
"\"notify_highlight\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "zamyka bufor, kiedy na kanale wykonamy /part"
+21 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -5324,6 +5324,22 @@ msgstr "%sErro: não é possível criar o ficheiro \"%s\""
msgid "%sError writing configuration file \"%s\""
msgstr "%sErro ao escrever o ficheiro de configuração \"%s\""
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: o servidor %s%s%s foi copiado para %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: não foi possível carregar o ficheiro \"%s\""
#, c-format
msgid ""
"%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"
msgstr ""
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "%sAVISO: falha ao ler o ficheiro de configuração \"%s\" (%s)"
@@ -10578,6 +10594,10 @@ msgstr ""
"whois), por exemplo: \"notify_message\", \"notify_private\" ou "
"\"notify_highlight\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "fechar o buffer ao executar /part num canal"
+21 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4698,6 +4698,22 @@ msgstr "%sErro: não foi possível criar arquivo \"%s\""
msgid "%sError writing configuration file \"%s\""
msgstr "%sErro escrevendo arquivo de configuração \"%s\""
#, fuzzy, c-format
#| msgid "Layout \"%s\" has been renamed to \"%s\""
msgid "%sFile %s has been backed up as %s"
msgstr "Disposição \"%s\" renomeado para \"%s\""
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: não foi possível carregar arquivo \"%s\""
#, c-format
msgid ""
"%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"
msgstr ""
#, fuzzy, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "Escrevendo arquivo de configurações %s %s"
@@ -9209,6 +9225,10 @@ msgid ""
"\"notify_message\", \"notify_private\" or \"notify_highlight\""
msgstr ""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "fechar buffer quando o comando /part é executado em um canal"
+19 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4000,6 +4000,20 @@ msgstr "%s не могу создать файл \"%s\"\n"
msgid "%sError writing configuration file \"%s\""
msgstr "перезагрузить конфигурационный файл сервера"
#, fuzzy, c-format
msgid "%sFile %s has been backed up as %s"
msgstr "Сервер %s%s%s скопирован в %s%s\n"
#, fuzzy, c-format
msgid "%sError: unable to backup file %s"
msgstr "Не могу записать лог-файл \"%s\"\n"
#, c-format
msgid ""
"%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"
msgstr ""
#, fuzzy, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "сохранять конфигурационный файл при выходе"
@@ -8698,6 +8712,10 @@ msgid ""
"\"notify_message\", \"notify_private\" or \"notify_highlight\""
msgstr ""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr ""
+21 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5377,6 +5377,22 @@ msgstr "%sНе може да се креира фајл „%s”"
msgid "%sError writing configuration file \"%s\""
msgstr "%sГрешка при уписивању конфигурационог фајла „%s”"
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: сервер %s%s%s је копиран у %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: фајл „%s” не може да се учита"
#, c-format
msgid ""
"%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"
msgstr ""
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "%sУПОЗОРЕЊЕ: није могао да се прочита конфигурациони фајл „%s” (%s)"
@@ -11012,6 +11028,10 @@ msgstr ""
"се статус одсуства надимка промени (резултат команде whois), на пример: "
"„notify_message”, „notify_private” или „notify_highlight”"
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "затварање бафера када се на каналу изврши /part"
+21 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5375,6 +5375,22 @@ msgstr "%s\"%s\" dosyası oluşturulamıyor"
msgid "%sError writing configuration file \"%s\""
msgstr "%s\"%s\" yapılandırma dosyası yazılırken hata"
#, fuzzy, c-format
#| msgid "%s: server %s%s%s has been copied to %s%s%s"
msgid "%sFile %s has been backed up as %s"
msgstr "%s: %s%s%s sunucusu %s%s%s konumuna kopyalandı"
#, fuzzy, c-format
#| msgid "%s%s: unable to load file \"%s\""
msgid "%sError: unable to backup file %s"
msgstr "%s%s: \"%s\" dosyası yüklenemiyor"
#, c-format
msgid ""
"%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"
msgstr ""
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr "%sUYARI: \"%s\" yapılandırma dosyası okunamadı (%s)"
@@ -11377,6 +11393,10 @@ msgstr ""
"kullanılan etiketlerin virgülle ayrılmış listesi (komut whois'inin sonucu); "
"örneğin: \"notify_message\", \"notify_private\" veya \"notify_highlight\""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr "bir kanalda /part verildiğinde arabelleği kapat"
+19 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-07-05 21:24+0200\n"
"POT-Creation-Date: 2023-09-14 20:21+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3624,6 +3624,20 @@ msgstr ""
msgid "%sError writing configuration file \"%s\""
msgstr ""
#, c-format
msgid "%sFile %s has been backed up as %s"
msgstr ""
#, c-format
msgid "%sError: unable to backup file %s"
msgstr ""
#, c-format
msgid ""
"%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"
msgstr ""
#, c-format
msgid "%sWARNING: failed to read configuration file \"%s\" (%s)"
msgstr ""
@@ -7775,6 +7789,10 @@ msgid ""
"\"notify_message\", \"notify_private\" or \"notify_highlight\""
msgstr ""
msgid ""
"open a private buffer on self message when capability echo-message is enabled"
msgstr ""
msgid "close buffer when /part is issued on a channel"
msgstr ""
+93 -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"
@@ -3161,6 +3162,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
@@ -3173,16 +3234,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;
@@ -3192,6 +3259,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;
@@ -3289,6 +3371,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;
@@ -3298,6 +3381,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) +
@@ -3396,9 +3480,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)
@@ -3480,6 +3565,7 @@ 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);
goto end_file;
}
else
@@ -3496,6 +3582,7 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
filename,
config_file->version_read,
config_file->version);
config_file_backup (filename);
goto end_file;
}
}
@@ -3513,9 +3600,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])
+1 -1
View File
@@ -876,7 +876,7 @@ weechat_guile_command_cb (const void *pointer, void *data,
{
/* load guile script */
path_script = plugin_script_search_path (weechat_guile_plugin,
ptr_name);
ptr_name, 1);
weechat_guile_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
+8
View File
@@ -103,6 +103,7 @@ struct t_config_option *irc_config_look_notice_welcome_redirect = NULL;
struct t_config_option *irc_config_look_notice_welcome_tags = NULL;
struct t_config_option *irc_config_look_notify_tags_ison = NULL;
struct t_config_option *irc_config_look_notify_tags_whois = NULL;
struct t_config_option *irc_config_look_open_pv_buffer_echo_msg = NULL;
struct t_config_option *irc_config_look_part_closes_buffer = NULL;
struct t_config_option *irc_config_look_pv_buffer = NULL;
struct t_config_option *irc_config_look_pv_tags = NULL;
@@ -3266,6 +3267,13 @@ irc_config_init ()
"\"notify_highlight\""),
NULL, 0, 0, "notify_message", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_open_pv_buffer_echo_msg = weechat_config_new_option (
irc_config_file, irc_config_section_look,
"open_pv_buffer_echo_msg", "boolean",
N_("open a private buffer on self message when capability "
"echo-message is enabled"),
NULL, 0, 0, "on", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_part_closes_buffer = weechat_config_new_option (
irc_config_file, irc_config_section_look,
"part_closes_buffer", "boolean",
+1
View File
@@ -139,6 +139,7 @@ extern struct t_config_option *irc_config_look_notice_welcome_redirect;
extern struct t_config_option *irc_config_look_notice_welcome_tags;
extern struct t_config_option *irc_config_look_notify_tags_ison;
extern struct t_config_option *irc_config_look_notify_tags_whois;
extern struct t_config_option *irc_config_look_open_pv_buffer_echo_msg;
extern struct t_config_option *irc_config_look_part_closes_buffer;
extern struct t_config_option *irc_config_look_pv_buffer;
extern struct t_config_option *irc_config_look_pv_tags;
+42 -17
View File
@@ -3077,6 +3077,9 @@ IRC_PROTOCOL_CALLBACK(privmsg)
pos_target++;
}
cap_echo_message = weechat_hashtable_has_key (server->cap_list,
"echo-message");
/* receiver is a channel ? */
if (is_channel)
{
@@ -3200,8 +3203,6 @@ IRC_PROTOCOL_CALLBACK(privmsg)
/* CTCP to user */
if (msg_args[0] == '\01')
{
cap_echo_message = weechat_hashtable_has_key (server->cap_list,
"echo-message");
msg_already_received = weechat_hashtable_has_key (
server->echo_msg_recv, irc_message);
if (!msg_already_received && cap_echo_message)
@@ -3231,7 +3232,8 @@ IRC_PROTOCOL_CALLBACK(privmsg)
if (strcmp (ptr_channel->name, remote_nick) != 0)
irc_channel_pv_rename (server, ptr_channel, remote_nick);
}
else
else if (!nick_is_me || !cap_echo_message
|| weechat_config_boolean (irc_config_look_open_pv_buffer_echo_msg))
{
ptr_channel = irc_channel_new (server,
IRC_CHANNEL_TYPE_PRIVATE,
@@ -3247,13 +3249,21 @@ IRC_PROTOCOL_CALLBACK(privmsg)
}
}
if (weechat_config_boolean (irc_config_look_typing_status_nicks))
if (ptr_channel
&& weechat_config_boolean (irc_config_look_typing_status_nicks))
{
irc_typing_channel_set_nick (ptr_channel, nick,
IRC_CHANNEL_TYPING_STATE_OFF);
}
irc_channel_set_topic (ptr_channel, address);
if (ptr_channel
&& (!nick_is_me
|| !cap_echo_message
|| (irc_server_strcasecmp (server,
server->nick, remote_nick) == 0)))
{
irc_channel_set_topic (ptr_channel, address);
}
if (nick_is_me)
{
@@ -3296,20 +3306,35 @@ IRC_PROTOCOL_CALLBACK(privmsg)
free (str_color);
msg_args2 = (nick_is_me) ?
irc_message_hide_password (server, remote_nick, msg_args) : NULL;
weechat_printf_date_tags (
ptr_channel->buffer,
date,
irc_protocol_tags (server, command, tags, str_tags, nick, address),
"%s%s",
irc_nick_as_prefix (
server, NULL, nick,
(nick_is_me) ?
IRC_COLOR_CHAT_NICK_SELF : irc_nick_color_for_pv (ptr_channel, nick)),
(msg_args2) ? msg_args2 : msg_args);
if (nick_is_me && !ptr_channel)
{
irc_input_user_message_display (
server,
date,
remote_nick,
address,
"privmsg",
NULL, /* ctcp_type */
(msg_args2) ? msg_args2 : msg_args,
1); /* decode_colors */
}
else
{
weechat_printf_date_tags (
ptr_channel->buffer,
date,
irc_protocol_tags (server, command, tags, str_tags, nick, address),
"%s%s",
irc_nick_as_prefix (
server, NULL, nick,
(nick_is_me) ?
IRC_COLOR_CHAT_NICK_SELF : irc_nick_color_for_pv (ptr_channel, nick)),
(msg_args2) ? msg_args2 : msg_args);
}
if (msg_args2)
free (msg_args2);
if (ptr_channel->has_quit_server)
if (ptr_channel && ptr_channel->has_quit_server)
ptr_channel->has_quit_server = 0;
(void) weechat_hook_signal_send ("irc_pv",
@@ -6249,7 +6274,7 @@ IRC_PROTOCOL_CALLBACK(353)
free (prefixes);
}
if (!ptr_channel)
if (!ptr_channel && str_nicks)
{
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
+43 -39
View File
@@ -131,6 +131,8 @@ char *irc_server_options[IRC_SERVER_NUM_OPTIONS][2] =
char *irc_server_casemapping_string[IRC_SERVER_NUM_CASEMAPPING] =
{ "rfc1459", "strict-rfc1459", "ascii" };
int irc_server_casemapping_range[IRC_SERVER_NUM_CASEMAPPING] =
{ 30, 29, 26 };
char *irc_server_utf8mapping_string[IRC_SERVER_NUM_UTF8MAPPING] =
{ "none", "rfc8265" };
@@ -294,25 +296,15 @@ int
irc_server_strcasecmp (struct t_irc_server *server,
const char *string1, const char *string2)
{
int casemapping, rc;
int casemapping, range;
casemapping = (server) ? server->casemapping : IRC_SERVER_CASEMAPPING_RFC1459;
switch (casemapping)
{
case IRC_SERVER_CASEMAPPING_RFC1459:
rc = weechat_strcasecmp_range (string1, string2, 30);
break;
case IRC_SERVER_CASEMAPPING_STRICT_RFC1459:
rc = weechat_strcasecmp_range (string1, string2, 29);
break;
case IRC_SERVER_CASEMAPPING_ASCII:
rc = weechat_strcasecmp (string1, string2);
break;
default:
rc = weechat_strcasecmp_range (string1, string2, 30);
break;
}
return rc;
casemapping = (server) ? server->casemapping : -1;
if ((casemapping < 0) || (casemapping >= IRC_SERVER_NUM_CASEMAPPING))
casemapping = IRC_SERVER_CASEMAPPING_RFC1459;
range = irc_server_casemapping_range[casemapping];
return weechat_strcasecmp_range (string1, string2, range);
}
/*
@@ -329,25 +321,15 @@ int
irc_server_strncasecmp (struct t_irc_server *server,
const char *string1, const char *string2, int max)
{
int casemapping, rc;
int casemapping, range;
casemapping = (server) ? server->casemapping : IRC_SERVER_CASEMAPPING_RFC1459;
switch (casemapping)
{
case IRC_SERVER_CASEMAPPING_RFC1459:
rc = weechat_strncasecmp_range (string1, string2, max, 30);
break;
case IRC_SERVER_CASEMAPPING_STRICT_RFC1459:
rc = weechat_strncasecmp_range (string1, string2, max, 29);
break;
case IRC_SERVER_CASEMAPPING_ASCII:
rc = weechat_strncasecmp (string1, string2, max);
break;
default:
rc = weechat_strncasecmp_range (string1, string2, max, 30);
break;
}
return rc;
casemapping = (server) ? server->casemapping : -1;
if ((casemapping < 0) || (casemapping >= IRC_SERVER_NUM_CASEMAPPING))
casemapping = IRC_SERVER_CASEMAPPING_RFC1459;
range = irc_server_casemapping_range[casemapping];
return weechat_strncasecmp_range (string1, string2, max, range);
}
/*
@@ -418,6 +400,9 @@ irc_server_eval_fingerprint (struct t_irc_server *server)
char *fingerprint_eval, **fingerprints, *str_sizes;
int i, j, rc, algo, length;
if (!server)
return NULL;
ptr_fingerprint = IRC_SERVER_OPTION_STRING(server,
IRC_SERVER_OPTION_TLS_FINGERPRINT);
@@ -1611,6 +1596,25 @@ irc_server_buffer_set_input_multiline (struct t_irc_server *server,
}
}
/*
* Checks if a server has channels opened.
*/
int
irc_server_has_channels (struct t_irc_server *server)
{
struct t_irc_channel *ptr_channel;
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
return 1;
}
return 0;
}
/*
* Allocates a new server and adds it to the servers queue.
*
@@ -5861,7 +5865,7 @@ irc_server_autojoin_create_buffers (struct t_irc_server *server)
* buffers are opened only if auto-join was not already done
* and if no channels are currently opened
*/
if (server->autojoin_done || server->channels)
if (server->autojoin_done || irc_server_has_channels (server))
return;
/* evaluate server option "autojoin" */
@@ -6022,7 +6026,7 @@ irc_server_autojoin_channels (struct t_irc_server *server)
return;
}
if (!server->autojoin_done && !server->channels)
if (!server->autojoin_done && !irc_server_has_channels (server))
{
/* auto-join when connecting to server for first time */
autojoin = irc_server_eval_expression (
@@ -6036,7 +6040,7 @@ irc_server_autojoin_channels (struct t_irc_server *server)
if (autojoin)
free (autojoin);
}
else if (server->channels)
else if (irc_server_has_channels (server))
{
/* auto-join after disconnection (only rejoins opened channels) */
autojoin = irc_server_build_autojoin (server);
+1
View File
@@ -387,6 +387,7 @@ extern char *irc_server_get_default_msg (const char *default_msg,
const char *target_nick);
extern void irc_server_buffer_set_input_multiline (struct t_irc_server *server,
int multiline);
extern int irc_server_has_channels (struct t_irc_server *server);
extern struct t_irc_server *irc_server_alloc (const char *name);
extern struct t_irc_server *irc_server_alloc_with_url (const char *irc_url);
extern void irc_server_apply_command_line_options (struct t_irc_server *server,
+1 -1
View File
@@ -657,7 +657,7 @@ weechat_js_command_cb (const void *pointer, void *data,
{
/* load javascript script */
path_script = plugin_script_search_path (weechat_js_plugin,
ptr_name);
ptr_name, 1);
weechat_js_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
+1 -1
View File
@@ -975,7 +975,7 @@ weechat_lua_command_cb (const void *pointer, void *data,
{
/* load lua script */
path_script = plugin_script_search_path (weechat_lua_plugin,
ptr_name);
ptr_name, 1);
weechat_lua_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
+1 -1
View File
@@ -963,7 +963,7 @@ weechat_perl_command_cb (const void *pointer, void *data,
{
/* load perl script */
path_script = plugin_script_search_path (weechat_perl_plugin,
ptr_name);
ptr_name, 1);
weechat_perl_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
+1 -1
View File
@@ -977,7 +977,7 @@ weechat_php_command_cb (const void *pointer, void *data,
{
/* load PHP script */
path_script = plugin_script_search_path (weechat_php_plugin,
ptr_name);
ptr_name, 1);
weechat_php_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
+100 -100
View File
@@ -536,7 +536,8 @@ plugin_script_search_by_full_name (struct t_plugin_script *scripts,
char *
plugin_script_search_path (struct t_weechat_plugin *weechat_plugin,
const char *filename)
const char *filename,
int search_system_dir)
{
char *final_name, *weechat_data_dir, *dir_system;
int length;
@@ -601,28 +602,31 @@ plugin_script_search_path (struct t_weechat_plugin *weechat_plugin,
free (weechat_data_dir);
}
/* try WeeChat system dir */
dir_system = weechat_info_get ("weechat_sharedir", "");
if (dir_system)
if (search_system_dir)
{
length = strlen (dir_system) + strlen (weechat_plugin->name) +
strlen (filename) + 16;
final_name = malloc (length);
if (final_name)
/* try WeeChat system dir */
dir_system = weechat_info_get ("weechat_sharedir", "");
if (dir_system)
{
snprintf (final_name,length,
"%s/%s/%s", dir_system, weechat_plugin->name, filename);
if ((stat (final_name, &st) == 0) && (st.st_size > 0))
length = strlen (dir_system) + strlen (weechat_plugin->name) +
strlen (filename) + 16;
final_name = malloc (length);
if (final_name)
{
free (dir_system);
return final_name;
snprintf (final_name,length,
"%s/%s/%s", dir_system, weechat_plugin->name, filename);
if ((stat (final_name, &st) == 0) && (st.st_size > 0))
{
free (dir_system);
return final_name;
}
free (final_name);
}
free (final_name);
free (dir_system);
}
free (dir_system);
}
return strdup (filename);
return NULL;
}
/*
@@ -1146,17 +1150,9 @@ plugin_script_remove_file (struct t_weechat_plugin *weechat_plugin,
i = 0;
while (i < 2)
{
path_script = plugin_script_search_path (weechat_plugin, name);
/*
* script not found? (if path_script == name, that means the function
* above did not find the script)
*/
if (!path_script || (strcmp (path_script, name) == 0))
{
if (path_script)
free (path_script);
path_script = plugin_script_search_path (weechat_plugin, name, 0);
if (!path_script)
break;
}
num_found++;
if (unlink (path_script) == 0)
{
@@ -1216,7 +1212,7 @@ plugin_script_action_install (struct t_weechat_plugin *weechat_plugin,
char **list)
{
char **argv, *name, *ptr_base_name, *base_name, *new_path, *autoload_path;
char *symlink_path, str_signal[128], *ptr_list, *weechat_data_dir, *dir_separator;
char *symlink_path, str_signal[128], *ptr_name, *weechat_data_dir, *dir_separator;
int argc, i, length, rc, autoload, existing_script, script_loaded;
struct t_plugin_script *ptr_script;
@@ -1226,30 +1222,7 @@ plugin_script_action_install (struct t_weechat_plugin *weechat_plugin,
/* create again directories, just in case they have been removed */
plugin_script_create_dirs (weechat_plugin);
ptr_list = *list;
autoload = 0;
*quiet = 0;
while ((ptr_list[0] == ' ') || (ptr_list[0] == '-'))
{
if (ptr_list[0] == ' ')
ptr_list++;
else
{
switch (ptr_list[1])
{
case 'a': /* autoload */
autoload = 1;
break;
case 'q': /* quiet mode */
*quiet = 1;
break;
}
ptr_list += 2;
}
}
argv = weechat_string_split (ptr_list, ",", NULL,
argv = weechat_string_split (*list, ",", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1258,7 +1231,30 @@ plugin_script_action_install (struct t_weechat_plugin *weechat_plugin,
{
for (i = 0; i < argc; i++)
{
name = strdup (argv[i]);
autoload = 0;
*quiet = 0;
ptr_name = argv[i];
while ((ptr_name[0] == ' ') || (ptr_name[0] == '-'))
{
if (ptr_name[0] == ' ')
{
ptr_name++;
}
else
{
switch (ptr_name[1])
{
case 'a': /* autoload */
autoload = 1;
break;
case 'q': /* quiet mode */
*quiet = 1;
break;
}
ptr_name += 2;
}
}
name = strdup (ptr_name);
if (name)
{
ptr_base_name = basename (name);
@@ -1350,6 +1346,13 @@ plugin_script_action_install (struct t_weechat_plugin *weechat_plugin,
free (base_name);
if (weechat_data_dir)
free (weechat_data_dir);
/* send signal */
snprintf (str_signal, sizeof (str_signal),
"%s_script_installed", weechat_plugin->name);
(void) weechat_hook_signal_send (str_signal,
WEECHAT_HOOK_SIGNAL_STRING,
name);
}
free (name);
}
@@ -1359,11 +1362,6 @@ plugin_script_action_install (struct t_weechat_plugin *weechat_plugin,
*quiet = 0;
snprintf (str_signal, sizeof (str_signal),
"%s_script_installed", weechat_plugin->name);
(void) weechat_hook_signal_send (str_signal, WEECHAT_HOOK_SIGNAL_STRING,
ptr_list);
free (*list);
*list = NULL;
}
@@ -1383,7 +1381,7 @@ plugin_script_action_remove (struct t_weechat_plugin *weechat_plugin,
int *quiet,
char **list)
{
char **argv, str_signal[128], *ptr_list;
char **argv, str_signal[128], *ptr_name;
int argc, i;
struct t_plugin_script *ptr_script;
@@ -1393,15 +1391,7 @@ plugin_script_action_remove (struct t_weechat_plugin *weechat_plugin,
/* create again directories, just in case they have been removed */
plugin_script_create_dirs (weechat_plugin);
ptr_list = *list;
*quiet = 0;
if (strncmp (ptr_list, "-q ", 3) == 0)
{
*quiet = 1;
ptr_list += 3;
}
argv = weechat_string_split (ptr_list, ",", NULL,
argv = weechat_string_split (*list, ",", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1410,25 +1400,35 @@ plugin_script_action_remove (struct t_weechat_plugin *weechat_plugin,
{
for (i = 0; i < argc; i++)
{
ptr_name = argv[i];
*quiet = 0;
if (strncmp (ptr_name, "-q ", 3) == 0)
{
*quiet = 1;
ptr_name += 3;
}
/* unload script, if script is loaded */
ptr_script = plugin_script_search_by_full_name (scripts, argv[i]);
ptr_script = plugin_script_search_by_full_name (scripts, ptr_name);
if (ptr_script)
(*script_unload) (ptr_script);
/* remove script file(s) */
(void) plugin_script_remove_file (weechat_plugin, argv[i],
(void) plugin_script_remove_file (weechat_plugin, ptr_name,
*quiet, 1);
/* send signal */
snprintf (str_signal, sizeof (str_signal),
"%s_script_removed", weechat_plugin->name);
(void) weechat_hook_signal_send (str_signal,
WEECHAT_HOOK_SIGNAL_STRING,
ptr_name);
}
weechat_string_free_split (argv);
}
*quiet = 0;
snprintf (str_signal, sizeof (str_signal),
"%s_script_removed", weechat_plugin->name);
(void) weechat_hook_signal_send (str_signal, WEECHAT_HOOK_SIGNAL_STRING,
ptr_list);
free (*list);
*list = NULL;
}
@@ -1443,7 +1443,7 @@ plugin_script_action_autoload (struct t_weechat_plugin *weechat_plugin,
char **list)
{
char **argv, *name, *ptr_base_name, *base_name, *autoload_path;
char *symlink_path, *ptr_list, *weechat_data_dir, *dir_separator;
char *symlink_path, *ptr_name, *weechat_data_dir, *dir_separator;
int argc, i, length, rc, autoload;
if (!*list)
@@ -1452,30 +1452,7 @@ plugin_script_action_autoload (struct t_weechat_plugin *weechat_plugin,
/* create again directories, just in case they have been removed */
plugin_script_create_dirs (weechat_plugin);
ptr_list = *list;
autoload = 0;
*quiet = 0;
while ((ptr_list[0] == ' ') || (ptr_list[0] == '-'))
{
if (ptr_list[0] == ' ')
ptr_list++;
else
{
switch (ptr_list[1])
{
case 'a': /* no autoload */
autoload = 1;
break;
case 'q': /* quiet mode */
*quiet = 1;
break;
}
ptr_list += 2;
}
}
argv = weechat_string_split (ptr_list, ",", NULL,
argv = weechat_string_split (*list, ",", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1484,7 +1461,30 @@ plugin_script_action_autoload (struct t_weechat_plugin *weechat_plugin,
{
for (i = 0; i < argc; i++)
{
name = strdup (argv[i]);
ptr_name = argv[i];
autoload = 0;
*quiet = 0;
while ((ptr_name[0] == ' ') || (ptr_name[0] == '-'))
{
if (ptr_name[0] == ' ')
{
ptr_name++;
}
else
{
switch (ptr_name[1])
{
case 'a': /* no autoload */
autoload = 1;
break;
case 'q': /* quiet mode */
*quiet = 1;
break;
}
ptr_name += 2;
}
}
name = strdup (ptr_name);
if (name)
{
ptr_base_name = basename (name);
+2 -1
View File
@@ -135,7 +135,8 @@ extern void plugin_script_auto_load (struct t_weechat_plugin *weechat_plugin,
extern struct t_plugin_script *plugin_script_search (struct t_plugin_script *scripts,
const char *name);
extern char *plugin_script_search_path (struct t_weechat_plugin *weechat_plugin,
const char *filename);
const char *filename,
int search_system_dir);
extern struct t_plugin_script *plugin_script_alloc (const char *filename,
const char *name,
const char *author,
+1 -1
View File
@@ -1201,7 +1201,7 @@ weechat_python_command_cb (const void *pointer, void *data,
{
/* load python script */
path_script = plugin_script_search_path (weechat_python_plugin,
ptr_name);
ptr_name, 1);
weechat_python_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
+4 -4
View File
@@ -3,7 +3,7 @@
# DO NOT EDIT BY HAND!
#
from typing import Dict
from typing import Dict, Union
WEECHAT_RC_OK: int = 0
WEECHAT_RC_OK_EAT: int = 1
@@ -539,7 +539,7 @@ def config_new_section(config_file: str, name: 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
@@ -558,7 +558,7 @@ def config_new_section(config_file: str, 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
@@ -594,7 +594,7 @@ def config_search_section(config_file: str, section_name: str) -> str:
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:
+1 -1
View File
@@ -1003,7 +1003,7 @@ weechat_ruby_command_cb (const void *pointer, void *data,
{
/* load ruby script */
path_script = plugin_script_search_path (weechat_ruby_plugin,
ptr_name);
ptr_name, 1);
weechat_ruby_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
+3 -2
View File
@@ -1254,6 +1254,9 @@ script_action_run_all ()
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
0, &num_actions);
script_action_clear ();
if (actions)
{
for (i = 0; i < num_actions; i++)
@@ -1511,8 +1514,6 @@ script_action_run_all ()
weechat_string_free_split (actions);
}
script_action_clear ();
return 1;
}
+1 -1
View File
@@ -658,7 +658,7 @@ weechat_tcl_command_cb (const void *pointer, void *data,
{
/* load tcl script */
path_script = plugin_script_search_path (weechat_tcl_plugin,
ptr_name);
ptr_name, 1);
weechat_tcl_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
+1 -1
View File
@@ -25,7 +25,7 @@
#define XFER_CONFIG_PROGRESS_BAR_MAX_SIZE 256
extern struct t_config_file *xfer_config;
extern struct t_config_file *xfer_config_file;
extern struct t_config_option *xfer_config_look_auto_open_buffer;
extern struct t_config_option *xfer_config_look_progress_bar_size;
+2
View File
@@ -1842,5 +1842,7 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
xfer_free_all ();
weechat_config_free (xfer_config_file);
return WEECHAT_RC_OK;
}
+67 -21
View File
@@ -154,6 +154,12 @@ extern char *irc_protocol_cap_to_enable (const char *capabilities,
FAIL(string_dyn_free (msg, 0)); \
}
#define CHECK_PV_CLOSE(__nick, __prefix, __message, __tags) \
CHECK_PV(__nick, __prefix, __message, __tags); \
gui_buffer_close ( \
gui_buffer_search_by_full_name ("irc." IRC_FAKE_SERVER \
"." __nick));
#define CHECK_NO_MSG \
if (arraylist_size (recorded_messages) > 0) \
{ \
@@ -2737,9 +2743,9 @@ TEST(IrcProtocolWithServer, privmsg)
"irc_privmsg,notify_message,prefix_nick_248,nick_bob,"
"host_user@host,log1");
RECV(":bob!user@host PRIVMSG alice :this is the message ");
CHECK_PV("bob", "bob", "this is the message ",
"irc_privmsg,notify_private,prefix_nick_248,nick_bob,"
"host_user@host,log1");
CHECK_PV_CLOSE("bob", "bob", "this is the message ",
"irc_privmsg,notify_private,prefix_nick_248,nick_bob,"
"host_user@host,log1");
/* message with tags to channel/user */
RECV("@tag1=value1;tag2=value2 :bob!user@host PRIVMSG #test "
@@ -2749,9 +2755,9 @@ TEST(IrcProtocolWithServer, privmsg)
"notify_message,prefix_nick_248,nick_bob,host_user@host,log1");
RECV("@tag1=value1;tag2=value2 :bob!user@host PRIVMSG alice "
":this is the message ");
CHECK_PV("bob", "bob", "this is the message ",
"irc_privmsg,irc_tag_tag1=value1,irc_tag_tag2=value2,"
"notify_private,prefix_nick_248,nick_bob,host_user@host,log1");
CHECK_PV_CLOSE("bob", "bob", "this is the message ",
"irc_privmsg,irc_tag_tag1=value1,irc_tag_tag2=value2,"
"notify_private,prefix_nick_248,nick_bob,host_user@host,log1");
/*
* message to channel/user from self nick
@@ -2780,19 +2786,59 @@ TEST(IrcProtocolWithServer, privmsg)
* message from self nick in private
* (case of bouncer or if echo-message capability is enabled)
*/
RECV(":alice!user@host PRIVMSG alice :this is the message ");
CHECK_PV("alice", "alice", "this is the message ",
"irc_privmsg,self_msg,notify_none,no_highlight,"
"prefix_nick_white,nick_alice,host_user@host,log1");
if (i == 0)
{
/* without echo-message */
RECV(":alice!user@host PRIVMSG bob :this is the message ");
CHECK_PV_CLOSE("bob", "alice", "this is the message ",
"irc_privmsg,self_msg,notify_none,no_highlight,"
"prefix_nick_white,nick_alice,host_user@host,log1");
}
else
{
/* with echo-message */
RECV(":alice!user@host PRIVMSG bob :this is the message ");
CHECK_PV_CLOSE("bob", "alice", "this is the message ",
"irc_privmsg,self_msg,notify_none,no_highlight,"
"prefix_nick_white,nick_alice,host_user@host,log1");
/* with echo-message, option irc.look.open_pv_buffer_echo_msg off */
config_file_option_set (irc_config_look_open_pv_buffer_echo_msg,
"off", 1);
RECV(":alice!user@host PRIVMSG bob :this is the message ");
CHECK_SRV("--", "Msg(alice) -> bob: this is the message ",
"irc_privmsg,self_msg,notify_none,no_highlight,"
"nick_alice,host_user@host,log1");
config_file_option_reset (irc_config_look_open_pv_buffer_echo_msg, 1);
}
/*
* message from self nick in private, with password hidden (nickserv)
* (case of bouncer or if echo-message capability is enabled)
*/
RECV(":alice!user@host PRIVMSG nickserv :identify secret");
CHECK_PV("nickserv", "alice", "identify ******",
"irc_privmsg,self_msg,notify_none,no_highlight,"
"prefix_nick_white,nick_alice,host_user@host,log1");
if (i == 0)
{
/* without echo-message */
RECV(":alice!user@host PRIVMSG nickserv :identify secret");
CHECK_PV_CLOSE("nickserv", "alice", "identify ******",
"irc_privmsg,self_msg,notify_none,no_highlight,"
"prefix_nick_white,nick_alice,host_user@host,log1");
}
else
{
/* with echo-message */
RECV(":alice!user@host PRIVMSG nickserv :identify secret");
CHECK_PV_CLOSE("nickserv", "alice", "identify ******",
"irc_privmsg,self_msg,notify_none,no_highlight,"
"prefix_nick_white,nick_alice,host_user@host,log1");
/* with echo-message, option irc.look.open_pv_buffer_echo_msg off */
config_file_option_set (irc_config_look_open_pv_buffer_echo_msg,
"off", 1);
RECV(":alice!user@host PRIVMSG nickserv :identify secret");
CHECK_SRV("--", "Msg(alice) -> nickserv: identify ******",
"irc_privmsg,self_msg,notify_none,no_highlight,"
"nick_alice,host_user@host,log1");
config_file_option_reset (irc_config_look_open_pv_buffer_echo_msg, 1);
}
/* broken CTCP to channel */
RECV(":bob!user@host PRIVMSG #test :\01");
@@ -2843,13 +2889,13 @@ TEST(IrcProtocolWithServer, privmsg)
CHECK_SRV("--", "Unknown CTCP requested by bob: TEST",
"irc_privmsg,irc_ctcp,host_user@host,log1");
RECV(":bob!user@host PRIVMSG alice :\01ACTION");
CHECK_PV("bob", " *", "bob",
"irc_privmsg,irc_action,notify_private,nick_bob,"
"host_user@host,log1");
CHECK_PV_CLOSE("bob", " *", "bob",
"irc_privmsg,irc_action,notify_private,nick_bob,"
"host_user@host,log1");
RECV(":bob!user@host PRIVMSG alice :\01ACTION is testing");
CHECK_PV("bob", " *", "bob is testing",
"irc_privmsg,irc_action,notify_private,nick_bob,"
"host_user@host,log1");
CHECK_PV_CLOSE("bob", " *", "bob is testing",
"irc_privmsg,irc_action,notify_private,nick_bob,"
"host_user@host,log1");
RECV(":bob!user@host PRIVMSG alice :\01VERSION");
info = irc_ctcp_replace_variables (ptr_server,
irc_ctcp_get_reply (ptr_server,
@@ -2974,7 +3020,7 @@ TEST(IrcProtocolWithServer, privmsg)
}
else
{
CHECK_PV("alice", "--", "CTCP query to alice: CLIENTINFO",
CHECK_SRV("--", "CTCP query to alice: CLIENTINFO",
"irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight,"
"nick_alice,host_user@host,log1");
/*
+218 -25
View File
@@ -32,6 +32,8 @@ extern "C"
#include "src/plugins/irc/irc-channel.h"
#include "src/plugins/irc/irc-server.h"
extern int irc_server_fingerprint_search_algo_with_size (int size);
extern char *irc_server_eval_fingerprint (struct t_irc_server *server);
extern char *irc_server_build_autojoin (struct t_irc_server *server);
}
@@ -92,7 +94,14 @@ TEST(IrcServer, Search)
TEST(IrcServer, SearchOption)
{
/* TODO: write tests */
LONGS_EQUAL(-1, irc_server_search_option (NULL));
LONGS_EQUAL(-1, irc_server_search_option (""));
LONGS_EQUAL(-1, irc_server_search_option ("does_not_exist"));
CHECK(irc_server_search_option ("addresses") >= 0);
CHECK(irc_server_search_option ("ADDRESSES") >= 0);
CHECK(irc_server_search_option ("autojoin") >= 0);
CHECK(irc_server_search_option ("AUTOJOIN") >= 0);
}
/*
@@ -102,7 +111,14 @@ TEST(IrcServer, SearchOption)
TEST(IrcServer, SearchCasemapping)
{
/* TODO: write tests */
LONGS_EQUAL(-1, irc_server_search_casemapping (NULL));
LONGS_EQUAL(-1, irc_server_search_casemapping (""));
LONGS_EQUAL(-1, irc_server_search_casemapping ("does_not_exist"));
CHECK(irc_server_search_casemapping ("rfc1459") >= 0);
CHECK(irc_server_search_casemapping ("RFC1459") >= 0);
CHECK(irc_server_search_casemapping ("strict-rfc1459") >= 0);
CHECK(irc_server_search_casemapping ("STRICT-RFC1459") >= 0);
}
/*
@@ -112,27 +128,89 @@ TEST(IrcServer, SearchCasemapping)
TEST(IrcServer, SearchUtf8mapping)
{
/* TODO: write tests */
LONGS_EQUAL(-1, irc_server_search_utf8mapping (NULL));
LONGS_EQUAL(-1, irc_server_search_utf8mapping (""));
LONGS_EQUAL(-1, irc_server_search_utf8mapping ("does_not_exist"));
CHECK(irc_server_search_utf8mapping ("none") >= 0);
CHECK(irc_server_search_utf8mapping ("NONE") >= 0);
CHECK(irc_server_search_utf8mapping ("rfc8265") >= 0);
CHECK(irc_server_search_utf8mapping ("RFC8265") >= 0);
}
/*
* Tests functions:
* irc_server_strcasecmp
* irc_server_strncasecmp
*/
TEST(IrcServer, Strcasecmp)
{
/* TODO: write tests */
}
struct t_irc_server *server;
/*
* Tests functions:
* irc_server_strncasecmp
*/
server = irc_server_alloc ("server1");
CHECK(server);
TEST(IrcServer, Strncasecmp)
{
/* TODO: write tests */
LONGS_EQUAL(0, irc_server_strcasecmp (NULL, NULL, NULL));
LONGS_EQUAL(0, irc_server_strcasecmp (NULL, "", ""));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, NULL, NULL, 0));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, "", "", 0));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, NULL, NULL, 1));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, "", "", 1));
LONGS_EQUAL(0, irc_server_strcasecmp (NULL, "abc", "abc"));
LONGS_EQUAL(0, irc_server_strcasecmp (NULL, "abc", "ABC"));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, "abc", "abc", 1));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, "abc", "ABC", 1));
LONGS_EQUAL(-19, irc_server_strcasecmp (NULL, "abc", "test"));
LONGS_EQUAL(19, irc_server_strcasecmp (NULL, "test", "abc"));
LONGS_EQUAL(-19, irc_server_strncasecmp (NULL, "abc", "test", 1));
LONGS_EQUAL(19, irc_server_strncasecmp (NULL, "test", "abc", 1));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, "atest", "abc", 1));
LONGS_EQUAL(0, irc_server_strcasecmp (NULL, "nick[a]", "nick{a}"));
LONGS_EQUAL(0, irc_server_strcasecmp (NULL, "nick^a", "nick~a"));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, "nick[a]", "nick{a}", 10));
LONGS_EQUAL(0, irc_server_strncasecmp (NULL, "nick^a", "nick~a", 10));
LONGS_EQUAL(0, irc_server_strcasecmp (server, "nick[a]", "nick{a}"));
LONGS_EQUAL(0, irc_server_strcasecmp (server, "nick^a", "nick~a"));
LONGS_EQUAL(0, irc_server_strncasecmp (server, "nick[a]", "nick{a}", 10));
LONGS_EQUAL(0, irc_server_strncasecmp (server, "nick^a", "nick~a", 10));
server->casemapping = IRC_SERVER_CASEMAPPING_STRICT_RFC1459;
LONGS_EQUAL(0, irc_server_strcasecmp (server, "nick[a]", "nick{a}"));
LONGS_EQUAL(-32, irc_server_strcasecmp (server, "nick^a", "nick~a"));
LONGS_EQUAL(32, irc_server_strcasecmp (server, "nick~a", "nick^a"));
LONGS_EQUAL(0, irc_server_strncasecmp (server, "nick[a]", "nick{a}", 10));
LONGS_EQUAL(-32, irc_server_strncasecmp (server, "nick^a", "nick~a", 10));
LONGS_EQUAL(32, irc_server_strncasecmp (server, "nick~a", "nick^a", 10));
LONGS_EQUAL(32, irc_server_strncasecmp (server, "nick_ô", "nick_Ô", 10));
server->casemapping = IRC_SERVER_CASEMAPPING_ASCII;
LONGS_EQUAL(-32, irc_server_strcasecmp (server, "nick[a]", "nick{a}"));
LONGS_EQUAL(32, irc_server_strcasecmp (server, "nick{a}", "nick[a]"));
LONGS_EQUAL(-32, irc_server_strcasecmp (server, "nick^a", "nick~a"));
LONGS_EQUAL(32, irc_server_strcasecmp (server, "nick~a", "nick^a"));
LONGS_EQUAL(32, irc_server_strncasecmp (server, "nick_ô", "nick_Ô", 10));
LONGS_EQUAL(-32, irc_server_strncasecmp (server, "nick[a]", "nick{a}", 10));
LONGS_EQUAL(32, irc_server_strncasecmp (server, "nick{a}", "nick[a]", 10));
LONGS_EQUAL(-32, irc_server_strncasecmp (server, "nick^a", "nick~a", 10));
LONGS_EQUAL(32, irc_server_strncasecmp (server, "nick~a", "nick^a", 10));
LONGS_EQUAL(32, irc_server_strncasecmp (server, "nick_ô", "nick_Ô", 10));
irc_server_free (server);
}
/*
@@ -142,15 +220,124 @@ TEST(IrcServer, Strncasecmp)
TEST(IrcServer, EvalExpression)
{
/* TODO: write tests */
struct t_irc_server *server;
char *str;
server = irc_server_alloc ("server1");
CHECK(server);
WEE_TEST_STR("", irc_server_eval_expression (NULL, "${server}"));
WEE_TEST_STR("", irc_server_eval_expression (NULL, "${irc_server}"));
WEE_TEST_STR("", irc_server_eval_expression (NULL, "${irc_server.name}"));
WEE_TEST_STR("server1", irc_server_eval_expression (server, "${server}"));
WEE_TEST_STR("server1", irc_server_eval_expression (server, "${irc_server.name}"));
str = irc_server_eval_expression (server, "${irc_server}");
STRNCMP_EQUAL("0x", str, 2);
free (str);
str = irc_server_eval_expression (server, "${username}");
CHECK(str && str[0]);
free (str);
irc_server_free (server);
}
/*
* Tests functions:
* irc_server_EvalFingerprint
* irc_server_fingerprint_search_algo_with_size
*/
TEST(IrcServer, FingerprintSearchAlgoWithSize)
{
LONGS_EQUAL(-1, irc_server_fingerprint_search_algo_with_size (-1));
LONGS_EQUAL(-1, irc_server_fingerprint_search_algo_with_size (0));
LONGS_EQUAL(-1, irc_server_fingerprint_search_algo_with_size (-1));
LONGS_EQUAL(-1, irc_server_fingerprint_search_algo_with_size (1024));
LONGS_EQUAL(IRC_FINGERPRINT_ALGO_SHA1,
irc_server_fingerprint_search_algo_with_size (160));
LONGS_EQUAL(IRC_FINGERPRINT_ALGO_SHA256,
irc_server_fingerprint_search_algo_with_size (256));
LONGS_EQUAL(IRC_FINGERPRINT_ALGO_SHA512,
irc_server_fingerprint_search_algo_with_size (512));
}
/*
* Tests functions:
* irc_server_eval_fingerprint
*/
TEST(IrcServer, EvalFingerprint)
{
struct t_irc_server *server;
char *str;
server = irc_server_alloc ("server1");
CHECK(server);
POINTERS_EQUAL(NULL, irc_server_eval_fingerprint (NULL));
WEE_TEST_STR("", irc_server_eval_fingerprint (server));
/* invalid: evaluated to empty string */
config_file_option_set (server->options[IRC_SERVER_OPTION_TLS_FINGERPRINT],
"${empty_value}", 1);
POINTERS_EQUAL(NULL, irc_server_eval_fingerprint (server));
/* invalid fingerprint value */
config_file_option_set (server->options[IRC_SERVER_OPTION_TLS_FINGERPRINT],
"invalid", 1);
POINTERS_EQUAL(NULL, irc_server_eval_fingerprint (server));
/* invalid fingerprint value (same length as SHA-1) */
config_file_option_set (server->options[IRC_SERVER_OPTION_TLS_FINGERPRINT],
"zzzz0aeb5ebce80ad5c201ebc358d616904czzzz", 1);
POINTERS_EQUAL(NULL, irc_server_eval_fingerprint (server));
/* valid SHA-1 fingerprint */
config_file_option_set (server->options[IRC_SERVER_OPTION_TLS_FINGERPRINT],
"340b0aeb5ebce80ad5c201ebc358d616904ca84e", 1);
WEE_TEST_STR("340b0aeb5ebce80ad5c201ebc358d616904ca84e",
irc_server_eval_fingerprint (server));
/* valid SHA-256 fingerprint */
config_file_option_set (
server->options[IRC_SERVER_OPTION_TLS_FINGERPRINT],
"6a52951b8c2541c82bf11c83534631447dbae36b6576fe79fa6a5d3467eb3af9", 1);
WEE_TEST_STR("6a52951b8c2541c82bf11c83534631447dbae36b6576fe79fa6a5d3467eb3af9",
irc_server_eval_fingerprint (server));
/* valid SHA-256 fingerprint */
config_file_option_set (
server->options[IRC_SERVER_OPTION_TLS_FINGERPRINT],
"738c7bb821afe25b6be60386883bd8edb3e972bee442f7d75c01aa65155b5887"
"c3512362e1008eb71cdd343449440b0ea0559b1e11743009ddf62ab1d3618ace", 1);
WEE_TEST_STR(
"738c7bb821afe25b6be60386883bd8edb3e972bee442f7d75c01aa65155b5887"
"c3512362e1008eb71cdd343449440b0ea0559b1e11743009ddf62ab1d3618ace",
irc_server_eval_fingerprint (server));
/* valid SHA-1 + SHA-256 fingerprints */
config_file_option_set (
server->options[IRC_SERVER_OPTION_TLS_FINGERPRINT],
"340b0aeb5ebce80ad5c201ebc358d616904ca84e,"
"6a52951b8c2541c82bf11c83534631447dbae36b6576fe79fa6a5d3467eb3af9", 1);
WEE_TEST_STR(
"340b0aeb5ebce80ad5c201ebc358d616904ca84e,"
"6a52951b8c2541c82bf11c83534631447dbae36b6576fe79fa6a5d3467eb3af9",
irc_server_eval_fingerprint (server));
irc_server_free (server);
}
/*
* Tests functions:
* irc_server_sasl_get_creds
*/
TEST(IrcServer, SaslGetCreds)
{
/* TODO: write tests */
}
@@ -172,7 +359,13 @@ TEST(IrcServer, SaslEnabled)
TEST(IrcServer, GetNameWithoutPort)
{
/* TODO: write tests */
char *str;
POINTERS_EQUAL(NULL, irc_server_get_name_without_port (NULL));
WEE_TEST_STR("", irc_server_get_name_without_port (""));
WEE_TEST_STR("example.com", irc_server_get_name_without_port ("example.com"));
WEE_TEST_STR("example.com", irc_server_get_name_without_port ("example.com/6697"));
}
/*
@@ -604,6 +797,16 @@ TEST(IrcServer, GetDefaultMsg)
/* TODO: write tests */
}
/*
* Tests functions:
* irc_server_has_channels
*/
TEST(IrcServer, HasChannels)
{
/* TODO: write tests */
}
/*
* Tests functions:
* irc_server_alloc
@@ -1125,16 +1328,6 @@ TEST(IrcServer, CreateBuffer)
/* TODO: write tests */
}
/*
* Tests functions:
* irc_server_fingerprint_search_algo_with_size
*/
TEST(IrcServer, FingerprintSearchAlgoWithSize)
{
/* TODO: write tests */
}
/*
* Tests functions:
* irc_server_fingerprint_str_sizes
+2 -2
View File
@@ -39,8 +39,8 @@
# devel-number the devel version as hex number ("0x04010000" for "4.1.0-dev")
#
WEECHAT_STABLE="4.0.4"
WEECHAT_DEVEL="4.0.4"
WEECHAT_STABLE="4.0.5"
WEECHAT_DEVEL="4.0.5"
STABLE_MAJOR=$(echo "${WEECHAT_STABLE}" | cut -d"." -f1)
STABLE_MINOR=$(echo "${WEECHAT_STABLE}" | cut -d"." -f2)