diff options
author | Alexander Færøy <ahf@irssi.org> | 2010-03-21 20:06:10 +0000 |
---|---|---|
committer | ahf <ahf@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2010-03-21 20:06:10 +0000 |
commit | e37be456cde14705ec67b8b6d44bd2293b203b0d (patch) | |
tree | 2a247820e03843b0fe51651f4bcf70bd526c2bb4 /src/core/servers-setup.c | |
parent | 1a4c66568655de3a399d4b21d6a0e25acdcf2da8 (diff) | |
download | irssi-e37be456cde14705ec67b8b6d44bd2293b203b0d.zip |
Allow servers with the same server and port to be part of multiple networks. This should make life much easier for znc users. Thanks to Tykling, Bazerka and znx.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5125 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/servers-setup.c')
-rw-r--r-- | src/core/servers-setup.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/core/servers-setup.c b/src/core/servers-setup.c index 1eb69491..83b90db3 100644 --- a/src/core/servers-setup.c +++ b/src/core/servers-setup.c @@ -352,15 +352,6 @@ SERVER_SETUP_REC *server_setup_find(const char *address, int port, return server; } -/* Find matching server from setup. Ports must match or NULL is returned. */ -SERVER_SETUP_REC *server_setup_find_port(const char *address, int port) -{ - SERVER_SETUP_REC *rec; - - rec = server_setup_find(address, port, NULL); - return rec == NULL || rec->port != port ? NULL : rec; -} - static SERVER_SETUP_REC *server_setup_read(CONFIG_NODE *node) { SERVER_SETUP_REC *rec; @@ -375,14 +366,13 @@ static SERVER_SETUP_REC *server_setup_read(CONFIG_NODE *node) return NULL; 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! */ + chatnet = config_node_get_str(node, "chatnet", NULL); + + if (server_setup_find(server, port, chatnet) != NULL) { return NULL; } rec = NULL; - chatnet = config_node_get_str(node, "chatnet", NULL); chatnetrec = chatnet == NULL ? NULL : chatnet_find(chatnet); if (chatnetrec == NULL && chatnet != NULL) { |