1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

script: fix state of script plugins when list of scripts has not been downloaded

The problem happened when doing "/script load script.py" if the scripts list
has not been downloaded (with "/script update"): WeeChat displays that python
plugin is not loaded (which is wrong).
This commit is contained in:
Sébastien Helleu
2015-03-18 07:25:26 +01:00
parent 11debc7cae
commit 6c4b574945
6 changed files with 29 additions and 11 deletions
+19 -8
View File
@@ -134,19 +134,16 @@ script_build_download_url (const char *url)
}
/*
* Gets loaded plugins (in array of integers) and scripts (in hashtable).
* Gets loaded plugins (in array of integers).
*/
void
script_get_loaded_plugins_and_scripts ()
script_get_loaded_plugins ()
{
int i, language;
char hdata_name[128], *filename, *ptr_base_name;
const char *ptr_filename;
struct t_hdata *hdata;
void *ptr_plugin, *ptr_script;
void *ptr_plugin;
/* get loaded plugins */
for (i = 0; i < SCRIPT_NUM_LANGUAGES; i++)
{
script_plugin_loaded[i] = 0;
@@ -162,8 +159,21 @@ script_get_loaded_plugins_and_scripts ()
script_plugin_loaded[language] = 1;
ptr_plugin = weechat_hdata_move (hdata, ptr_plugin, 1);
}
}
/*
* Gets scripts (in hashtable).
*/
void
script_get_scripts ()
{
int i;
char hdata_name[128], *filename, *ptr_base_name;
const char *ptr_filename;
struct t_hdata *hdata;
void *ptr_script;
/* get loaded scripts */
if (!script_loaded)
{
script_loaded = weechat_hashtable_new (32,
@@ -242,7 +252,8 @@ script_timer_refresh_cb (void *data, int remaining_calls)
/* make C compiler happy */
(void) data;
script_get_loaded_plugins_and_scripts ();
script_get_loaded_plugins ();
script_get_scripts ();
script_repo_update_status_all ();
script_buffer_refresh (0);