1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

Add option "-open" for IRC command /connect

This commit is contained in:
Sebastien Helleu
2010-04-05 13:03:11 +02:00
parent a6e819f790
commit 9017a23013
14 changed files with 109 additions and 64 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
FlashCode <flashcode@flashtux.org>
v0.3.2-dev, 2010-03-31
v0.3.2-dev, 2010-04-05
Version 0.3.2 (under dev!)
@@ -74,6 +74,7 @@ Version 0.3.2 (under dev!)
* irc: bug with prefix "!" for mode "a" (channel admin) (bug #29109)
* irc: do not send signals "irc_in" and "irc_in2" when messages are ignored,
add new signals "irc_raw_in" and "irc_raw_in2"
* irc: add option "-open" for command /connect
* irc: add option irc.network.connection_timeout (timeout between TCP connection
to server and reception of message 001)
* irc: add options irc.look.smart_filter_join and irc.look.smart_filter_quit
+3 -2
View File
@@ -50,12 +50,13 @@
nickname: user or host to ban
........................................
&bull; *`/connect`* `[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-option[=value]] [-nooption]]`::
&bull; *`/connect`* `[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-option[=value]] [-nooption]]`::
........................................
connect to IRC server(s)
-all: connect to all servers
-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
+3 -2
View File
@@ -50,12 +50,13 @@
pseudo: pseudo ou hôte pour le bannissement
........................................
&bull; *`/connect`* `[-all [-nojoin] | nom_serveur [nom_serveur ...] [-nojoin] | nom[/port] [-option[=valeur]] [-nooption]]`::
&bull; *`/connect`* `[-all [-nojoin] | -open [-nojoin] | nom_serveur [nom_serveur ...] [-nojoin] | nom[/port] [-option[=valeur]] [-nooption]]`::
........................................
se connecter à un/plusieurs serveur(s) IRC
-all: se reconnecter à tous les serveurs
-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
+11 -10
View File
@@ -50,25 +50,26 @@
nick: utente o host da bannare
........................................
&bull; *`/connect`* `[-all [-nojoin] | nome_server [nome_server ...] [-nojoin] | nome_host[/porta] [-opzione[=valore]] [-nooption]`::
&bull; *`/connect`* `[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-option[=value]] [-nooption]]`::
........................................
connette ad uno o più server IRC
-all: connette a tutti i server
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)
-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
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)
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
........................................
&bull; *`/ctcp`* `destinatario tipo [argomenti]`::
+7 -4
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 12:50+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: 2010-03-23 10:19+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3239,15 +3239,18 @@ msgstr ""
msgid "connect to IRC server(s)"
msgstr "připojit se k IRC serveru/serverům"
#, fuzzy
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
"[-all [-nojoin] | jméno_serveru [jméno_serveru ...] [-nojoin] | jméno_hosta[/"
"port] [-volba[=hodnota]] [-novolba]]"
#, fuzzy
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
+7 -4
View File
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 19:50+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: 2010-04-04 12:20+0100\n"
"Last-Translator: Nils G <weechatter@arcor.de>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3412,15 +3412,18 @@ msgstr ""
msgid "connect to IRC server(s)"
msgstr "Mit IRC-Server(n) verbinden"
#, fuzzy
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
"[-all [-nojoin] | Servername [Servername ...] [-nojoin] | Hostname[/port] [-"
"option[=value]] [-nooption]]"
#, fuzzy
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
+7 -4
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 12:50+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: 2010-03-23 10:20+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3267,15 +3267,18 @@ msgstr ""
msgid "connect to IRC server(s)"
msgstr "conectar a un servidor IRC"
#, fuzzy
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
"[-all [-nojoin] | servidor [servidor ...] [-nojoin] | hostname[/puerto] [-"
"opción=[=valor]] [-noopción]]"
#, fuzzy
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
+11 -8
View File
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 12:50+0200\n"
"PO-Revision-Date: 2010-04-03 12:51+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: 2010-04-05 12:45+0200\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -3362,14 +3362,15 @@ msgid "connect to IRC server(s)"
msgstr "se connecter à un/plusieurs serveur(s) IRC"
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
"[-all [-nojoin] | nom_serveur [nom_serveur ...] [-nojoin] | nom[/port] [-"
"option[=valeur]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | nom_serveur [nom_serveur ...] [-nojoin] "
"| nom[/port] [-option[=valeur]] [-nooption]]"
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
@@ -3386,7 +3387,9 @@ msgid ""
" /connect irc6.oftc.net/6697 -ipv6 -ssl\n"
" /connect my.server.org/6697 -ssl -password=test"
msgstr ""
" -all: se reconnecter à tous les serveurs\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"
"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 "
+5 -4
View File
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 12:50+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: 2010-03-23 10:20+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3108,15 +3108,16 @@ msgstr "csatlakozás a szerver(ek)hez"
#, fuzzy
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
"[-all [-nojoin] | szervernév [szervernév ...] [-nojoin] | gépnév [-port "
"port] [-ipv6] [-ssl]]"
#, fuzzy
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
+7 -4
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Weechat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 12:50+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: 2010-03-24 14:20+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3327,15 +3327,18 @@ msgstr ""
msgid "connect to IRC server(s)"
msgstr "connette ad uno o più server IRC"
#, fuzzy
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
"[-all [-nojoin] | nome_server [nome_server ...] [-nojoin] | nome_host[/"
"porta] [-opzione[=valore]] [-nooption]"
#, fuzzy
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
+7 -4
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 12:50+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: 2010-03-23 10:20+0100\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: Polish\n"
@@ -3273,15 +3273,18 @@ msgstr ""
msgid "connect to IRC server(s)"
msgstr "łączy się z serwerem(ami) IRC"
#, fuzzy
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
"[-all [-nojoin] | nazwa_serwera [nazwa_serwera ...] [-nojoin] | nazwa_hosta[/"
"port] [-opcja[=wartość]] [-noopcja]]"
#, fuzzy
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
+5 -4
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 12:50+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: 2010-03-23 10:20+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3120,15 +3120,16 @@ msgstr "подключиться к серверу(-ам)"
#, fuzzy
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
"[-all [-nojoin] | сервер [servername ...] [-nojoin] | адрес [-port порт] [-"
"ipv6] [-ssl]]"
#, fuzzy
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
+5 -4
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-04-03 12:50+0200\n"
"POT-Creation-Date: 2010-04-05 12:44+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2724,12 +2724,13 @@ msgid "connect to IRC server(s)"
msgstr ""
msgid ""
"[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname[/port] [-"
"option[=value]] [-nooption]]"
"[-all [-nojoin] | -open [-nojoin] | servername [servername ...] [-nojoin] | "
"hostname[/port] [-option[=value]] [-nooption]]"
msgstr ""
msgid ""
" -all: connect to all servers\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 (server must have been created "
"by /server add)\n"
" -nojoin: do not join any channel (even if autojoin is enabled on server)\n"
+29 -9
View File
@@ -698,7 +698,7 @@ 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, no_join;
int i, nb_connect, connect_ok, all_servers, all_opened, no_join;
char *name;
IRC_BUFFER_GET_SERVER(buffer);
@@ -711,27 +711,44 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
connect_ok = 1;
all_servers = 0;
all_opened = 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], "-open") == 0)
all_opened = 1;
else if (weechat_strcasecmp (argv[i], "-nojoin") == 0)
no_join = 1;
}
if (all_servers)
if (all_opened)
{
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->buffer
&& !ptr_server->is_connected && (!ptr_server->hook_connect))
{
if (!irc_command_connect_one_server (ptr_server, no_join))
connect_ok = 0;
}
}
return (connect_ok) ? WEECHAT_RC_OK : WEECHAT_RC_ERROR;
}
else if (all_servers)
{
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
nb_connect++;
if (!ptr_server->is_connected && (!ptr_server->hook_connect))
{
if (!irc_command_connect_one_server (ptr_server, no_join))
connect_ok = 0;
}
}
return (connect_ok) ? WEECHAT_RC_OK : WEECHAT_RC_ERROR;
}
else
{
@@ -4226,10 +4243,13 @@ irc_command_init ()
"%(irc_channel_nicks_hosts)", &irc_command_ban, NULL);
weechat_hook_command ("connect",
N_("connect to IRC server(s)"),
N_("[-all [-nojoin] | servername [servername ...] "
"[-nojoin] | hostname[/port] [-option[=value]] "
"[-nooption]]"),
N_(" -all: connect to all servers\n"
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 "
"(server must have been created by /server add)\n"
" -nojoin: do not join any channel (even if "
@@ -4246,7 +4266,7 @@ irc_command_init ()
" /connect irc6.oftc.net/6667 -ipv6\n"
" /connect irc6.oftc.net/6697 -ipv6 -ssl\n"
" /connect my.server.org/6697 -ssl -password=test"),
"-all -nojoin"
"-all|-open -nojoin"
" || %(irc_servers)|%*",
&irc_command_connect, NULL);
weechat_hook_command ("ctcp",