diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-25 20:35:10 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-25 20:35:10 +0100 |
commit | 2ad6f2f3d5fbc8bcfeb71a7bce0025d9e47a6dd9 (patch) | |
tree | 14452dda3a3642450cd9ed2b4479f36ed808cd90 | |
parent | a9094fd2fa7d0848fd07d3f564806e93388de173 (diff) | |
download | weechat-2ad6f2f3d5fbc8bcfeb71a7bce0025d9e47a6dd9.zip |
api: do not check hotlist add conditions when adding buffer in hotlist with function buffer_set
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 4 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.adoc | 4 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.adoc | 5 | ||||
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.adoc | 5 | ||||
-rw-r--r-- | doc/sr/weechat_plugin_api.sr.adoc | 5 | ||||
-rw-r--r-- | src/core/wee-command.c | 6 | ||||
-rw-r--r-- | src/core/wee-upgrade.c | 9 | ||||
-rw-r--r-- | src/gui/gui-buffer.c | 10 | ||||
-rw-r--r-- | src/gui/gui-line.c | 14 |
10 files changed, 48 insertions, 15 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index e6abcd8be..6c55b0a77 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -41,6 +41,7 @@ Bug fixes:: * core: fix context info in buffers with free content (issue #1832) * core: keep terminal title unchanged when option weechat.look.window_title is set to empty value (issue #1835, issue #1836) * core: fix crash when setting invalid color in option with null value (issue #1844) + * api: do not check conditions defined in option weechat.look.hotlist_add_conditions when adding buffer in hotlist with function buffer_set * api: fix function strcmp_ignore_chars with case sensitive comparison and wide chars starting with the same byte * api: send NULL values to config section callbacks in scripting API (issue #1843) * api: fix function string_cut when there are non printable chars in suffix diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 9467a53d0..440ce7853 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -13765,7 +13765,9 @@ Properties: WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT, "-1" | "+": enable hotlist (global setting, buffer pointer is not used) + "-": disable hotlist (global setting, buffer pointer is not used) + - priority: add buffer to hotlist with this priority + + priority: add buffer to hotlist with this priority + (conditions defined in option _weechat.look.hotlist_add_conditions_ + are *NOT* checked) + "-1": remove buffer from hotlist _(WeeChat ≥ 1.0)_. | completion_freeze | | "0" or "1" diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index 44fb3d81d..4c3fe899b 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -14064,7 +14064,9 @@ Propriétés : utilisé) + "-" : désactive la hotlist (option globale, le pointeur vers le tampon n'est pas utilisé) + - priorité : ajouter ce tampon dans la hotlist avec cette priorité + + priorité : ajouter ce tampon dans la hotlist avec cette priorité + (les conditions définies dans l'option _weechat.look.hotlist_add_conditions_ + ne sont *PAS* vérifiées) + "-1" : supprimer ce tampon de la hotlist _(WeeChat ≥ 1.0)_. | completion_freeze | | "0" ou "1" diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index c9a71831f..9a86ff068 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -14400,11 +14400,14 @@ Properties: // TRANSLATION MISSING | hotlist | | "+", "-", WEECHAT_HOTLIST_LOW, WEECHAT_HOTLIST_MESSAGE, WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT, "-1" +// TRANSLATION MISSING | "+": abilita hotlist (impostazione globale , il puntatore al buffer pointer non è utilizzato) + "-": disabilita hotlist (impostazione globale, il puntatore al buffer non è utilizzato) + - priorità: aggiunge il buffer alla hotlist con questa proprietà + + priorità: aggiunge il buffer alla hotlist con questa proprietà + (conditions defined in option _weechat.look.hotlist_add_conditions_ + are *NOT* checked) + "-1": remove buffer from hotlist _(WeeChat ≥ 1.0)_. // TRANSLATION MISSING diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index cc83d8565..66d5d5881 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -13913,9 +13913,12 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, | hotlist | | "+", "-", WEECHAT_HOTLIST_LOW, WEECHAT_HOTLIST_MESSAGE, WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT, "-1" +// TRANSLATION MISSING | "+": ホットリストを有効化 (グローバル設定、バッファへのポインタは使われない) + "-": ホットリストを無効化 (グローバル設定、バッファへのポインタは使われない) + - 優先度: この優先度でホットリストにバッファを追加 + + 優先度: この優先度でホットリストにバッファを追加 + (conditions defined in option _weechat.look.hotlist_add_conditions_ + are *NOT* checked) + "-1": ホットリストからバッファを削除 _(WeeChat バージョン 1.0 以上で利用可)_ | completion_freeze | | "0" または "1" diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc index a7a40c5a8..5af4f6974 100644 --- a/doc/sr/weechat_plugin_api.sr.adoc +++ b/doc/sr/weechat_plugin_api.sr.adoc @@ -13333,9 +13333,12 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, | hotlist | | "+", "-", WEECHAT_HOTLIST_LOW, WEECHAT_HOTLIST_MESSAGE, WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT, "-1" +// TRANSLATION MISSING | "+": укључује врућу листу (глобално подешавање, не користи се показивач на бафер) + "-": искључује врућу листу (глобално подешавање, не користи се показивач на бафер) + - приоритет: бафер се на врућу листу додаје са овим приоритетом + + приоритет: бафер се на врућу листу додаје са овим приоритетом + (conditions defined in option _weechat.look.hotlist_add_conditions_ + are *NOT* checked) + "-1": уклања бафер из вруће листе _(WeeChat ≥ 1.0)_. | completion_freeze | | "0" или "1" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index e88e51587..2657ee291 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -3293,7 +3293,11 @@ COMMAND_CALLBACK(hotlist) if (priority < 0) COMMAND_ERROR; } - gui_hotlist_add (buffer, priority, NULL, 0); + gui_hotlist_add ( + buffer, + priority, + NULL, /* creation_time */ + 0); /* check_conditions */ return WEECHAT_RC_OK; } diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index 187e39340..3846c9eda 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -767,10 +767,11 @@ upgrade_weechat_read_hotlist (struct t_infolist *infolist) if (buf) { memcpy (&creation_time, buf, size); - new_hotlist = gui_hotlist_add (ptr_buffer, - infolist_integer (infolist, "priority"), - &creation_time, - 1); + new_hotlist = gui_hotlist_add ( + ptr_buffer, + infolist_integer (infolist, "priority"), + &creation_time, + 1); /* check_conditions */ if (new_hotlist) { for (i = 0; i < GUI_HOTLIST_NUM_PRIORITIES; i++) diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index aea60fa0e..62442f5ea 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -2157,9 +2157,17 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property, if (error && !error[0]) { if (number < 0) + { gui_hotlist_remove_buffer (buffer, 0); + } else - (void) gui_hotlist_add (buffer, number, NULL, 1); + { + (void) gui_hotlist_add ( + buffer, + number, + NULL, /* creation_time */ + 0); /* check_conditions */ + } } } } diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index da8a3196a..4e29d5685 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -1790,8 +1790,11 @@ gui_line_add (struct t_gui_line *line) if ((line->data->notify_level >= GUI_HOTLIST_MIN) && line->data->highlight) { - (void) gui_hotlist_add (line->data->buffer, - GUI_HOTLIST_HIGHLIGHT, NULL, 1); + (void) gui_hotlist_add ( + line->data->buffer, + GUI_HOTLIST_HIGHLIGHT, + NULL, /* creation_time */ + 1); /* check_conditions */ if (!weechat_upgrading) { message_for_signal = gui_line_build_string_prefix_message ( @@ -1822,8 +1825,11 @@ gui_line_add (struct t_gui_line *line) } if (line->data->notify_level >= GUI_HOTLIST_MIN) { - (void) gui_hotlist_add (line->data->buffer, - line->data->notify_level, NULL, 1); + (void) gui_hotlist_add ( + line->data->buffer, + line->data->notify_level, + NULL, /* creation_time */ + 1); /* check_conditions */ } } } |