mirror of
https://github.com/weechat/weechat.git
synced 2026-06-24 03:46:39 +02:00
script: allow command /script list when option script.scripts.download_enabled is set to off (closes #1574)
This commit is contained in:
@@ -37,8 +37,9 @@
|
||||
*/
|
||||
|
||||
void
|
||||
script_command_action (struct t_gui_buffer *buffer, const char *action,
|
||||
const char *arguments, int need_repository)
|
||||
script_command_action (struct t_gui_buffer *buffer,
|
||||
const char *action, const char *arguments,
|
||||
int need_repository, int error_repository)
|
||||
{
|
||||
struct t_script_repo *ptr_script;
|
||||
char str_action[4096];
|
||||
@@ -71,7 +72,8 @@ script_command_action (struct t_gui_buffer *buffer, const char *action,
|
||||
(quiet) ? "-q " : "",
|
||||
action,
|
||||
ptr_script->name_with_extension);
|
||||
script_action_schedule (str_action, need_repository, quiet);
|
||||
script_action_schedule (str_action, need_repository,
|
||||
error_repository, quiet);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -81,7 +83,8 @@ script_command_action (struct t_gui_buffer *buffer, const char *action,
|
||||
(quiet) ? "-q " : "",
|
||||
action,
|
||||
arguments);
|
||||
script_action_schedule (str_action, need_repository, quiet);
|
||||
script_action_schedule (str_action, need_repository,
|
||||
error_repository, quiet);
|
||||
}
|
||||
}
|
||||
else if (script_buffer && (buffer == script_buffer))
|
||||
@@ -95,7 +98,8 @@ script_command_action (struct t_gui_buffer *buffer, const char *action,
|
||||
snprintf (str_action, sizeof (str_action),
|
||||
"-q %s",
|
||||
action);
|
||||
script_action_schedule (str_action, need_repository, 1);
|
||||
script_action_schedule (str_action, need_repository,
|
||||
error_repository, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -109,7 +113,8 @@ script_command_action (struct t_gui_buffer *buffer, const char *action,
|
||||
"-q %s %s",
|
||||
action,
|
||||
ptr_script->name_with_extension);
|
||||
script_action_schedule (str_action, need_repository, 1);
|
||||
script_action_schedule (str_action, need_repository,
|
||||
error_repository, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,7 +140,7 @@ script_command_script (const void *pointer, void *data,
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
script_action_schedule ("buffer", 1, 0);
|
||||
script_action_schedule ("buffer", 1, 1, 0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -159,13 +164,13 @@ script_command_script (const void *pointer, void *data,
|
||||
script_repo_filter_scripts ((argc > 2) ? argv_eol[2] : NULL);
|
||||
else
|
||||
script_repo_set_filter ((argc > 2) ? argv_eol[2] : NULL);
|
||||
script_action_schedule ("buffer", 1, 0);
|
||||
script_action_schedule ("buffer", 1, 1, 0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "list") == 0)
|
||||
{
|
||||
script_action_schedule (argv_eol[1], 1, 0);
|
||||
script_action_schedule (argv_eol[1], 1, 0, 0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -179,6 +184,7 @@ script_command_script (const void *pointer, void *data,
|
||||
script_command_action (buffer,
|
||||
argv[1],
|
||||
(argc > 2) ? argv_eol[2] : NULL,
|
||||
0,
|
||||
0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -193,13 +199,14 @@ script_command_script (const void *pointer, void *data,
|
||||
script_command_action (buffer,
|
||||
argv[1],
|
||||
(argc > 2) ? argv_eol[2] : NULL,
|
||||
1,
|
||||
1);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "upgrade") == 0)
|
||||
{
|
||||
script_action_schedule ("upgrade", 1, 0);
|
||||
script_action_schedule ("upgrade", 1, 1, 0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user