summaryrefslogtreecommitdiff
path: root/src/plugins/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/scripts')
-rw-r--r--src/plugins/scripts/lua/weechat-lua-api.c8
-rw-r--r--src/plugins/scripts/perl/weechat-perl-api.c7
-rw-r--r--src/plugins/scripts/python/weechat-python-api.c7
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby-api.c7
-rw-r--r--src/plugins/scripts/script-api.c4
-rw-r--r--src/plugins/scripts/script-api.h1
-rw-r--r--src/plugins/scripts/tcl/weechat-tcl-api.c7
7 files changed, 25 insertions, 16 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c
index 9271d9ce4..7808cdc74 100644
--- a/src/plugins/scripts/lua/weechat-lua-api.c
+++ b/src/plugins/scripts/lua/weechat-lua-api.c
@@ -3424,10 +3424,11 @@ weechat_lua_api_hook_process (lua_State *L)
*/
int
-weechat_lua_api_hook_connect_cb (void *data, int status, const char *ip_address)
+weechat_lua_api_hook_connect_cb (void *data, int status,
+ const char *error, const char *ip_address)
{
struct t_script_callback *script_callback;
- char *lua_argv[3], str_status[32], empty_arg[1] = { '\0' };
+ char *lua_argv[4], str_status[32], empty_arg[1] = { '\0' };
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@@ -3438,7 +3439,8 @@ weechat_lua_api_hook_connect_cb (void *data, int status, const char *ip_address)
lua_argv[0] = str_status;
lua_argv[1] = (ip_address) ? (char *)ip_address : empty_arg;
- lua_argv[2] = NULL;
+ lua_argv[2] = (error) ? (char *)error : empty_arg;
+ lua_argv[3] = NULL;
rc = (int *) weechat_lua_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c
index 2a3ef2815..dfeb36686 100644
--- a/src/plugins/scripts/perl/weechat-perl-api.c
+++ b/src/plugins/scripts/perl/weechat-perl-api.c
@@ -2862,10 +2862,10 @@ static XS (XS_weechat_api_hook_process)
int
weechat_perl_api_hook_connect_cb (void *data, int status,
- const char *ip_address)
+ const char *error, const char *ip_address)
{
struct t_script_callback *script_callback;
- char *perl_argv[3], str_status[32], empty_arg[1] = { '\0' };
+ char *perl_argv[4], str_status[32], empty_arg[1] = { '\0' };
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@@ -2876,7 +2876,8 @@ weechat_perl_api_hook_connect_cb (void *data, int status,
perl_argv[0] = str_status;
perl_argv[1] = (ip_address) ? (char *)ip_address : empty_arg;
- perl_argv[2] = NULL;
+ perl_argv[2] = (error) ? (char *)error : empty_arg;
+ perl_argv[3] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c
index 4f0d3a8d5..e42cbbbb4 100644
--- a/src/plugins/scripts/python/weechat-python-api.c
+++ b/src/plugins/scripts/python/weechat-python-api.c
@@ -3054,10 +3054,10 @@ weechat_python_api_hook_process (PyObject *self, PyObject *args)
int
weechat_python_api_hook_connect_cb (void *data, int status,
- const char *ip_address)
+ const char *error, const char *ip_address)
{
struct t_script_callback *script_callback;
- char *python_argv[3], str_status[32], empty_arg[1] = { '\0' };
+ char *python_argv[4], str_status[32], empty_arg[1] = { '\0' };
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@@ -3068,7 +3068,8 @@ weechat_python_api_hook_connect_cb (void *data, int status,
python_argv[0] = str_status;
python_argv[1] = (ip_address) ? (char *)ip_address : empty_arg;
- python_argv[2] = NULL;
+ python_argv[2] = (error) ? (char *)error : empty_arg;
+ python_argv[3] = NULL;
rc = (int *) weechat_python_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,
diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c
index bf150363a..dd6b5fe6a 100644
--- a/src/plugins/scripts/ruby/weechat-ruby-api.c
+++ b/src/plugins/scripts/ruby/weechat-ruby-api.c
@@ -3494,10 +3494,10 @@ weechat_ruby_api_hook_process (VALUE class, VALUE command, VALUE timeout,
int
weechat_ruby_api_hook_connect_cb (void *data, int status,
- const char *ip_address)
+ const char *error, const char *ip_address)
{
struct t_script_callback *script_callback;
- char *ruby_argv[3], str_status[32], empty_arg[1] = { '\0' };
+ char *ruby_argv[4], str_status[32], empty_arg[1] = { '\0' };
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@@ -3508,7 +3508,8 @@ weechat_ruby_api_hook_connect_cb (void *data, int status,
ruby_argv[0] = str_status;
ruby_argv[1] = (ip_address) ? (char *)ip_address : empty_arg;
- ruby_argv[2] = NULL;
+ ruby_argv[2] = (error) ? (char *)error : empty_arg;
+ ruby_argv[3] = NULL;
rc = (int *) weechat_ruby_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,
diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c
index 8784fba3e..99266a04f 100644
--- a/src/plugins/scripts/script-api.c
+++ b/src/plugins/scripts/script-api.c
@@ -917,7 +917,9 @@ script_api_hook_connect (struct t_weechat_plugin *weechat_plugin,
const char *proxy, const char *address, int port,
int sock, int ipv6, void *gnutls_sess,
const char *local_hostname,
- int (*callback)(void *data, int status, const char *ip_address),
+ int (*callback)(void *data, int status,
+ const char *error,
+ const char *ip_address),
const char *function)
{
struct t_script_callback *new_script_callback;
diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h
index 1bb20f0e5..6f6959a62 100644
--- a/src/plugins/scripts/script-api.h
+++ b/src/plugins/scripts/script-api.h
@@ -159,6 +159,7 @@ extern struct t_hook *script_api_hook_connect (struct t_weechat_plugin *weechat_
const char *local_hostname,
int (*callback)(void *data,
int status,
+ const char *error,
const char *ip_address),
const char *function);
extern struct t_hook *script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c
index 790122dad..99fb5282a 100644
--- a/src/plugins/scripts/tcl/weechat-tcl-api.c
+++ b/src/plugins/scripts/tcl/weechat-tcl-api.c
@@ -3274,10 +3274,10 @@ weechat_tcl_api_hook_process (ClientData clientData, Tcl_Interp *interp,
int
weechat_tcl_api_hook_connect_cb (void *data, int status,
- const char *ip_address)
+ const char *error, const char *ip_address)
{
struct t_script_callback *script_callback;
- char *tcl_argv[3], str_status[32], empty_arg[1] = { '\0' };
+ char *tcl_argv[4], str_status[32], empty_arg[1] = { '\0' };
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@@ -3288,7 +3288,8 @@ weechat_tcl_api_hook_connect_cb (void *data, int status,
tcl_argv[0] = str_status;
tcl_argv[1] = (ip_address) ? (char *)ip_address : empty_arg;
- tcl_argv[2] = NULL;
+ tcl_argv[2] = (error) ? (char *)error : empty_arg;
+ tcl_argv[3] = NULL;
rc = (int *) weechat_tcl_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,