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:
parent
833bf37831
commit
b6de29afbd
@ -103,7 +103,7 @@ static void server_setup_fill(SERVER_CONNECT_REC *conn,
|
||||
conn->type = module_get_uniq_id("SERVER CONNECT", 0);
|
||||
|
||||
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"));
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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)
|
||||
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) {
|
||||
/* already exists - don't let it get there twice or
|
||||
server reconnects will screw up! */
|
||||
|
@ -204,12 +204,12 @@ int server_start_connect(SERVER_REC *server)
|
||||
const char *connect_address;
|
||||
|
||||
g_return_val_if_fail(server != NULL, FALSE);
|
||||
if (server->connrec->port <= 0) return FALSE;
|
||||
|
||||
MODULE_DATA_INIT(server);
|
||||
server->type = module_get_uniq_id("SERVER", 0);
|
||||
|
||||
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') {
|
||||
g_free_not_null(server->connrec->username);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user