From ab3ba54ab438b2487fb5dfe169ef21975855974c Mon Sep 17 00:00:00 2001
From: Timo Sirainen
-/IRCNET ADD -autosendcmd "/^msg nickserv ident pass;wait -freenode 2000" freenode +/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait -freenode 2000" freenode-
Then add some servers to different networks (ircnet is already set up +
Then add some servers to different networks (network is already set up for them), irc.kpnqwest.fi is used by default for IRCNet but if it fails, irc.funet.fi is tried next:
-/SERVER ADD -auto -ircnet ircnet irc.kpnqwest.fi 6667 -/SERVER ADD -ircnet ircnet irc.funet.fi 6667 -/SERVER ADD -auto -ircnet efnet efnet.cs.hut.fi 6667 +/SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667 +/SERVER ADD -network IRCnet irc.funet.fi 6667 +/SERVER ADD -auto -network efnet efnet.cs.hut.fi 6667
Automatically join to channels after connected to server, send op request to bot after joined to efnet/#irssi:
-/CHANNEL ADD -auto #irssi ircnet +/CHANNEL ADD -auto #irssi IRCnet /CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass" #irssi efnet@@ -216,7 +216,7 @@ window layout:
Split window 1: win#1 - Status window, win#2 - Messages window -Split window 2: win#3 - ircnet/#channel1, win#4 - ircnet/#channel2 +Split window 2: win#3 - IRCnet/#channel1, win#4 - IRCnet/#channel2 Split window 3: win#5 - efnet/#channel1, win#6 - efnet/#channel2@@ -265,22 +265,22 @@ helps with reconnecting if your primary server breaks and is probably useful in some other ways too :) For information how to actually use irssi correctly with multiple servers see the chapter 6. -
First you need to have your IRC network set, use /IRCNET
-command to see if it's already there. If it isn't, use /IRCNET ADD
-yourircnet
. If you want to execute some commands automatically when
+
First you need to have your IRC network set, use /NETWORK
+command to see if it's already there. If it isn't, use /NETWORK ADD
+yournetwork
. If you want to execute some commands automatically when
you're connected to some network, use -autosendcmd
option.
Here's some examples:
-/IRCNET ADD -autosendcmd '^msg bot invite' ircnet -/IRCNET ADD -autosendcmd "/^msg nickserv ident pass;wait -freenode 2000" freenode +/NETWORK ADD -autosendcmd '^msg bot invite' IRCnet +/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait -freenode 2000" freenode
After that you need to add your servers. For example:
-/SERVER ADD -auto -ircnet ircnet irc.kpnqwest.fi 6667 -/SERVER ADD -auto -ircnet worknet irc.mycompany.com 6667 password +/SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667 +/SERVER ADD -auto -network worknet irc.mycompany.com 6667 password
The -auto
option specifies that this server is
@@ -293,7 +293,7 @@ fails.
/CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass" #irssi efnet -/CHANNEL ADD -auto #secret ircnet password +/CHANNEL ADD -auto #secret IRCnet password
-bots
and -botcmd
should be the only ones
@@ -412,7 +412,7 @@ The IRCNet at the beginning is called the "server tag" while the
tag to refer to the server, usually it's the same as the IRC network.
When the IRC network isn't known it's some part of the server name.
When there's multiple connections to same IRC network or server, irssi
-adds a number after the tag so there could be ircnet, ircnet2, ircnet3
+adds a number after the tag so there could be network, network2, network3
etc.
Server tags beginning with RECON-
mean server
@@ -423,7 +423,7 @@ successful and irssi will try to connect it again in 3 minutes.
-/DISCONNECT ircnet - disconnect server with tag "ircnet" +/DISCONNECT network - disconnect server with tag "network" /DISCONNECT recon-1 - stop trying to reconnect to RECON-1 server /RMRECONNS - stop all server reconnections @@ -476,12 +476,12 @@ for each server. Here's how to do them (repeat for each server) /WINDOW NEW HIDE /WINDOW NAME (status) /WINDOW LEVEL ALL -MSGS -/WINDOW SERVER -sticky ircnet +/WINDOW SERVER -sticky network /WINDOW NEW HIDE /WINDOW NAME (msgs) /WINDOW LEVEL MSGS -/WINDOW SERVER -sticky ircnet +/WINDOW SERVER -sticky network
-/SERVER ADD -auto -ircnet dalnet irc.dal.net -/SERVER ADD -auto -ircnet efnet irc.efnet.org +/SERVER ADD -auto -network dalnet irc.dal.net +/SERVER ADD -auto -network efnet irc.efnet.org
With the proxy /SET
s however, irssi now connects to those
@@ -662,7 +662,7 @@ you can just forget that your bouncer even exists.
dircproxy
dircproxy separates the server connections by passwords. So, if you -for example have ircnet connection with password ircpass and +for example have network connection with password ircpass and freenode connection with freenodepass, you would do something like this:
@@ -670,8 +670,8 @@ this: /SET -clear proxy_password /SET -clear proxy_string -/SERVER ADD -auto -ircnet ircnet fake.ircnet 6667 ircpass -/SERVER ADD -auto -ircnet freenode fake.freenode 6667 freenodepass +/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass +/SERVER ADD -auto -network freenode fake.freenode 6667 freenodepassThe server name and port you give isn't used anywhere, so you can @@ -688,13 +688,13 @@ as with dircproxy, by creating fake connections:
/SET -clear proxy_password /SET -clear proxy_string -/IRCNET ADD -user ircnetuser ircnet -/SERVER ADD -auto -ircnet ircnet fake.ircnet 6667 ircpass -/IRCNET ADD -user freenodeuser freenode -/SERVER ADD -auto -ircnet freenode fake.freenode 6667 freenodepass +/NETWORK ADD -user networkuser IRCnet +/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass +/NETWORK ADD -user freenodeuser freenode +/SERVER ADD -auto -network freenode fake.freenode 6667 freenodepass -So, you'll specify the usernames with /IRCNET ADD
command,
+
So, you'll specify the usernames with /NETWORK ADD
command,
and the user's password with /SERVER ADD
.
Irssi proxy
@@ -712,19 +712,19 @@ anyone figure out even more easier ways to say this, so I wouldn't need to try to explain this thing for minutes every time? :)Irssi proxy supports sharing multiple server connections in different -ports, like you can share ircnet in port 2777 and efnet in port 2778.
+ports, like you can share network in port 2777 and efnet in port 2778.Usage in proxy side:
/LOAD proxy /SET irssiproxy_password <password> -/SET irssiproxy_ports <ircnet>=<port> ... (eg. ircnet=2777 efnet=2778) +/SET irssiproxy_ports <network>=<port> ... (eg. IRCnet=2777 efnet=2778)
NOTE: you MUST add all the servers you
-are using to server and ircnet lists with /SERVER ADD
and
-/IRCNET ADD
. ..Except if you really don't want to for some
+are using to server and network lists with /SERVER ADD
and
+/NETWORK ADD
. ..Except if you really don't want to for some
reason, and you only use one server connection, you may simply set:
@@ -737,8 +737,8 @@ reason, and you only use one server connection, you may simply set: specified in/SET irssiproxy_password
. For example:-/SERVER ADD -ircnet ircnet my.irssi-proxy.org 2777 secret -/SERVER ADD -ircnet efnet my.irssi-proxy.org 2778 secret +/SERVER ADD -network IRCnet my.irssi-proxy.org 2777 secret +/SERVER ADD -network efnet my.irssi-proxy.org 2778 secretIrssi proxy works fine with other IRC clients as well.
diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c index 0036fec8..a764373c 100644 --- a/src/core/chat-commands.c +++ b/src/core/chat-commands.c @@ -67,6 +67,10 @@ static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr, /* connect to server */ chatnet = proto == NULL ? NULL : g_hash_table_lookup(optlist, proto->chatnet); + + if (chatnet == NULL) + chatnet = g_hash_table_lookup(optlist, "network"); + conn = server_create_conn(proto != NULL ? proto->id : -1, addr, atoi(portstr), chatnet, password, nick); if (proto == NULL) @@ -129,9 +133,10 @@ static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr, /* SYNTAX: CONNECT [-4 | -6] [-ssl] [-ssl_cert] [-ssl_pkey ] [-ssl_verify] [-ssl_cafile ] [-ssl_capath ] - [-noproxy] [-ircnet ] [-host ] + [-noproxy] [-network ] [-host ] [-rawlog ] | [ [ [ ]]] */ +/* NOTE: -network replaces the old -ircnet flag. */ static void cmd_connect(const char *data) { SERVER_CONNECT_REC *conn; @@ -233,9 +238,10 @@ static void sig_default_command_server(const char *data, SERVER_REC *server, /* SYNTAX: SERVER [-4 | -6] [-ssl] [-ssl_cert ] [-ssl_pkey ] [-ssl_verify] [-ssl_cafile ] [-ssl_capath ] - [-noproxy] [-ircnet ] [-host ] + [-noproxy] [-network ] [-host ] [-rawlog ] [+]| [ [ [ ]]] */ +/* NOTE: -network replaces the old -ircnet flag. */ static void cmd_server_connect(const char *data, SERVER_REC *server) { SERVER_CONNECT_REC *conn; diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 63d262fb..397706ac 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -246,7 +246,7 @@ static void cmd_channel(const char *data, SERVER_REC *server, WI_ITEM_REC *item) } /* SYNTAX: CHANNEL ADD [-auto | -noauto] [-bots ] [-botcmd ] - [ ] */ + [ ] */ static void cmd_channel_add(const char *data) { GHashTable *optlist; @@ -298,7 +298,7 @@ static void cmd_channel_add(const char *data) cmd_params_free(free_arg); } -/* SYNTAX: CHANNEL REMOVE */ +/* SYNTAX: CHANNEL REMOVE */ static void cmd_channel_remove(const char *data) { CHANNEL_SETUP_REC *rec; diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c index ad1e4ea1..f5549894 100644 --- a/src/fe-common/core/fe-common-core.c +++ b/src/fe-common/core/fe-common-core.c @@ -137,7 +137,7 @@ void fe_common_core_init(void) static struct poptOption options[] = { { NULL, '\0', POPT_ARG_INCLUDE_TABLE, version_options, 0, NULL, NULL }, POPT_AUTOHELP - { "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/ircnet", "SERVER" }, + { "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/network", "SERVER" }, { "password", 'w', POPT_ARG_STRING, &autocon_password, 0, "Autoconnect password", "PASSWORD" }, { "port", 'p', POPT_ARG_INT, &autocon_port, 0, "Autoconnect port", "PORT" }, { "noconnect", '!', POPT_ARG_NONE, &no_autoconnect, 0, "Disable autoconnecting", NULL }, diff --git a/src/fe-common/core/fe-ignore.c b/src/fe-common/core/fe-ignore.c index 3b834299..66e9f0fc 100644 --- a/src/fe-common/core/fe-ignore.c +++ b/src/fe-common/core/fe-ignore.c @@ -64,7 +64,7 @@ static void ignore_print(int index, IGNORE_REC *rec) if (rec->fullword) g_string_append(options, "-full "); if (rec->replies) g_string_append(options, "-replies "); if (rec->servertag != NULL) - g_string_sprintfa(options, "-ircnet %s ", rec->servertag); + g_string_sprintfa(options, "-network %s ", rec->servertag); if (rec->pattern != NULL) g_string_sprintfa(options, "-pattern %s ", rec->pattern); @@ -107,9 +107,10 @@ static void cmd_ignore_show(void) } /* SYNTAX: IGNORE [-regexp | -full] [-pattern ] [-except] [-replies] - [-ircnet ] [-channels ] [-time ] [ ] + [-network ] [-channels ] [-time ] [ ] IGNORE [-regexp | -full] [-pattern ] [-except] [-replies] - [-ircnet ] [-time ] [ ] */ + [-network ] [-time ] [ ] */ +/* NOTE: -network replaces the old -ircnet flag. */ static void cmd_ignore(const char *data) { GHashTable *optlist; @@ -130,7 +131,10 @@ static void cmd_ignore(const char *data) patternarg = g_hash_table_lookup(optlist, "pattern"); chanarg = g_hash_table_lookup(optlist, "channels"); - servertag = g_hash_table_lookup(optlist, "ircnet"); + servertag = g_hash_table_lookup(optlist, "network"); + /* Allow -ircnet for backwards compatibility */ + if (!servertag) + servertag = g_hash_table_lookup(optlist, "ircnet"); if (*mask == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); if (*levels == '\0') levels = "ALL"; @@ -258,7 +262,7 @@ void fe_ignore_init(void) signal_add("ignore created", (SIGNAL_FUNC) sig_ignore_created); signal_add("ignore changed", (SIGNAL_FUNC) sig_ignore_created); - command_set_options("ignore", "regexp full except replies -ircnet -time -pattern -channels"); + command_set_options("ignore", "regexp full except replies -network -ircnet -time -pattern -channels"); } void fe_ignore_deinit(void) diff --git a/src/fe-common/irc/fe-irc-server.c b/src/fe-common/irc/fe-irc-server.c index a07ff6d0..a9a3751a 100644 --- a/src/fe-common/irc/fe-irc-server.c +++ b/src/fe-common/irc/fe-irc-server.c @@ -52,16 +52,22 @@ const char *get_visible_target(IRC_SERVER_REC *server, const char *target) } /* SYNTAX: SERVER ADD [-4 | -6] [-ssl] [-ssl_cert ] [-ssl_pkey ] [-ssl_verify] [-ssl_cafile ] [-ssl_capath ] - [-auto | -noauto] [-ircnet ] [-host ] + [-auto | -noauto] [-network ] [-host ] [-cmdspeed ] [-cmdmax ] [-port ] [ [ ]] */ +/* NOTE: -network replaces the old -ircnet flag. */ static void sig_server_add_fill(IRC_SERVER_SETUP_REC *rec, GHashTable *optlist) { IRC_CHATNET_REC *ircnet; char *value; - value = g_hash_table_lookup(optlist, "ircnet"); + value = g_hash_table_lookup(optlist, "network"); + /* For backwards compatibility, also allow the old name 'ircnet'. + But of course only if -network was not given. */ + if (!value) + value = g_hash_table_lookup(optlist, "ircnet"); + if (value != NULL) { g_free_and_null(rec->chatnet); if (*value != '\0') { @@ -139,7 +145,7 @@ void fe_irc_server_init(void) signal_add("server add fill", (SIGNAL_FUNC) sig_server_add_fill); command_bind("server list", NULL, (SIGNAL_FUNC) cmd_server_list); - command_set_options("server add", "-ircnet -cmdspeed -cmdmax -querychans"); + command_set_options("server add", "-ircnet -network -cmdspeed -cmdmax -querychans"); } void fe_irc_server_deinit(void) diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index 850117c4..371ae0bf 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -36,7 +36,7 @@ static void cmd_ircnet_list(void) GSList *tmp; str = g_string_new(NULL); - printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IRCNET_HEADER); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETWORK_HEADER); for (tmp = chatnets; tmp != NULL; tmp = tmp->next) { IRC_CHATNET_REC *rec = tmp->data; @@ -75,13 +75,13 @@ static void cmd_ircnet_list(void) if (str->len > 1) g_string_truncate(str, str->len-2); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, - IRCTXT_IRCNET_LINE, rec->name, str->str); + IRCTXT_NETWORK_LINE, rec->name, str->str); } g_string_free(str, TRUE); - printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IRCNET_FOOTER); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETWORK_FOOTER); } -/* SYNTAX: IRCNET ADD [-nick ] [-user ] [-realname ] +/* SYNTAX: NETWORK ADD [-nick ] [-user ] [-realname ] [-host ] [-autosendcmd ] [-querychans ] [-whois ] [-msgs ] [-kicks ] [-modes ] @@ -94,7 +94,7 @@ static void cmd_ircnet_add(const char *data) IRC_CHATNET_REC *rec; if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS, - "ircnet add", &optlist, &name)) + "network add", &optlist, &name)) return; if (*name == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); @@ -149,12 +149,12 @@ static void cmd_ircnet_add(const char *data) if (value != NULL && *value != '\0') rec->autosendcmd = g_strdup(value); ircnet_create(rec); - printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IRCNET_ADDED, name); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETWORK_ADDED, name); cmd_params_free(free_arg); } -/* SYNTAX: IRCNET REMOVE */ +/* SYNTAX: NETWORK REMOVE */ static void cmd_ircnet_remove(const char *data) { IRC_CHATNET_REC *rec; @@ -163,9 +163,9 @@ static void cmd_ircnet_remove(const char *data) rec = ircnet_find(data); if (rec == NULL) - printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IRCNET_NOT_FOUND, data); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETWORK_NOT_FOUND, data); else { - printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IRCNET_REMOVED, data); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETWORK_REMOVED, data); chatnet_remove(CHATNET(rec)); } } @@ -180,18 +180,18 @@ static void cmd_ircnet(const char *data, SERVER_REC *server, WI_ITEM_REC *item) void fe_ircnet_init(void) { - command_bind("ircnet", NULL, (SIGNAL_FUNC) cmd_ircnet); - command_bind("ircnet list", NULL, (SIGNAL_FUNC) cmd_ircnet_list); - command_bind("ircnet add", NULL, (SIGNAL_FUNC) cmd_ircnet_add); - command_bind("ircnet remove", NULL, (SIGNAL_FUNC) cmd_ircnet_remove); + command_bind("network", NULL, (SIGNAL_FUNC) cmd_ircnet); + command_bind("network list", NULL, (SIGNAL_FUNC) cmd_ircnet_list); + command_bind("network add", NULL, (SIGNAL_FUNC) cmd_ircnet_add); + command_bind("network remove", NULL, (SIGNAL_FUNC) cmd_ircnet_remove); - command_set_options("ircnet add", "-kicks -msgs -modes -whois -cmdspeed -cmdmax -nick -user -realname -host -autosendcmd -querychans -usermode"); + command_set_options("network add", "-kicks -msgs -modes -whois -cmdspeed -cmdmax -nick -user -realname -host -autosendcmd -querychans -usermode"); } void fe_ircnet_deinit(void) { - command_unbind("ircnet", (SIGNAL_FUNC) cmd_ircnet); - command_unbind("ircnet list", (SIGNAL_FUNC) cmd_ircnet_list); - command_unbind("ircnet add", (SIGNAL_FUNC) cmd_ircnet_add); - command_unbind("ircnet remove", (SIGNAL_FUNC) cmd_ircnet_remove); + command_unbind("network", (SIGNAL_FUNC) cmd_ircnet); + command_unbind("network list", (SIGNAL_FUNC) cmd_ircnet_list); + command_unbind("network add", (SIGNAL_FUNC) cmd_ircnet_add); + command_unbind("network remove", (SIGNAL_FUNC) cmd_ircnet_remove); } diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c index 4b466f1c..da5c63ba 100644 --- a/src/fe-common/irc/module-formats.c +++ b/src/fe-common/irc/module-formats.c @@ -35,12 +35,12 @@ FORMAT_REC fecommon_irc_formats[] = { { "netsplits_header", "%#Nick Channel Server Splitted server", 0 }, { "netsplits_line", "%#$[9]0 $[10]1 $[20]2 $3", 4, { 0, 0, 0, 0 } }, { "netsplits_footer", "", 0 }, - { "ircnet_added", "Ircnet $0 saved", 1, { 0 } }, - { "ircnet_removed", "Ircnet $0 removed", 1, { 0 } }, - { "ircnet_not_found", "Ircnet $0 not found", 1, { 0 } }, - { "ircnet_header", "%#Ircnets:", 0 }, - { "ircnet_line", "%#$0: $1", 2, { 0, 0 } }, - { "ircnet_footer", "", 0 }, + { "network_added", "Network $0 saved", 1, { 0 } }, + { "network_removed", "Network $0 removed", 1, { 0 } }, + { "network_not_found", "Network $0 not found", 1, { 0 } }, + { "network_header", "%#Networks:", 0 }, + { "network_line", "%#$0: $1", 2, { 0, 0 } }, + { "network_footer", "", 0 }, { "setupserver_header", "%#Server Port Network Settings", 0 }, { "setupserver_line", "%#%|$[!20]0 $[5]1 $[10]2 $3", 4, { 0, 1, 0, 0 } }, { "setupserver_footer", "", 0 }, diff --git a/src/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h index 78023734..ae2e55a9 100644 --- a/src/fe-common/irc/module-formats.h +++ b/src/fe-common/irc/module-formats.h @@ -13,12 +13,12 @@ enum { IRCTXT_NETSPLITS_HEADER, IRCTXT_NETSPLITS_LINE, IRCTXT_NETSPLITS_FOOTER, - IRCTXT_IRCNET_ADDED, - IRCTXT_IRCNET_REMOVED, - IRCTXT_IRCNET_NOT_FOUND, - IRCTXT_IRCNET_HEADER, - IRCTXT_IRCNET_LINE, - IRCTXT_IRCNET_FOOTER, + IRCTXT_NETWORK_ADDED, + IRCTXT_NETWORK_REMOVED, + IRCTXT_NETWORK_NOT_FOUND, + IRCTXT_NETWORK_HEADER, + IRCTXT_NETWORK_LINE, + IRCTXT_NETWORK_FOOTER, IRCTXT_SETUPSERVER_HEADER, IRCTXT_SETUPSERVER_LINE, IRCTXT_SETUPSERVER_FOOTER,