Pass proxy options when creating Tox object.

This commit is contained in:
Håvard Pettersson 2014-10-11 08:52:31 +02:00
parent b585904557
commit 70959e3d6e

View File

@ -215,8 +215,18 @@ twc_profile_load(struct t_twc_profile *profile)
weechat_prefix("network"), weechat_plugin->name, weechat_prefix("network"), weechat_plugin->name,
profile->name); profile->name);
// create Tox options object
Tox_Options *options = malloc(sizeof(Tox_Options));
options->proxy_enabled =
weechat_config_boolean(profile->options[TWC_PROFILE_OPTION_PROXY_ENABLED]);
const char *proxy_address =
weechat_config_string(profile->options[TWC_PROFILE_OPTION_PROXY_ADDRESS]);
memcpy(options->proxy_address, proxy_address, strlen(proxy_address) + 1);
options->proxy_port =
weechat_config_integer(profile->options[TWC_PROFILE_OPTION_PROXY_PORT]);
// create Tox // create Tox
profile->tox = tox_new(NULL); profile->tox = tox_new(options);
if (!(profile->tox)) if (!(profile->tox))
{ {
weechat_printf(profile->buffer, weechat_printf(profile->buffer,