mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 06:46:38 +02:00
api: add info "auto_connect" (closes #1453)
This commit is contained in:
@@ -337,6 +337,27 @@ plugin_api_info_weechat_headless_cb (const void *pointer, void *data,
|
||||
return strdup (value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns WeeChat info "auto_connect".
|
||||
*/
|
||||
|
||||
char *
|
||||
plugin_api_info_auto_connect_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
char value[32];
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
(void) arguments;
|
||||
|
||||
snprintf (value, sizeof (value), "%d", weechat_auto_connect);
|
||||
return strdup (value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns WeeChat info "charset_terminal".
|
||||
*/
|
||||
@@ -1764,6 +1785,11 @@ plugin_api_info_init ()
|
||||
hook_info (NULL, "weechat_headless",
|
||||
N_("1 if WeeChat is running headless"),
|
||||
NULL, &plugin_api_info_weechat_headless_cb, NULL, NULL);
|
||||
hook_info (NULL, "auto_connect",
|
||||
N_("1 if automatic connection to servers is enabled, "
|
||||
"0 if it has been disabled by the user (option \"-a\" or "
|
||||
"\"--no-connect\")"),
|
||||
NULL, &plugin_api_info_auto_connect_cb, NULL, NULL);
|
||||
hook_info (NULL, "charset_terminal",
|
||||
N_("terminal charset"),
|
||||
NULL, &plugin_api_info_charset_terminal_cb, NULL, NULL);
|
||||
|
||||
Reference in New Issue
Block a user