Added proxy options.

This commit is contained in:
Håvard Pettersson 2014-10-11 08:28:41 +02:00
parent 68cb3cc543
commit 602bf76962
2 changed files with 47 additions and 1 deletions

View File

@ -38,6 +38,9 @@ char *twc_profile_option_names[TWC_PROFILE_NUM_OPTIONS] =
"save_file",
"autoload",
"max_friend_requests",
"proxy_address",
"proxy_port",
"proxy_enabled",
};
char *twc_profile_option_defaults[TWC_PROFILE_NUM_OPTIONS] =
@ -45,6 +48,9 @@ char *twc_profile_option_defaults[TWC_PROFILE_NUM_OPTIONS] =
"%h/tox/%p",
"off",
"100",
NULL,
NULL,
"off",
};
/**
@ -224,6 +230,43 @@ twc_config_init_option(int option_index, const char *option_name)
twc_config_profile_check_value_callback, NULL,
twc_config_profile_change_callback, NULL,
NULL, NULL);
case TWC_PROFILE_OPTION_PROXY_ADDRESS:
return weechat_config_new_option(
twc_config_file, twc_config_section_profile,
option_name, "string",
"proxy address ",
NULL, 0, 0,
twc_profile_option_defaults[option_index],
NULL,
1,
twc_config_profile_check_value_callback, NULL,
twc_config_profile_change_callback, NULL,
NULL, NULL);
case TWC_PROFILE_OPTION_PROXY_ENABLED:
return weechat_config_new_option(
twc_config_file, twc_config_section_profile,
option_name, "boolean",
"whether or not to proxy this profile; requires reload to "
"effect",
NULL, 0, 0,
twc_profile_option_defaults[option_index],
NULL,
0,
twc_config_profile_check_value_callback, NULL,
twc_config_profile_change_callback, NULL,
NULL, NULL);
case TWC_PROFILE_OPTION_PROXY_PORT:
return weechat_config_new_option(
twc_config_file, twc_config_section_profile,
option_name, "integer",
"proxy address ",
NULL, 0, UINT16_MAX ,
twc_profile_option_defaults[option_index],
NULL,
1,
twc_config_profile_check_value_callback, NULL,
twc_config_profile_change_callback, NULL,
NULL, NULL);
case TWC_PROFILE_OPTION_SAVEFILE:
return weechat_config_new_option(
twc_config_file, twc_config_section_profile,

View File

@ -31,6 +31,9 @@ enum t_twc_profile_option
TWC_PROFILE_OPTION_SAVEFILE = 0,
TWC_PROFILE_OPTION_AUTOLOAD,
TWC_PROFILE_OPTION_MAX_FRIEND_REQUESTS,
TWC_PROFILE_OPTION_PROXY_ADDRESS,
TWC_PROFILE_OPTION_PROXY_PORT,
TWC_PROFILE_OPTION_PROXY_ENABLED,
TWC_PROFILE_NUM_OPTIONS,
};