From b4d58dd9dafafe55ea9d05bca8e47761b56ab27a Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 9 Dec 2010 23:05:15 +0100 Subject: [PATCH] Add option "-switch" to commands /connect and /reconnect --- ChangeLog | 5 +- doc/de/autogen/user/irc_commands.txt | 31 ++++--- doc/en/autogen/user/irc_commands.txt | 17 ++-- doc/fr/autogen/user/irc_commands.txt | 17 ++-- doc/it/autogen/user/irc_commands.txt | 33 ++++--- po/cs.po | 30 +++--- po/de.po | 30 +++--- po/es.po | 30 +++--- po/fr.po | 56 +++++++----- po/hu.po | 28 +++--- po/it.po | 30 +++--- po/pl.po | 30 +++--- po/pt_BR.po | 26 +++--- po/ru.po | 28 +++--- po/weechat.pot | 26 +++--- src/plugins/irc/irc-command.c | 132 +++++++++++++++++++-------- src/plugins/irc/irc-server.h | 2 + 17 files changed, 344 insertions(+), 207 deletions(-) diff --git a/ChangeLog b/ChangeLog index 711f2c990..37500f56b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.3.4-dev, 2010-12-07 +v0.3.4-dev, 2010-12-09 Version 0.3.4 (under dev!) @@ -41,6 +41,9 @@ Version 0.3.4 (under dev!) nicklist_nick_get_integer, nicklist_nick_get_string, nicklist_nick_get_pointer, nicklist_nick_set * alias: complete with alias value for second argument of command /alias +* irc: add option "-switch" to commands /connect and /reconnect +* irc: allow command /reconnect on servers that are not currently connected + (bug #30726) * irc: fix topic completion in command /topic when channel topic starts with channel name * irc: add command /notify, new options irc.look.notify_tags_ison, diff --git a/doc/de/autogen/user/irc_commands.txt b/doc/de/autogen/user/irc_commands.txt index 3fda60194..f7fcb49b8 100644 --- a/doc/de/autogen/user/irc_commands.txt +++ b/doc/de/autogen/user/irc_commands.txt @@ -50,26 +50,28 @@ Nickname: zu sperrender User oder Host ........................................ -• *`/connect`* `[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-option[=value]] [-nooption]]`:: +• *`/connect`* `[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] | -all | -open] [-nojoin] [-switch]`:: ........................................ Mit IRC-Server(n) verbinden - -all: Verbindet mit allen Servern - -open: stellt eine Verbindung zu allen geöffneten Servern her, zu denen es aktuell keine Verbindung gibt - servername: intern genutzter Servername, mit dem verbunden werden soll (Der Server muss zuerst mittels "/server add" angelegt werden) - -nojoin: betrete (/join) keinen Channel (auch wenn die Funktion "autojoin" aktiviert sein sollte) - hostname: Hostname, oder IP, eines Servers - port: Port den der Server nutzen soll (Standardport: 6667) - option: legt die Optionen für den Server fest (die Boolean-Optionen können weggelassen werden) - nooption: stellt die Boolean Option auf "off" (Beispiel: -nossl) + servername: internal server name to connect (server must have been created by /server add) + hostname: hostname (or IP) of a server (this will create a TEMPORARY server) + port: port for server (6667 by default) + option: set option for server (for boolean option, value can be omitted) + nooption: set boolean option to 'off' (for example: -nossl) + -all: connect to all servers defined in configuration + -open: connect to all opened servers that are not currently connected + -nojoin: do not join any channel (even if autojoin is enabled on server) + -switch: switch to next server address - Beispiele: + Examples: /connect freenode /connect irc.oftc.net/6667 /connect irc6.oftc.net/6667 -ipv6 /connect irc6.oftc.net/6697 -ipv6 -ssl /connect my.server.org/6697 -ssl -password=test + /connect -switch ........................................ • *`/ctcp`* `target type [arguments]`:: @@ -447,14 +449,15 @@ data: unbearbeitete (RAW) Daten die gesendet werden sollen ........................................ -• *`/reconnect`* `[-all [-nojoin] | Servername [Servername ...] [-nojoin]]`:: +• *`/reconnect`* `[servername [servername ...] | -all] [-nojoin] [-switch]`:: ........................................ Mit einem oder mehreren Server(n) erneut verbinden - -all: mit allen Servern neu verbinden - Servername: Servername mit welchem verbunden werden soll - -nojoin: Channels werden nicht betreten (selbst wenn autojoin für diesen Server aktiv ist) + servername: server name to reconnect + -all: reconnect to all servers + -nojoin: do not join any channel (even if autojoin is enabled on server) + -switch: switch to next server address ........................................ • *`/rehash`* `[Option]`:: diff --git a/doc/en/autogen/user/irc_commands.txt b/doc/en/autogen/user/irc_commands.txt index 0e0a5b6af..61f3a9a3e 100644 --- a/doc/en/autogen/user/irc_commands.txt +++ b/doc/en/autogen/user/irc_commands.txt @@ -50,19 +50,20 @@ nickname: user or host to ban ........................................ -• *`/connect`* `[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-option[=value]] [-nooption]]`:: +• *`/connect`* `[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] | -all | -open] [-nojoin] [-switch]`:: ........................................ connect to IRC server(s) - -all: connect to all servers defined in configuration - -open: connect to all opened servers that are not currently connected servername: internal server name to connect (server must have been created by /server add) - -nojoin: do not join any channel (even if autojoin is enabled on server) - hostname: hostname (or IP) of a server + hostname: hostname (or IP) of a server (this will create a TEMPORARY server) port: port for server (6667 by default) option: set option for server (for boolean option, value can be omitted) nooption: set boolean option to 'off' (for example: -nossl) + -all: connect to all servers defined in configuration + -open: connect to all opened servers that are not currently connected + -nojoin: do not join any channel (even if autojoin is enabled on server) + -switch: switch to next server address Examples: /connect freenode @@ -70,6 +71,7 @@ /connect irc6.oftc.net/6667 -ipv6 /connect irc6.oftc.net/6697 -ipv6 -ssl /connect my.server.org/6697 -ssl -password=test + /connect -switch ........................................ • *`/ctcp`* `target type [arguments]`:: @@ -447,14 +449,15 @@ data: raw data to send ........................................ -• *`/reconnect`* `[-all [-nojoin] | servername [servername ...] [-nojoin]]`:: +• *`/reconnect`* `[servername [servername ...] | -all] [-nojoin] [-switch]`:: ........................................ reconnect to server(s) - -all: reconnect to all servers servername: server name to reconnect + -all: reconnect to all servers -nojoin: do not join any channel (even if autojoin is enabled on server) + -switch: switch to next server address ........................................ • *`/rehash`* `[option]`:: diff --git a/doc/fr/autogen/user/irc_commands.txt b/doc/fr/autogen/user/irc_commands.txt index 5a20e0321..f7be6afc3 100644 --- a/doc/fr/autogen/user/irc_commands.txt +++ b/doc/fr/autogen/user/irc_commands.txt @@ -50,19 +50,20 @@ pseudo: pseudo ou hôte pour le bannissement ........................................ -• *`/connect`* `[-all [-nojoin] | -open [-nojoin] | nom_serveur [nom_serveur ...] [-nojoin] | nom[/port] [-option[=valeur]] [-nooption]]`:: +• *`/connect`* `[nom_server [nom_server ...] | nom[/port] [-option[=valeur]] [-nooption] | -all | -open] [-nojoin] [-switch]`:: ........................................ se connecter à un/plusieurs serveur(s) IRC - -all: se connecter à tous les serveurs définis dans la configuration - -open: se connecter à tous les serveurs ouverts qui ne sont pas actuellement connectés nom_serveur: nom du serveur interne pour se connecter (le serveur doit avoir été créé par /server add) - -nojoin: ne rejoindre aucun canal (même si l'autojoin est activé pour le serveur) - nom: nom (ou adresse IP) d'un serveur + nom: nom (ou adresse IP) d'un serveur (ceci crééra un serveur TEMPORAIRE) port: port pour le serveur (6667 par défaut) option: définir l'option pour le serveur (pour une option booléenne, la valeur peut être omise) nooption: définir l'option booléenne à 'off' (par exemple: -nossl) + -all: se connecter à tous les serveurs définis dans la configuration + -open: se connecter à tous les serveurs ouverts qui ne sont pas actuellement connectés + -nojoin: ne rejoindre aucun canal (même si l'autojoin est activé pour le serveur) + -switch: basculer vers l'adresse suivante du serveur Exemples: /connect freenode @@ -70,6 +71,7 @@ /connect irc6.oftc.net/6667 -ipv6 /connect irc6.oftc.net/6697 -ipv6 -ssl /connect my.server.org/6697 -ssl -password=test + /connect -switch ........................................ • *`/ctcp`* `cible type [arguments]`:: @@ -447,14 +449,15 @@ données: données brutes à envoyer ........................................ -• *`/reconnect`* `[-all [-nojoin] | nom_serveur [nom_serveur...] [-nojoin]]`:: +• *`/reconnect`* `[nom_server [nom_server ...] | -all] [-nojoin] [-switch]`:: ........................................ se reconnecter à un/plusieurs serveur(s) - -all: se reconnecter à tous les serveurs nom_serveur: nom du serveur pour se reconnecter + -all: se reconnecter à tous les serveurs -nojoin: ne rejoindre aucun canal (même si l'autojoin est activé pour le serveur) + -switch: basculer vers l'adresse suivante du serveur ........................................ • *`/rehash`* `[option]`:: diff --git a/doc/it/autogen/user/irc_commands.txt b/doc/it/autogen/user/irc_commands.txt index 7fe61264a..54ec14fff 100644 --- a/doc/it/autogen/user/irc_commands.txt +++ b/doc/it/autogen/user/irc_commands.txt @@ -50,26 +50,28 @@ nick: utente o host da bannare ........................................ -• *`/connect`* `[-all [-nojoin] | -open [-nojoin] | nome_server [nome_server ...] [-nojoin] | nome_host[/porta] [-opzione[=valore]] [-nooption]`:: +• *`/connect`* `[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] | -all | -open] [-nojoin] [-switch]`:: ........................................ connette ad uno o più server IRC - -all: connette a tutti i server definiti nella configurazione - -open: connette a tutti i server aperti ai quali non si è attualmente connessi - nome_server: nome interno del server a cui connettersi (il server deve essere stato creato con /server add) - -nojoin: non entrare in nessun canale (anche se l'ingresso automatico è attivo sul server) - nome_host: nome host (oppure IP) del server - porta: porta per il server (6667 è la predefinita) - opzione: imposta opzione per il server (per le opzioni bool, il valore può essere omesso) - nooption: imposta il valore bool dell'opzione su off (per esempio: -nossl) + servername: internal server name to connect (server must have been created by /server add) + hostname: hostname (or IP) of a server (this will create a TEMPORARY server) + port: port for server (6667 by default) + option: set option for server (for boolean option, value can be omitted) + nooption: set boolean option to 'off' (for example: -nossl) + -all: connect to all servers defined in configuration + -open: connect to all opened servers that are not currently connected + -nojoin: do not join any channel (even if autojoin is enabled on server) + -switch: switch to next server address - Esempi: + Examples: /connect freenode /connect irc.oftc.net/6667 /connect irc6.oftc.net/6667 -ipv6 /connect irc6.oftc.net/6697 -ipv6 -ssl - /connect mio.server.org/6697 -ssl -password=test + /connect my.server.org/6697 -ssl -password=test + /connect -switch ........................................ • *`/ctcp`* `destinazione tipo [argomenti]`:: @@ -447,14 +449,15 @@ dati: dati raw da inviare ........................................ -• *`/reconnect`* `[-all [-nojoin] | nome_server [nome_server ...] [-nojoin]]`:: +• *`/reconnect`* `[servername [servername ...] | -all] [-nojoin] [-switch]`:: ........................................ riconnette a uno (o più) server - -all: riconnetti a tutti i server - nome_server: nome del server a cui riconnettersi - nojoin: non entrare in nessun canale (anche se l'ingresso automatico è abilitato sul server) + servername: server name to reconnect + -all: reconnect to all servers + -nojoin: do not join any channel (even if autojoin is enabled on server) + -switch: switch to next server address ........................................ • *`/rehash`* `[opzione]`:: diff --git a/po/cs.po b/po/cs.po index 7d2da69d9..761abdb30 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.4-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: 2010-11-06 11:55+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -3448,31 +3448,36 @@ msgstr "" msgid "connect to IRC server(s)" msgstr "připojit se k IRC serveru/serverům" +#, fuzzy msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" "[-all [-nojoin] | -open [-nojoin] | jméno_serveru [jméno_serveru ...] [-" "nojoin] | jméno_hosta[/port] [-volba[=hodnota]] [-novolba]]" +#, fuzzy msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" " -all: připojit ke všem serverům definovaným v konfiguraci\n" " -open: připojit ke všem otevřeným serverům, které nejsou přáve " @@ -4027,13 +4032,16 @@ msgstr "" msgid "reconnect to server(s)" msgstr "znovu připojit k serveru/serverům" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +#, fuzzy +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "[-all [-nojoin] | jméno_serveru [jméno_serveru ...] [-nojoin]]" +#, fuzzy msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" " -all: znovu připojit ke všem serverům\n" "jméno_serveru: jméno serveru pro znovu přípojení\n" diff --git a/po/de.po b/po/de.po index b057dc031..20b0d52e7 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: 2010-12-07 23:21+0100\n" "Last-Translator: Nils G.\n" "Language-Team: weechat-dev \n" @@ -3605,31 +3605,36 @@ msgstr "" msgid "connect to IRC server(s)" msgstr "Mit IRC-Server(n) verbinden" +#, fuzzy msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" "[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " "hostname[/port] [-option[=value]] [-nooption]]" +#, fuzzy msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" " -all: Verbindet mit allen Servern\n" " -open: stellt eine Verbindung zu allen geöffneten Servern her, zu denen " @@ -4202,13 +4207,16 @@ msgstr "" msgid "reconnect to server(s)" msgstr "Mit einem oder mehreren Server(n) erneut verbinden" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +#, fuzzy +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "[-all [-nojoin] | Servername [Servername ...] [-nojoin]]" +#, fuzzy msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" " -all: mit allen Servern neu verbinden\n" "Servername: Servername mit welchem verbunden werden soll\n" diff --git a/po/es.po b/po/es.po index 4e393851c..858f17793 100644 --- a/po/es.po +++ b/po/es.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.4-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: 2010-11-06 11:56+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -3496,31 +3496,36 @@ msgstr "" msgid "connect to IRC server(s)" msgstr "conectar a un servidor IRC" +#, fuzzy msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" "[-all [-nojoin] | -open [-nojoin] | servidor [servidor ...] [-nojoin] | " "hostname[/puerto] [-opción=[=valor]] [-noopción]]" +#, fuzzy msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" " -all: conectar a todos los servidores configurados\n" " -open: conectar a todos los servidores abiertos que no están conectados " @@ -4077,13 +4082,16 @@ msgstr "" msgid "reconnect to server(s)" msgstr "reconectar al servidor(es)" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +#, fuzzy +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "[-all [-nojoin] | servidor [servidor ...] [-nojoin]]" +#, fuzzy msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" " -all: reconectar en todos los servidores\n" "servidor: nombre del servidor a reconectar\n" diff --git a/po/fr.po b/po/fr.po index 8303d6eb4..d831e3ed8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.4-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" -"PO-Revision-Date: 2010-12-09 19:32+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" +"PO-Revision-Date: 2010-12-09 20:22+0100\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -3548,50 +3548,56 @@ msgid "connect to IRC server(s)" msgstr "se connecter à un/plusieurs serveur(s) IRC" msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" -"[-all [-nojoin] | -open [-nojoin] | nom_serveur [nom_serveur ...] [-nojoin] " -"| nom[/port] [-option[=valeur]] [-nooption]]" +"[nom_server [nom_server ...] | nom[/port] [-option[=valeur]] [-nooption] | -" +"all | -open] [-nojoin] [-switch]" msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" -" -all: se connecter à tous les serveurs définis dans la configuration\n" -" -open: se connecter à tous les serveurs ouverts qui ne sont pas " -"actuellement connectés\n" "nom_serveur: nom du serveur interne pour se connecter (le serveur doit avoir " "été créé par /server add)\n" -" -nojoin: ne rejoindre aucun canal (même si l'autojoin est activé pour le " -"serveur)\n" -" nom: nom (ou adresse IP) d'un serveur\n" +" nom: nom (ou adresse IP) d'un serveur (ceci crééra un serveur " +"TEMPORAIRE)\n" " port: port pour le serveur (6667 par défaut)\n" " option: définir l'option pour le serveur (pour une option booléenne, la " "valeur peut être omise)\n" " nooption: définir l'option booléenne à 'off' (par exemple: -nossl)\n" +" -all: se connecter à tous les serveurs définis dans la configuration\n" +" -open: se connecter à tous les serveurs ouverts qui ne sont pas " +"actuellement connectés\n" +" -nojoin: ne rejoindre aucun canal (même si l'autojoin est activé pour le " +"serveur)\n" +" -switch: basculer vers l'adresse suivante du serveur\n" "\n" "Exemples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgid "send a CTCP message (Client-To-Client Protocol)" msgstr "envoyer un message CTCP (Client-To-Client Protocol)" @@ -4142,18 +4148,20 @@ msgstr "" msgid "reconnect to server(s)" msgstr "se reconnecter à un/plusieurs serveur(s)" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" -msgstr "[-all [-nojoin] | nom_serveur [nom_serveur...] [-nojoin]]" +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" +msgstr "[nom_server [nom_server ...] | -all] [-nojoin] [-switch]" msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" -" -all: se reconnecter à tous les serveurs\n" "nom_serveur: nom du serveur pour se reconnecter\n" +" -all: se reconnecter à tous les serveurs\n" " -nojoin: ne rejoindre aucun canal (même si l'autojoin est activé pour le " -"serveur)" +"serveur)\n" +" -switch: basculer vers l'adresse suivante du serveur" msgid "tell the server to reload its config file" msgstr "demander au serveur de recharger son fichier de configuration" diff --git a/po/hu.po b/po/hu.po index fd6da4c3c..da46923ab 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.4-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: 2010-11-05 17:17+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -3235,31 +3235,34 @@ msgstr "csatlakozás a szerver(ek)hez" #, fuzzy msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" "[-all [-nojoin] | szervernév [szervernév ...] [-nojoin] | gépnév [-port " "port] [-ipv6] [-ssl]]" #, fuzzy msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" " -all: kapcsolódás minden szerverhez\n" "szervernév: a belső szervernév amihez kapcsolódik\n" @@ -3763,13 +3766,16 @@ msgstr "" msgid "reconnect to server(s)" msgstr "újracsatlakozás a szerver(ek)hez" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +#, fuzzy +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "[-all [-nojoin] | szervernév [szervernév ...] [-nojoin]]" +#, fuzzy msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" "-all: újracsatlakozás minden szerverhez\n" "szervernév: újracsatlakozás a megadott szerverhez\n" diff --git a/po/it.po b/po/it.po index e3906a3e2..7db8ede0a 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.4-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: 2010-12-04 11:57+0100\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -3516,31 +3516,36 @@ msgstr "" msgid "connect to IRC server(s)" msgstr "connette ad uno o più server IRC" +#, fuzzy msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" "[-all [-nojoin] | -open [-nojoin] | nome_server [nome_server ...] [-nojoin] " "| nome_host[/porta] [-opzione[=valore]] [-nooption]" +#, fuzzy msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" " -all: connette a tutti i server definiti nella configurazione\n" " -open: connette a tutti i server aperti ai quali non si è attualmente " @@ -4108,13 +4113,16 @@ msgstr "" msgid "reconnect to server(s)" msgstr "riconnette a uno (o più) server" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +#, fuzzy +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "[-all [-nojoin] | nome_server [nome_server ...] [-nojoin]]" +#, fuzzy msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" " -all: riconnetti a tutti i server\n" "nome_server: nome del server a cui riconnettersi\n" diff --git a/po/pl.po b/po/pl.po index 272a9b754..fbb7e7b26 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.4-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: 2010-11-06 11:56+0100\n" "Last-Translator: Krzysztof Koroscik \n" "Language-Team: weechat-dev \n" @@ -3485,31 +3485,36 @@ msgstr "" msgid "connect to IRC server(s)" msgstr "łączy się z serwerem(ami) IRC" +#, fuzzy msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" "[-all [-nojoin] | -open [-nojoin] | nazwa_serwera [nazwa_serwera ...] [-" "nojoin] | nazwa_hosta[/port] [-opcja[=wartość]] [-noopcja]]" +#, fuzzy msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" " -all: łączy się ze wszystkimi serwerami zdefiniowanymi w konfiguracji\n" " -open: łączy się ze wszystkimi otwartymi ale nie połączonymi serwerami\n" @@ -4064,13 +4069,16 @@ msgstr "" msgid "reconnect to server(s)" msgstr "ponownie połącz się z serwerem(ami)" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +#, fuzzy +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "[-all [-nojoin] | serwer [serwer ...] [-nojoin]]" +#, fuzzy msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" " -all: połącz się ponownie ze wszystkimi serwerami\n" "serwer: nazwa serwera, z którym należy się ponownie połączyć\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index c8b074184..cd623b8c6 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.4-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: 2010-11-13 09:26+0100\n" "Last-Translator: Ivan Sichmann Freitas \n" "Language-Team: weechat-dev \n" @@ -2901,28 +2901,31 @@ msgid "connect to IRC server(s)" msgstr "" msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" msgid "send a CTCP message (Client-To-Client Protocol)" @@ -3332,13 +3335,14 @@ msgstr "" msgid "reconnect to server(s)" msgstr "" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "" msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" msgid "tell the server to reload its config file" diff --git a/po/ru.po b/po/ru.po index 1b55a0dfa..508e972ef 100644 --- a/po/ru.po +++ b/po/ru.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.4-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: 2010-11-05 17:17+0100\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -3255,31 +3255,34 @@ msgstr "подключиться к серверу(-ам)" #, fuzzy msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" "[-all [-nojoin] | сервер [servername ...] [-nojoin] | адрес [-port порт] [-" "ipv6] [-ssl]]" #, fuzzy msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" " -all: переподключиться ко всем серверам\n" " сервер: название сервера для переподключения\n" @@ -3780,13 +3783,16 @@ msgstr "" msgid "reconnect to server(s)" msgstr "переподключиться к серверу(-ам)" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +#, fuzzy +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "[-all [-nojoin] | сервер [сервер ...] [-nojoin]]" +#, fuzzy msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" " -all: переподключиться ко всем серверам\n" " сервер: название сервера для переподключения-nojoin: не заходить на каналы " diff --git a/po/weechat.pot b/po/weechat.pot index 4e768855b..d86b6c87a 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-12-09 19:36+0100\n" +"POT-Creation-Date: 2010-12-09 22:59+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2840,28 +2840,31 @@ msgid "connect to IRC server(s)" msgstr "" msgid "" -"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | " -"hostname[/port] [-option[=value]] [-nooption]]" +"[servername [servername ...] | hostname[/port] [-option[=value]] [-nooption] " +"| -all | -open] [-nojoin] [-switch]" msgstr "" msgid "" -" -all: connect to all servers defined in configuration\n" -" -open: connect to all opened servers that are not currently connected\n" "servername: internal server name to connect (server must have been created " "by /server add)\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" -" hostname: hostname (or IP) of a server\n" +" hostname: hostname (or IP) of a server (this will create a TEMPORARY " +"server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" +" -all: connect to all servers defined in configuration\n" +" -open: connect to all opened servers that are not currently connected\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address\n" "\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" -" /connect my.server.org/6697 -ssl -password=test" +" /connect my.server.org/6697 -ssl -password=test\n" +" /connect -switch" msgstr "" msgid "send a CTCP message (Client-To-Client Protocol)" @@ -3271,13 +3274,14 @@ msgstr "" msgid "reconnect to server(s)" msgstr "" -msgid "[-all [-nojoin] | servername [servername ...] [-nojoin]]" +msgid "[servername [servername ...] | -all] [-nojoin] [-switch]" msgstr "" msgid "" -" -all: reconnect to all servers\n" "servername: server name to reconnect\n" -" -nojoin: do not join any channel (even if autojoin is enabled on server)" +" -all: reconnect to all servers\n" +" -nojoin: do not join any channel (even if autojoin is enabled on server)\n" +" -switch: switch to next server address" msgstr "" msgid "tell the server to reload its config file" diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index ed33f21fe..6991022b1 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -676,7 +676,8 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc, */ int -irc_command_connect_one_server (struct t_irc_server *server, int no_join) +irc_command_connect_one_server (struct t_irc_server *server, + int switch_address, int no_join) { if (!server) return 0; @@ -699,7 +700,12 @@ irc_command_connect_one_server (struct t_irc_server *server, int no_join) server->name); return 0; } + + if (switch_address) + irc_server_switch_address (server, 0); + server->disable_autojoin = no_join; + if (irc_server_connect (server)) { server->reconnect_delay = 0; @@ -719,7 +725,8 @@ int irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { - int i, nb_connect, connect_ok, all_servers, all_opened, no_join; + int i, nb_connect, connect_ok, all_servers, all_opened, switch_address; + int no_join; char *name; IRC_BUFFER_GET_SERVER(buffer); @@ -728,11 +735,11 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, (void) data; (void) argv_eol; - nb_connect = 0; connect_ok = 1; all_servers = 0; all_opened = 0; + switch_address = 0; no_join = 0; for (i = 1; i < argc; i++) { @@ -740,6 +747,8 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, all_servers = 1; else if (weechat_strcasecmp (argv[i], "-open") == 0) all_opened = 1; + else if (weechat_strcasecmp (argv[i], "-switch") == 0) + switch_address = 1; else if (weechat_strcasecmp (argv[i], "-nojoin") == 0) no_join = 1; } @@ -752,8 +761,11 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, if (ptr_server->buffer && !ptr_server->is_connected && (!ptr_server->hook_connect)) { - if (!irc_command_connect_one_server (ptr_server, no_join)) + if (!irc_command_connect_one_server (ptr_server, + switch_address, no_join)) + { connect_ok = 0; + } } } return (connect_ok) ? WEECHAT_RC_OK : WEECHAT_RC_ERROR; @@ -765,14 +777,18 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_server->is_connected && (!ptr_server->hook_connect)) { - if (!irc_command_connect_one_server (ptr_server, no_join)) + if (!irc_command_connect_one_server (ptr_server, + switch_address, no_join)) + { connect_ok = 0; + } } } return (connect_ok) ? WEECHAT_RC_OK : WEECHAT_RC_ERROR; } else { + nb_connect = 0; for (i = 1; i < argc; i++) { if (argv[i][0] != '-') @@ -781,8 +797,12 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, ptr_server = irc_server_search (argv[i]); if (ptr_server) { - if (!irc_command_connect_one_server (ptr_server, no_join)) + if (!irc_command_connect_one_server (ptr_server, + switch_address, + no_join)) + { connect_ok = 0; + } } else { @@ -803,7 +823,7 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, IRC_COLOR_CHAT); irc_server_apply_command_line_options (ptr_server, argc, argv); - if (!irc_command_connect_one_server (ptr_server, 0)) + if (!irc_command_connect_one_server (ptr_server, 0, 0)) connect_ok = 0; } else @@ -822,11 +842,14 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, i++; } } + if (nb_connect == 0) + { + connect_ok = irc_command_connect_one_server (ptr_server, + switch_address, + no_join); + } } - if (nb_connect == 0) - connect_ok = irc_command_connect_one_server (ptr_server, no_join); - if (!connect_ok) return WEECHAT_RC_ERROR; @@ -3144,18 +3167,27 @@ irc_command_quote (void *data, struct t_gui_buffer *buffer, int argc, */ int -irc_command_reconnect_one_server (struct t_irc_server *server, int no_join) +irc_command_reconnect_one_server (struct t_irc_server *server, + int switch_address, int no_join) { + int switch_done; + if (!server) return 0; + switch_done = 0; + if ((server->is_connected) || (server->hook_connect) || (server->hook_fd)) { /* disconnect from server */ irc_command_quit_server (server, NULL); - irc_server_disconnect (server, 0, 0); + irc_server_disconnect (server, switch_address, 0); + switch_done = 1; } + if (switch_address && !switch_done) + irc_server_switch_address (server, 0); + server->disable_autojoin = no_join; if (irc_server_connect (server)) @@ -3177,7 +3209,7 @@ int irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { - int i, nb_reconnect, reconnect_ok, all_servers, no_join; + int i, nb_reconnect, reconnect_ok, all_servers, switch_address, no_join; IRC_BUFFER_GET_SERVER(buffer); @@ -3188,12 +3220,15 @@ irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc, reconnect_ok = 1; all_servers = 0; + switch_address = 0; no_join = 0; for (i = 1; i < argc; i++) { if (weechat_strcasecmp (argv[i], "-all") == 0) all_servers = 1; - if (weechat_strcasecmp (argv[i], "-nojoin") == 0) + else if (weechat_strcasecmp (argv[i], "-switch") == 0) + switch_address = 1; + else if (weechat_strcasecmp (argv[i], "-nojoin") == 0) no_join = 1; } @@ -3204,8 +3239,12 @@ irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc, { if (ptr_server->buffer) { - if (!irc_command_reconnect_one_server (ptr_server, no_join)) + if (!irc_command_reconnect_one_server (ptr_server, + switch_address, + no_join)) + { reconnect_ok = 0; + } } } } @@ -3220,8 +3259,15 @@ irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc, ptr_server = irc_server_search (argv[i]); if (ptr_server) { - if (!irc_command_reconnect_one_server (ptr_server, no_join)) - reconnect_ok = 0; + if (ptr_server->buffer) + { + if (!irc_command_reconnect_one_server (ptr_server, + switch_address, + no_join)) + { + reconnect_ok = 0; + } + } } else { @@ -3234,7 +3280,11 @@ irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc, } } if (nb_reconnect == 0) - reconnect_ok = irc_command_reconnect_one_server (ptr_server, no_join); + { + reconnect_ok = irc_command_reconnect_one_server (ptr_server, + switch_address, + no_join); + } } if (!reconnect_ok) @@ -4579,31 +4629,33 @@ irc_command_init () "%(irc_channel_nicks_hosts)", &irc_command_ban, NULL); weechat_hook_command ("connect", N_("connect to IRC server(s)"), - N_("[-all [-nojoin] | -open [-nojoin] | servername " - "[servername ...] [-nojoin] | hostname[/port] " - "[-option[=value]] [-nooption]]"), - N_(" -all: connect to all servers defined in " - "configuration\n" - " -open: connect to all opened servers that " - "are not currently connected\n" - "servername: internal server name to connect " + N_("[servername [servername ...] | hostname[/port] " + "[-option[=value]] [-nooption] | -all | -open] " + "[-nojoin] [-switch]"), + N_("servername: internal server name to connect " "(server must have been created by /server add)\n" - " -nojoin: do not join any channel (even if " - "autojoin is enabled on server)\n" - " hostname: hostname (or IP) of a server\n" + " hostname: hostname (or IP) of a server (this " + "will create a TEMPORARY server)\n" " port: port for server (6667 by default)\n" " option: set option for server (for boolean " "option, value can be omitted)\n" " nooption: set boolean option to 'off' (for " - "example: -nossl)\n\n" + "example: -nossl)\n" + " -all: connect to all servers defined in " + "configuration\n" + " -open: connect to all opened servers that " + "are not currently connected\n" + " -nojoin: do not join any channel (even if " + "autojoin is enabled on server)\n" + " -switch: switch to next server address\n\n" "Examples:\n" " /connect freenode\n" " /connect irc.oftc.net/6667\n" " /connect irc6.oftc.net/6667 -ipv6\n" " /connect irc6.oftc.net/6697 -ipv6 -ssl\n" - " /connect my.server.org/6697 -ssl -password=test"), - "-all|-open -nojoin" - " || %(irc_servers)|%*", + " /connect my.server.org/6697 -ssl -password=test\n" + " /connect -switch"), + "%(irc_servers)|-all|-open|-nojoin|-switch|%*", &irc_command_connect, NULL); weechat_hook_command ("ctcp", N_("send a CTCP message (Client-To-Client Protocol)"), @@ -4939,14 +4991,14 @@ irc_command_init () NULL, &irc_command_quote, NULL); weechat_hook_command ("reconnect", N_("reconnect to server(s)"), - N_("[-all [-nojoin] | servername [servername ...] " - "[-nojoin]]"), - N_(" -all: reconnect to all servers\n" - "servername: server name to reconnect\n" + N_("[servername [servername ...] | -all] [-nojoin] " + "[-switch]"), + N_("servername: server name to reconnect\n" + " -all: reconnect to all servers\n" " -nojoin: do not join any channel (even if " - "autojoin is enabled on server)"), - "-all -nojoin" - " || %(irc_servers)|-nojoin|%*", + "autojoin is enabled on server)\n" + " -switch: switch to next server address"), + "%(irc_servers)|-all|-nojoin|-switch|%*", &irc_command_reconnect, NULL); weechat_hook_command ("rehash", N_("tell the server to reload its config file"), diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h index ef9a9ca20..c81a7c538 100644 --- a/src/plugins/irc/irc-server.h +++ b/src/plugins/irc/irc-server.h @@ -257,6 +257,8 @@ extern void irc_server_set_away (struct t_irc_server *server, const char *nick, int is_away); extern void irc_server_remove_away (struct t_irc_server *server); extern void irc_server_check_away (struct t_irc_server *server); +extern void irc_server_switch_address (struct t_irc_server *server, + int connection); extern void irc_server_disconnect (struct t_irc_server *server, int switch_address, int reconnect); extern void irc_server_disconnect_all ();