1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 05:16:38 +02:00

script: allow command /script list when option script.scripts.download_enabled is set to off (closes #1574)

This commit is contained in:
Sébastien Helleu
2020-10-15 20:38:43 +02:00
parent c3707bb6e1
commit 939b16230c
6 changed files with 52 additions and 27 deletions
+11 -8
View File
@@ -102,22 +102,25 @@ script_language_search_by_extension (const char *extension)
* Checks if download of scripts is enabled.
*
* Returns:
* 0: download NOT enabled (an error is displayed)
* 0: download NOT enabled (an error is displayed if display_error is 1)
* 1: download enabled
*/
int
script_download_enabled ()
script_download_enabled (int display_error)
{
if (weechat_config_boolean (script_config_scripts_download_enabled))
return 1;
/* download not enabled: display an error */
weechat_printf (NULL,
_("%s%s: download of scripts is disabled by default; "
"see /help script.scripts.download_enabled"),
weechat_prefix ("error"),
SCRIPT_PLUGIN_NAME);
if (display_error)
{
/* download not enabled: display an error */
weechat_printf (NULL,
_("%s%s: download of scripts is disabled by default; "
"see /help script.scripts.download_enabled"),
weechat_prefix ("error"),
SCRIPT_PLUGIN_NAME);
}
return 0;
}