1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

/SERVER irc.server.org 1234 now connects to port 1234 always even if

some other port is specified for the same server in setup.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@682 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-09-27 00:25:26 +00:00 committed by cras
parent 833bf37831
commit b6de29afbd
2 changed files with 5 additions and 4 deletions

View File

@ -103,7 +103,7 @@ static void server_setup_fill(SERVER_CONNECT_REC *conn,
conn->type = module_get_uniq_id("SERVER CONNECT", 0); conn->type = module_get_uniq_id("SERVER CONNECT", 0);
conn->address = g_strdup(address); conn->address = g_strdup(address);
conn->port = port > 0 ? port : 6667; if (port > 0) conn->port = port;
if (!conn->nick) conn->nick = g_strdup(settings_get_str("nick")); if (!conn->nick) conn->nick = g_strdup(settings_get_str("nick"));
conn->username = g_strdup(settings_get_str("user_name")); conn->username = g_strdup(settings_get_str("user_name"));
@ -132,7 +132,8 @@ static void server_setup_fill_server(SERVER_CONNECT_REC *conn,
sserver->last_connect = time(NULL); sserver->last_connect = time(NULL);
if (sserver->port > 0) conn->port = sserver->port; if (sserver->port > 0 && conn->port <= 0)
conn->port = sserver->port;
server_setup_fill_reconn(conn, sserver); server_setup_fill_reconn(conn, sserver);
signal_emit("server setup fill server", 2, conn, sserver); signal_emit("server setup fill server", 2, conn, sserver);
@ -304,7 +305,7 @@ static SERVER_SETUP_REC *server_setup_read(CONFIG_NODE *node)
if (server == NULL) if (server == NULL)
return NULL; return NULL;
port = config_node_get_int(node, "port", 6667); port = config_node_get_int(node, "port", 0);
if (server_setup_find_port(server, port) != NULL) { if (server_setup_find_port(server, port) != NULL) {
/* already exists - don't let it get there twice or /* already exists - don't let it get there twice or
server reconnects will screw up! */ server reconnects will screw up! */

View File

@ -204,12 +204,12 @@ int server_start_connect(SERVER_REC *server)
const char *connect_address; const char *connect_address;
g_return_val_if_fail(server != NULL, FALSE); g_return_val_if_fail(server != NULL, FALSE);
if (server->connrec->port <= 0) return FALSE;
MODULE_DATA_INIT(server); MODULE_DATA_INIT(server);
server->type = module_get_uniq_id("SERVER", 0); server->type = module_get_uniq_id("SERVER", 0);
server->nick = g_strdup(server->connrec->nick); server->nick = g_strdup(server->connrec->nick);
if (server->connrec->port <= 0) server->connrec->port = 6667;
if (server->connrec->username == NULL || *server->connrec->username == '\0') { if (server->connrec->username == NULL || *server->connrec->username == '\0') {
g_free_not_null(server->connrec->username); g_free_not_null(server->connrec->username);