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

Add support for more than one proxy, with proxy selection for each IRC server (task #6859)

This commit is contained in:
Sebastien Helleu
2008-11-23 23:04:52 +01:00
parent 09bed16dbd
commit 2e52e54a3a
52 changed files with 2498 additions and 704 deletions
+8 -5
View File
@@ -2752,7 +2752,7 @@ weechat_lua_api_hook_connect_cb (void *data, int status, const char *ip_address)
static int
weechat_lua_api_hook_connect (lua_State *L)
{
const char *address, *local_hostname, *function;
const char *proxy, *address, *local_hostname, *function;
int n, port, sock, ipv6;
char *result;
@@ -2764,7 +2764,8 @@ weechat_lua_api_hook_connect (lua_State *L)
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_connect");
LUA_RETURN_EMPTY;
}
proxy = NULL;
address = NULL;
port = 0;
sock = 0;
@@ -2773,13 +2774,14 @@ weechat_lua_api_hook_connect (lua_State *L)
function = NULL;
n = lua_gettop (lua_current_interpreter);
if (n < 6)
if (n < 7)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_connect");
LUA_RETURN_EMPTY;
}
proxy = lua_tostring (lua_current_interpreter, -7);
address = lua_tostring (lua_current_interpreter, -6);
port = lua_tonumber (lua_current_interpreter, -5);
sock = lua_tonumber (lua_current_interpreter, -4);
@@ -2789,6 +2791,7 @@ weechat_lua_api_hook_connect (lua_State *L)
result = script_ptr2str (script_api_hook_connect (weechat_lua_plugin,
lua_current_script,
proxy,
address,
port,
sock,