From 27f54e286f2b5a1dadca14620a690df03eade5fa Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 4 Dec 2002 11:39:31 +0000 Subject: [PATCH] Added no_connect to SERVER_CONNECT_REC, also exported a few other variables to perl. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3042 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/server-connect-rec.h | 1 + src/core/servers.c | 3 +++ src/perl/perl-common.c | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/src/core/server-connect-rec.h b/src/core/server-connect-rec.h index ce1e48a4..8ef2d0ad 100644 --- a/src/core/server-connect-rec.h +++ b/src/core/server-connect-rec.h @@ -30,5 +30,6 @@ unsigned int reconnection:1; /* we're trying to reconnect */ unsigned int no_autojoin_channels:1; /* don't autojoin any channels */ unsigned int unix_socket:1; /* Connect using named unix socket */ unsigned int use_ssl:1; /* this connection uses SSL */ +unsigned int no_connect:1; /* don't connect() at all, it's done by plugin */ char *channels; char *away_reason; diff --git a/src/core/servers.c b/src/core/servers.c index f9ab791a..ad48b2e8 100644 --- a/src/core/servers.c +++ b/src/core/servers.c @@ -178,6 +178,9 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip, signal_emit("server connecting", 2, server, ip); + if (server->connrec->no_connect) + return; + if (ip != NULL) { own_ip = ip == NULL ? NULL : (IPADDR_IS_V6(ip) ? server->connrec->own_ip6 : diff --git a/src/perl/perl-common.c b/src/perl/perl-common.c index f7cd87da..fb6d3531 100644 --- a/src/perl/perl-common.c +++ b/src/perl/perl-common.c @@ -265,6 +265,7 @@ void perl_connect_fill_hash(HV *hv, SERVER_CONNECT_REC *conn) hv_store(hv, "type", 4, new_pv(type), 0); hv_store(hv, "chat_type", 9, new_pv(chat_type), 0); + hv_store(hv, "tag", 3, new_pv(conn->tag), 0); hv_store(hv, "address", 7, new_pv(conn->address), 0); hv_store(hv, "port", 4, newSViv(conn->port), 0); hv_store(hv, "chatnet", 7, new_pv(conn->chatnet), 0); @@ -273,6 +274,12 @@ void perl_connect_fill_hash(HV *hv, SERVER_CONNECT_REC *conn) hv_store(hv, "wanted_nick", 11, new_pv(conn->nick), 0); hv_store(hv, "username", 8, new_pv(conn->username), 0); hv_store(hv, "realname", 8, new_pv(conn->realname), 0); + + hv_store(hv, "reconnection", 12, newSViv(conn->reconnection), 0); + hv_store(hv, "no_autojoin_channels", 20, newSViv(conn->no_autojoin_channels), 0); + hv_store(hv, "unix_socket", 11, newSViv(conn->unix_socket), 0); + hv_store(hv, "use_ssl", 7, newSViv(conn->use_ssl), 0); + hv_store(hv, "no_connect", 10, newSViv(conn->no_connect), 0); } void perl_server_fill_hash(HV *hv, SERVER_REC *server)