summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc1
-rw-r--r--doc/de/autogen/plugin_api/hdata.adoc1
-rw-r--r--doc/en/autogen/plugin_api/hdata.adoc1
-rw-r--r--doc/fr/autogen/plugin_api/hdata.adoc1
-rw-r--r--doc/it/autogen/plugin_api/hdata.adoc1
-rw-r--r--doc/ja/autogen/plugin_api/hdata.adoc1
-rw-r--r--doc/pl/autogen/plugin_api/hdata.adoc1
-rw-r--r--po/cs.po23
-rw-r--r--po/de.po27
-rw-r--r--po/es.po23
-rw-r--r--po/fr.po25
-rw-r--r--po/hu.po19
-rw-r--r--po/it.po23
-rw-r--r--po/ja.po27
-rw-r--r--po/pl.po27
-rw-r--r--po/pt.po25
-rw-r--r--po/pt_BR.po23
-rw-r--r--po/ru.po19
-rw-r--r--po/tr.po19
-rw-r--r--po/weechat.pot17
-rw-r--r--src/plugins/irc/irc-command.c181
-rw-r--r--src/plugins/irc/irc-command.h8
-rw-r--r--src/plugins/irc/irc-server.c115
-rw-r--r--src/plugins/irc/irc-server.h1
-rw-r--r--src/plugins/irc/irc-upgrade.c2
25 files changed, 353 insertions, 258 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 9256a7f8a..10d65754a 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -25,6 +25,7 @@ New features::
* api: add functions crypto_hash and crypto_hash_pbkdf2
* api: add info "weechat_headless" (issue #1433)
* buflist: add pointer "window" in bar item evaluation
+ * irc: add support of fake servers (no I/O, for testing purposes)
* relay: accept hash of password in init command of weechat protocol with option "password_hash" (PBKDF2, SHA256, SHA512)
* relay: reject client with weechat protocol if password or totp is received in init command but not set in WeeChat (issue #1435)
diff --git a/doc/de/autogen/plugin_api/hdata.adoc b/doc/de/autogen/plugin_api/hdata.adoc
index 63ba3a226..5d315765e 100644
--- a/doc/de/autogen/plugin_api/hdata.adoc
+++ b/doc/de/autogen/plugin_api/hdata.adoc
@@ -213,6 +213,7 @@ _last_irc_server_ +
| _name_   (string) +
_options_   (pointer) +
_temp_server_   (integer) +
+_fake_server_   (integer) +
_reloading_from_config_   (integer) +
_reloaded_from_config_   (integer) +
_addresses_eval_   (string) +
diff --git a/doc/en/autogen/plugin_api/hdata.adoc b/doc/en/autogen/plugin_api/hdata.adoc
index b67f93b2a..12fe97861 100644
--- a/doc/en/autogen/plugin_api/hdata.adoc
+++ b/doc/en/autogen/plugin_api/hdata.adoc
@@ -213,6 +213,7 @@ _last_irc_server_ +
| _name_   (string) +
_options_   (pointer) +
_temp_server_   (integer) +
+_fake_server_   (integer) +
_reloading_from_config_   (integer) +
_reloaded_from_config_   (integer) +
_addresses_eval_   (string) +
diff --git a/doc/fr/autogen/plugin_api/hdata.adoc b/doc/fr/autogen/plugin_api/hdata.adoc
index 38bb0e664..d78b8f9c1 100644
--- a/doc/fr/autogen/plugin_api/hdata.adoc
+++ b/doc/fr/autogen/plugin_api/hdata.adoc
@@ -213,6 +213,7 @@ _last_irc_server_ +
| _name_   (string) +
_options_   (pointer) +
_temp_server_   (integer) +
+_fake_server_   (integer) +
_reloading_from_config_   (integer) +
_reloaded_from_config_   (integer) +
_addresses_eval_   (string) +
diff --git a/doc/it/autogen/plugin_api/hdata.adoc b/doc/it/autogen/plugin_api/hdata.adoc
index 18b6e7e6c..e8d5d0228 100644
--- a/doc/it/autogen/plugin_api/hdata.adoc
+++ b/doc/it/autogen/plugin_api/hdata.adoc
@@ -213,6 +213,7 @@ _last_irc_server_ +
| _name_   (string) +
_options_   (pointer) +
_temp_server_   (integer) +
+_fake_server_   (integer) +
_reloading_from_config_   (integer) +
_reloaded_from_config_   (integer) +
_addresses_eval_   (string) +
diff --git a/doc/ja/autogen/plugin_api/hdata.adoc b/doc/ja/autogen/plugin_api/hdata.adoc
index bfdd3e259..2a076d869 100644
--- a/doc/ja/autogen/plugin_api/hdata.adoc
+++ b/doc/ja/autogen/plugin_api/hdata.adoc
@@ -213,6 +213,7 @@ _last_irc_server_ +
| _name_   (string) +
_options_   (pointer) +
_temp_server_   (integer) +
+_fake_server_   (integer) +
_reloading_from_config_   (integer) +
_reloaded_from_config_   (integer) +
_addresses_eval_   (string) +
diff --git a/doc/pl/autogen/plugin_api/hdata.adoc b/doc/pl/autogen/plugin_api/hdata.adoc
index 74554d5e5..107430bd2 100644
--- a/doc/pl/autogen/plugin_api/hdata.adoc
+++ b/doc/pl/autogen/plugin_api/hdata.adoc
@@ -213,6 +213,7 @@ _last_irc_server_ +
| _name_   (string) +
_options_   (pointer) +
_temp_server_   (integer) +
+_fake_server_   (integer) +
_reloading_from_config_   (integer) +
_reloaded_from_config_   (integer) +
_addresses_eval_   (string) +
diff --git a/po/cs.po b/po/cs.po
index 2d95f3fc5..92183be80 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2019-11-03 08:38+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: cs\n"
@@ -6203,8 +6203,12 @@ msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s%s: zrovna připojuji k serveru \"%s\"!"
#, fuzzy, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr "%s: server %s%s%s již není dočasným"
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s: server %s%s%s přidán"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (dočasný)"
#, fuzzy, c-format
msgid ""
@@ -6371,7 +6375,7 @@ msgid "nick:"
msgstr "přezdívka"
#, fuzzy, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "Server: %s%s %s[%s%s%s]%s%s"
msgid "connected"
@@ -6380,8 +6384,9 @@ msgstr "připojen"
msgid "not connected"
msgstr "nepřipojen"
-msgid " (temporary)"
-msgstr " (dočasný)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr ""
msgid "minute"
msgid_plural "minutes"
@@ -6418,10 +6423,6 @@ msgid "%s%s: unable to add server"
msgstr "%s%s: nemohu přidat server"
#, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s: server %s%s%s přidán"
-
-#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s%s: server \"%s\" pro příkaz \"%s\" nenalezen"
diff --git a/po/de.po b/po/de.po
index b31acd5ed..c7a8e9fe9 100644
--- a/po/de.po
+++ b/po/de.po
@@ -24,8 +24,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2020-02-26 15:36+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
"Language: de\n"
@@ -7661,9 +7661,13 @@ msgstr "%s%s: es besteht bereits eine Verbindung zum Server \"%s\"!"
msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s%s: ein Verbindungsaufbau zum Server \"%s\" läuft bereits!"
-#, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr "%s: Server %s%s%s angelegt (temporärer Server, WIRD NICHT GESICHERT!)"
+#, fuzzy, c-format
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s: Server %s%s%s wurde angelegt"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (temporär)"
#, c-format
msgid ""
@@ -7841,8 +7845,8 @@ msgstr "%s%s: ein neuer privater Buffer \"%s\" kann nicht erstellt werden"
msgid "nick:"
msgstr "Nick:"
-#, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+#, fuzzy, c-format
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "Server: %s%s %s[%s%s%s]%s%s%s"
msgid "connected"
@@ -7851,8 +7855,9 @@ msgstr "verbunden"
msgid "not connected"
msgstr "nicht verbunden"
-msgid " (temporary)"
-msgstr " (temporär)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr ""
msgid "minute"
msgid_plural "minutes"
@@ -7889,10 +7894,6 @@ msgid "%s%s: unable to add server"
msgstr "%s%s: Server kann nicht anlegt werden"
#, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s: Server %s%s%s wurde angelegt"
-
-#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s%s: Server \"%s\" wurde für den Befehl \"%s\" nicht gefunden"
diff --git a/po/es.po b/po/es.po
index 48bba61fb..88ca063e7 100644
--- a/po/es.po
+++ b/po/es.po
@@ -22,8 +22,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2019-11-03 08:38+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: es\n"
@@ -6418,8 +6418,12 @@ msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s%s: ¡actualmente conectando al servidor \"%s\"!"
#, fuzzy, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr "%s: servidor %s%s%s creado (temporalmente, ¡SIN GUARDAR!)"
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s: servidor %s%s%s creado"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (temporal)"
#, fuzzy, c-format
msgid ""
@@ -6586,7 +6590,7 @@ msgid "nick:"
msgstr "apodo"
#, fuzzy, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "Servidor: %s%s %s[%s%s%s]%s%s"
msgid "connected"
@@ -6595,8 +6599,9 @@ msgstr "conectado"
msgid "not connected"
msgstr "no conectado"
-msgid " (temporary)"
-msgstr " (temporal)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr ""
msgid "minute"
msgid_plural "minutes"
@@ -6630,10 +6635,6 @@ msgstr "%s%s: el servidor \"%s\" ya existe, ¡no se puede crear!"
msgid "%s%s: unable to add server"
msgstr "%s%s: no es posible crear el servidor"
-#, fuzzy, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s: servidor %s%s%s creado"
-
#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s%s: no se encontró el servidor \"%s\" para el comando \"%s\""
diff --git a/po/fr.po b/po/fr.po
index 97569353d..647e3cfb1 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2020-02-04 21:58+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -7504,8 +7504,12 @@ msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s%s : une connexion vers le serveur \"%s\" est en cours !"
#, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr "%s : serveur %s%s%s ajouté (serveur temporaire, NON SAUVÉ !)"
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s : serveur ajouté : %s%s%s%s%s"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (temporaire)"
#, c-format
msgid ""
@@ -7680,8 +7684,8 @@ msgid "nick:"
msgstr "pseudo :"
#, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
-msgstr "Serveur : %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
+msgstr "Serveur : %s%s %s[%s%s%s]%s%s%s%s"
msgid "connected"
msgstr "connecté"
@@ -7689,8 +7693,9 @@ msgstr "connecté"
msgid "not connected"
msgstr "non connecté"
-msgid " (temporary)"
-msgstr " (temporaire)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr " (faux)"
msgid "minute"
msgid_plural "minutes"
@@ -7725,10 +7730,6 @@ msgid "%s%s: unable to add server"
msgstr "%s%s : impossible d'ajouter le serveur"
#, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s : serveur %s%s%s ajouté"
-
-#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s%s : le serveur \"%s\" n'existe pas pour la commande \"%s\""
diff --git a/po/hu.po b/po/hu.po
index 09d916443..4beab8b69 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,8 +20,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2019-11-03 08:38+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: hu\n"
@@ -5727,9 +5727,13 @@ msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s éppen kapcsolódik a(z) \"%s\" szerverhez!\n"
#, fuzzy, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
+msgid "%s: server added: %s%s%s%s%s"
msgstr "A %s%s%s szerver létrehozva\n"
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr ""
+
#, c-format
msgid ""
"%s%s: unable to add temporary server \"%s\" because the addition of "
@@ -5888,7 +5892,7 @@ msgid "nick:"
msgstr "név"
#, fuzzy, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "%s Szerver: %s%s %s[%s%s%s]\n"
msgid "connected"
@@ -5897,7 +5901,8 @@ msgstr "csatlakozva"
msgid "not connected"
msgstr "nincs csatlakozva"
-msgid " (temporary)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
msgstr ""
#, fuzzy
@@ -5937,10 +5942,6 @@ msgid "%s%s: unable to add server"
msgstr "%s nem sikerült a szervert létrehozni\n"
#, fuzzy, c-format
-msgid "%s: server %s%s%s added"
-msgstr "A %s%s%s szerver létrehozva\n"
-
-#, fuzzy, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s a \"%s\" szerver nem található a \"%s\" parancshoz\n"
diff --git a/po/it.po b/po/it.po
index 81033c0cc..876dc67ad 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,8 +20,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2019-11-03 08:38+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: it\n"
@@ -6586,8 +6586,12 @@ msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s%s: la connessione al server \"%s\" è già in corso!"
#, fuzzy, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr "%s: server %s%s%s creato (server temporaneo, NON SALVATO!)"
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s: server %s%s%s creato"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (temporaneo)"
#, fuzzy, c-format
msgid ""
@@ -6758,7 +6762,7 @@ msgid "nick:"
msgstr "nick"
#, fuzzy, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "Server: %s%s %s[%s%s%s]%s%s"
msgid "connected"
@@ -6767,8 +6771,9 @@ msgstr "connesso"
msgid "not connected"
msgstr "non connesso"
-msgid " (temporary)"
-msgstr " (temporaneo)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr ""
msgid "minute"
msgid_plural "minutes"
@@ -6802,10 +6807,6 @@ msgstr "%s%s: il server \"%s\" esiste già, impossibile crearlo!"
msgid "%s%s: unable to add server"
msgstr "%s%s: impossibile creare il server"
-#, fuzzy, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s: server %s%s%s creato"
-
#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s%s: server \"%s\" non trovato per il comando \"%s\""
diff --git a/po/ja.po b/po/ja.po
index d42eea404..014427365 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -20,8 +20,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2019-11-03 08:38+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
"translation/ja_JP>\n"
@@ -7171,9 +7171,13 @@ msgstr "%s%s: サーバ \"%s\" には接続済み!"
msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s%s: サーバ \"%s\" に接続試行中!"
-#, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr "%s: サーバ %s%s%s を追加しました (これは一時的で、保存されません!)"
+#, fuzzy, c-format
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s: サーバ %s%s%s を追加"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (一時的)"
#, c-format
msgid ""
@@ -7340,8 +7344,8 @@ msgstr "%s%s: 新しいプライベートバッファ \"%s\" の作成に失敗"
msgid "nick:"
msgstr "ニックネーム:"
-#, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+#, fuzzy, c-format
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "サーバ: %s%s %s[%s%s%s]%s%s%s"
msgid "connected"
@@ -7350,8 +7354,9 @@ msgstr "接続済み"
msgid "not connected"
msgstr "未接続"
-msgid " (temporary)"
-msgstr " (一時的)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr ""
msgid "minute"
msgid_plural "minutes"
@@ -7384,10 +7389,6 @@ msgid "%s%s: unable to add server"
msgstr "%s%s: サーバの追加に失敗"
#, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s: サーバ %s%s%s を追加"
-
-#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%1$s%2$s: \"%4$s\" コマンドのサーバ \"%3$s\" は見つかりません"
diff --git a/po/pl.po b/po/pl.po
index 5e3c39091..d15dabc97 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -22,8 +22,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2019-12-01 16:23+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
"Language: pl\n"
@@ -7310,9 +7310,13 @@ msgstr "%s%s: już połączony z serwerem \"%s\"!"
msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s%s: obecnie łączę się z serwerem \"%s\"!"
-#, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr "%s: dodano serwer %s%s%s (tymczasowy serwer, NIE ZAPISANO!)"
+#, fuzzy, c-format
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s: dodano serwer %s%s%s"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (tymczasowy)"
#, c-format
msgid ""
@@ -7482,8 +7486,8 @@ msgstr "%s%s: nie można utworzyć nowego bufora prywatnego \"%s\""
msgid "nick:"
msgstr "nick:"
-#, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+#, fuzzy, c-format
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "Serwer: %s%s %s[%s%s%s]%s%s%s"
msgid "connected"
@@ -7492,8 +7496,9 @@ msgstr "połączony"
msgid "not connected"
msgstr "nie połączony"
-msgid " (temporary)"
-msgstr " (tymczasowy)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr ""
msgid "minute"
msgid_plural "minutes"
@@ -7530,10 +7535,6 @@ msgid "%s%s: unable to add server"
msgstr "%s%s: nie można dodać serwera"
#, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s: dodano serwer %s%s%s"
-
-#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s%s: serwer \"%s\" nie został znaleziony dla komendy \"%s\""
diff --git a/po/pt.po b/po/pt.po
index d50650f76..dd4fdaaa2 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -20,8 +20,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2019-11-03 08:38+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
"Language: pt\n"
@@ -6954,9 +6954,13 @@ msgstr "%s%s: já está conectado ao servidor \"%s\"!"
msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s%s: a conectar-se ao servidor \"%s\" neste momento!"
-#, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr "%s: servidor %s%s%s adicionado (servidor temporário, NÃO GUARDADO!)"
+#, fuzzy, c-format
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s: servidor %s%s%s adicionado"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (temporário)"
#, c-format
msgid ""
@@ -7129,7 +7133,7 @@ msgid "nick:"
msgstr "nick"
#, fuzzy, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "Servidor: %s%s %s[%s%s%s]%s%s"
msgid "connected"
@@ -7138,8 +7142,9 @@ msgstr "conectado"
msgid "not connected"
msgstr "não conectado"
-msgid " (temporary)"
-msgstr " (temporário)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr ""
msgid "minute"
msgid_plural "minutes"
@@ -7174,10 +7179,6 @@ msgid "%s%s: unable to add server"
msgstr "%s%s: não é possível adicionar servidor"
#, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s: servidor %s%s%s adicionado"
-
-#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s%s: o servidor \"%s\" do comando \"%s\" não foi encontrado"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 9262008ad..37f6da094 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
"PO-Revision-Date: 2019-11-03 08:38+0100\n"
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6374,9 +6374,13 @@ msgstr ""
msgid "%s%s: currently connecting to server \"%s\"!"
msgstr ""
-#, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
-msgstr ""
+#, fuzzy, c-format
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "Todos os filtros foram excluídos"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr " (temporário)"
#, fuzzy, c-format
msgid ""
@@ -6538,7 +6542,7 @@ msgid "nick:"
msgstr "apelido"
#, fuzzy, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "Servidor: %s%s %s[%s%s%s]%s%s"
msgid "connected"
@@ -6547,8 +6551,9 @@ msgstr "conectado"
msgid "not connected"
msgstr "não conectado"
-msgid " (temporary)"
-msgstr " (temporário)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
+msgstr ""
msgid "minute"
msgid_plural "minutes"
@@ -6582,10 +6587,6 @@ msgstr "%sErro: filtro \"%s\" já existe"
msgid "%s%s: unable to add server"
msgstr "%s%s: não foi possível redirecionar saída de erro (stderr)"
-#, fuzzy, c-format
-msgid "%s: server %s%s%s added"
-msgstr "Todos os filtros foram excluídos"
-
#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr ""
diff --git a/po/ru.po b/po/ru.po
index 99a781373..3a966ecec 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
-"PO-Revision-Date: 2019-11-03 08:38+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
+"PO-Revision-Date: 2020-03-08 14:22+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: ru\n"
@@ -5764,9 +5764,13 @@ msgid "%s%s: currently connecting to server \"%s\"!"
msgstr "%s подключается к серверу \"%s\"!\n"
#, fuzzy, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
+msgid "%s: server added: %s%s%s%s%s"
msgstr "Сервер %s%s%s создан\n"
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
+msgstr ""
+
#, c-format
msgid ""
"%s%s: unable to add temporary server \"%s\" because the addition of "
@@ -5926,7 +5930,7 @@ msgid "nick:"
msgstr "ник"
#, fuzzy, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "%sСервер: %s%s %s[%s%s%s]\n"
msgid "connected"
@@ -5935,7 +5939,8 @@ msgstr "подключен"
msgid "not connected"
msgstr "отключен"
-msgid " (temporary)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
msgstr ""
#, fuzzy
@@ -5977,10 +5982,6 @@ msgid "%s%s: unable to add server"
msgstr "%s не могу создать сервер\n"
#, fuzzy, c-format
-msgid "%s: server %s%s%s added"
-msgstr "Сервер %s%s%s создан\n"
-
-#, fuzzy, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr "%s сервер \"%s\" не найден для команды \"%s\"\n"
diff --git a/po/tr.po b/po/tr.po
index 43d8959d6..6d6347255 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
"PO-Revision-Date: 2019-11-03 08:38+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5289,8 +5289,12 @@ msgstr ""
msgid "%s%s: currently connecting to server \"%s\"!"
msgstr ""
-#, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
+#, fuzzy, c-format
+msgid "%s: server added: %s%s%s%s%s"
+msgstr "%s: sunucu %s%s%s oluşturuldu"
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
msgstr ""
#, c-format
@@ -5451,7 +5455,7 @@ msgid "nick:"
msgstr "rumuz"
#, fuzzy, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr "Sunucu: %s%s %s[%s%s%s]%s%s"
msgid "connected"
@@ -5460,7 +5464,8 @@ msgstr "bağlandı"
msgid "not connected"
msgstr "bağlanmadı"
-msgid " (temporary)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
msgstr ""
msgid "minute"
@@ -5493,10 +5498,6 @@ msgstr "Filtre \"%s\" etkin"
msgid "%s%s: unable to add server"
msgstr "%s%s: sunucuya yeniden bağlanılıyor..."
-#, fuzzy, c-format
-msgid "%s: server %s%s%s added"
-msgstr "%s: sunucu %s%s%s oluşturuldu"
-
#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index 720e3ab41..23eedbc1a 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2019-12-26 22:25+0100\n"
+"POT-Creation-Date: 2020-03-08 14:21+0100\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5231,7 +5231,11 @@ msgid "%s%s: currently connecting to server \"%s\"!"
msgstr ""
#, c-format
-msgid "%s: server %s%s%s added (temporary server, NOT SAVED!)"
+msgid "%s: server added: %s%s%s%s%s"
+msgstr ""
+
+#. TRANSLATORS: "temporary IRC server"
+msgid " (temporary)"
msgstr ""
#, c-format
@@ -5391,7 +5395,7 @@ msgid "nick:"
msgstr ""
#, c-format
-msgid "Server: %s%s %s[%s%s%s]%s%s%s"
+msgid "Server: %s%s %s[%s%s%s]%s%s%s%s"
msgstr ""
msgid "connected"
@@ -5400,7 +5404,8 @@ msgstr ""
msgid "not connected"
msgstr ""
-msgid " (temporary)"
+#. TRANSLATORS: "fake IRC server"
+msgid " (fake)"
msgstr ""
msgid "minute"
@@ -5436,10 +5441,6 @@ msgid "%s%s: unable to add server"
msgstr ""
#, c-format
-msgid "%s: server %s%s%s added"
-msgstr ""
-
-#, c-format
msgid "%s%s: server \"%s\" not found for \"%s\" command"
msgstr ""
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 1abfb24aa..8ff1caa0c 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -360,7 +360,7 @@ irc_command_mode_masks (struct t_irc_server *server,
IRC_COMMAND_CALLBACK(admin)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("admin", 1);
+ IRC_COMMAND_CHECK_SERVER("admin", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -1182,7 +1182,7 @@ IRC_COMMAND_CALLBACK(ban)
int pos_args;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("ban", 1);
+ IRC_COMMAND_CHECK_SERVER("ban", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -1263,7 +1263,7 @@ IRC_COMMAND_CALLBACK(cap)
char *cap_cmd;
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("cap", 1);
+ IRC_COMMAND_CHECK_SERVER("cap", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -1494,12 +1494,13 @@ IRC_COMMAND_CALLBACK(connect)
argv[i], 1);
weechat_printf (
NULL,
- _("%s: server %s%s%s added "
- "(temporary server, NOT SAVED!)"),
+ _("%s: server added: %s%s%s%s%s"),
IRC_PLUGIN_NAME,
IRC_COLOR_CHAT_SERVER,
ptr_server->name,
- IRC_COLOR_RESET);
+ IRC_COLOR_RESET,
+ _(" (temporary)"),
+ "");
irc_server_apply_command_line_options (ptr_server,
argc, argv);
if (!irc_command_connect_one_server (ptr_server, 0, 0))
@@ -1584,7 +1585,7 @@ IRC_COMMAND_CALLBACK(ctcp)
arg_args = 5;
}
- IRC_COMMAND_CHECK_SERVER("ctcp", 1);
+ IRC_COMMAND_CHECK_SERVER("ctcp", 1, 1);
targets = weechat_string_split (argv[arg_target], ",", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
@@ -1683,7 +1684,7 @@ IRC_COMMAND_CALLBACK(cycle)
int i, num_channels;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("cycle", 1);
+ IRC_COMMAND_CHECK_SERVER("cycle", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -1792,7 +1793,7 @@ IRC_COMMAND_CALLBACK(dcc)
int rc;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("dcc", 1);
+ IRC_COMMAND_CHECK_SERVER("dcc", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -1883,7 +1884,7 @@ IRC_COMMAND_CALLBACK(dcc)
IRC_COMMAND_CALLBACK(dehalfop)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("dehalfop", 1);
+ IRC_COMMAND_CHECK_SERVER("dehalfop", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -1922,7 +1923,7 @@ IRC_COMMAND_CALLBACK(dehalfop)
IRC_COMMAND_CALLBACK(deop)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("deop", 1);
+ IRC_COMMAND_CHECK_SERVER("deop", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -1961,7 +1962,7 @@ IRC_COMMAND_CALLBACK(deop)
IRC_COMMAND_CALLBACK(devoice)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("devoice", 1);
+ IRC_COMMAND_CHECK_SERVER("devoice", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2000,7 +2001,7 @@ IRC_COMMAND_CALLBACK(devoice)
IRC_COMMAND_CALLBACK(die)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("die", 1);
+ IRC_COMMAND_CHECK_SERVER("die", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2175,7 +2176,7 @@ IRC_COMMAND_CALLBACK(disconnect)
IRC_COMMAND_CALLBACK(halfop)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("halfop", 1);
+ IRC_COMMAND_CHECK_SERVER("halfop", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2402,7 +2403,7 @@ IRC_COMMAND_CALLBACK(ignore)
IRC_COMMAND_CALLBACK(info)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("info", 1);
+ IRC_COMMAND_CHECK_SERVER("info", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2433,7 +2434,7 @@ IRC_COMMAND_CALLBACK(invite)
char *ptr_channel_name;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("invite", 1);
+ IRC_COMMAND_CHECK_SERVER("invite", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2494,7 +2495,7 @@ error:
IRC_COMMAND_CALLBACK(ison)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("ison", 1);
+ IRC_COMMAND_CHECK_SERVER("ison", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2523,7 +2524,7 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments,
time_t time_now;
struct t_irc_channel *ptr_channel;
- if (server->sock < 0)
+ if ((server->sock < 0) && !server->fake_server)
{
weechat_printf (
NULL,
@@ -2713,7 +2714,7 @@ IRC_COMMAND_CALLBACK(join)
}
}
- IRC_COMMAND_CHECK_SERVER("join", 1);
+ IRC_COMMAND_CHECK_SERVER("join", 1, 1);
if (arg_channels < argc)
{
@@ -2792,7 +2793,7 @@ IRC_COMMAND_CALLBACK(kick)
char *pos_channel, *pos_nick, *pos_comment;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("kick", 1);
+ IRC_COMMAND_CHECK_SERVER("kick", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2840,7 +2841,7 @@ IRC_COMMAND_CALLBACK(kickban)
int length;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("kickban", 1);
+ IRC_COMMAND_CHECK_SERVER("kickban", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2931,7 +2932,7 @@ IRC_COMMAND_CALLBACK(kickban)
IRC_COMMAND_CALLBACK(kill)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("kill", 1);
+ IRC_COMMAND_CHECK_SERVER("kill", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -2961,7 +2962,7 @@ IRC_COMMAND_CALLBACK(kill)
IRC_COMMAND_CALLBACK(links)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("links", 1);
+ IRC_COMMAND_CHECK_SERVER("links", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3029,7 +3030,7 @@ IRC_COMMAND_CALLBACK(list)
WEECHAT_COMMAND_ERROR;
}
- IRC_COMMAND_CHECK_SERVER("list", 1);
+ IRC_COMMAND_CHECK_SERVER("list", 1, 1);
if (ptr_regex)
{
@@ -3089,7 +3090,7 @@ IRC_COMMAND_CALLBACK(list)
IRC_COMMAND_CALLBACK(lusers)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("lusers", 1);
+ IRC_COMMAND_CHECK_SERVER("lusers", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3117,7 +3118,7 @@ IRC_COMMAND_CALLBACK(lusers)
IRC_COMMAND_CALLBACK(map)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("map", 1);
+ IRC_COMMAND_CHECK_SERVER("map", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3145,7 +3146,7 @@ IRC_COMMAND_CALLBACK(map)
IRC_COMMAND_CALLBACK(me)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("me", 1);
+ IRC_COMMAND_CHECK_SERVER("me", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3203,7 +3204,7 @@ irc_command_mode_server (struct t_irc_server *server,
IRC_COMMAND_CALLBACK(mode)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("mode", 1);
+ IRC_COMMAND_CHECK_SERVER("mode", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3259,7 +3260,7 @@ IRC_COMMAND_CALLBACK(mode)
IRC_COMMAND_CALLBACK(motd)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("motd", 1);
+ IRC_COMMAND_CHECK_SERVER("motd", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3310,7 +3311,7 @@ IRC_COMMAND_CALLBACK(msg)
arg_text = 4;
}
- IRC_COMMAND_CHECK_SERVER("msg", 1);
+ IRC_COMMAND_CHECK_SERVER("msg", 1, 1);
targets = weechat_string_split (argv[arg_target], ",", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
@@ -3501,7 +3502,7 @@ IRC_COMMAND_CALLBACK(msg)
IRC_COMMAND_CALLBACK(names)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("names", 1);
+ IRC_COMMAND_CHECK_SERVER("names", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3559,7 +3560,7 @@ irc_send_nick_server (struct t_irc_server *server, const char *nickname)
IRC_COMMAND_CALLBACK(nick)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("nick", 0);
+ IRC_COMMAND_CHECK_SERVER("nick", 0, 0);
/* make C compiler happy */
(void) pointer;
@@ -3612,7 +3613,7 @@ IRC_COMMAND_CALLBACK(notice)
arg_text = 4;
}
- IRC_COMMAND_CHECK_SERVER("notice", 1);
+ IRC_COMMAND_CHECK_SERVER("notice", 1, 1);
is_channel = 0;
if (irc_server_prefix_char_statusmsg (ptr_server, argv[arg_target][0])
&& irc_channel_is_channel (ptr_server, argv[arg_target] + 1))
@@ -3863,7 +3864,7 @@ IRC_COMMAND_CALLBACK(notify)
IRC_COMMAND_CALLBACK(op)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("op", 1);
+ IRC_COMMAND_CHECK_SERVER("op", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3902,7 +3903,7 @@ IRC_COMMAND_CALLBACK(op)
IRC_COMMAND_CALLBACK(oper)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("oper", 1);
+ IRC_COMMAND_CHECK_SERVER("oper", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -3957,7 +3958,7 @@ IRC_COMMAND_CALLBACK(part)
char *channel_name, *pos_args;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("part", 1);
+ IRC_COMMAND_CHECK_SERVER("part", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4023,7 +4024,7 @@ IRC_COMMAND_CALLBACK(part)
IRC_COMMAND_CALLBACK(ping)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("ping", 1);
+ IRC_COMMAND_CHECK_SERVER("ping", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4045,7 +4046,7 @@ IRC_COMMAND_CALLBACK(ping)
IRC_COMMAND_CALLBACK(pong)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("pong", 0);
+ IRC_COMMAND_CHECK_SERVER("pong", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4111,7 +4112,7 @@ IRC_COMMAND_CALLBACK(query)
if (arg_nick >= argc)
WEECHAT_COMMAND_ERROR;
- IRC_COMMAND_CHECK_SERVER("query", 1);
+ IRC_COMMAND_CHECK_SERVER("query", 1, 1);
nicks = weechat_string_split (argv[arg_nick], ",", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
@@ -4187,7 +4188,7 @@ IRC_COMMAND_CALLBACK(quiet)
int pos_args;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("quiet", 1);
+ IRC_COMMAND_CHECK_SERVER("quiet", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4425,7 +4426,7 @@ IRC_COMMAND_CALLBACK(reconnect)
IRC_COMMAND_CALLBACK(rehash)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("rehash", 1);
+ IRC_COMMAND_CHECK_SERVER("rehash", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4457,7 +4458,7 @@ IRC_COMMAND_CALLBACK(remove)
int index_nick;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("remove", 1);
+ IRC_COMMAND_CHECK_SERVER("remove", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4515,7 +4516,7 @@ IRC_COMMAND_CALLBACK(remove)
IRC_COMMAND_CALLBACK(restart)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("restart", 1);
+ IRC_COMMAND_CHECK_SERVER("restart", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4543,7 +4544,7 @@ IRC_COMMAND_CALLBACK(restart)
IRC_COMMAND_CALLBACK(sajoin)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("sajoin", 1);
+ IRC_COMMAND_CHECK_SERVER("sajoin", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4565,7 +4566,7 @@ IRC_COMMAND_CALLBACK(sajoin)
IRC_COMMAND_CALLBACK(samode)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("samode", 1);
+ IRC_COMMAND_CHECK_SERVER("samode", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4624,7 +4625,7 @@ IRC_COMMAND_CALLBACK(samode)
IRC_COMMAND_CALLBACK(sanick)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("sanick", 1);
+ IRC_COMMAND_CHECK_SERVER("sanick", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4645,7 +4646,7 @@ IRC_COMMAND_CALLBACK(sanick)
IRC_COMMAND_CALLBACK(sapart)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("sapart", 1);
+ IRC_COMMAND_CHECK_SERVER("sapart", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4666,7 +4667,7 @@ IRC_COMMAND_CALLBACK(sapart)
IRC_COMMAND_CALLBACK(saquit)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("saquit", 1);
+ IRC_COMMAND_CHECK_SERVER("saquit", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -4702,7 +4703,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail)
if (with_detail)
{
weechat_printf (NULL, "");
- weechat_printf (NULL, _("Server: %s%s %s[%s%s%s]%s%s%s"),
+ weechat_printf (NULL, _("Server: %s%s %s[%s%s%s]%s%s%s%s"),
IRC_COLOR_CHAT_SERVER,
server->name,
IRC_COLOR_CHAT_DELIMITERS,
@@ -4712,7 +4713,10 @@ irc_command_display_server (struct t_irc_server *server, int with_detail)
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_RESET,
str_nick,
- (server->temp_server) ? _(" (temporary)") : "");
+ /* TRANSLATORS: "temporary IRC server" */
+ (server->temp_server) ? _(" (temporary)") : "",
+ /* TRANSLATORS: "fake IRC server" */
+ (server->fake_server) ? _(" (fake)") : "");
/* addresses */
if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_ADDRESSES]))
weechat_printf (NULL, " addresses. . . . . . : ('%s')",
@@ -5110,7 +5114,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail)
num_pv = irc_server_get_pv_count (server);
weechat_printf (
NULL,
- " %s %s%s %s[%s%s%s]%s%s%s, %d %s, %d pv",
+ " %s %s%s %s[%s%s%s]%s%s%s%s, %d %s, %d pv",
(server->is_connected) ? "*" : " ",
IRC_COLOR_CHAT_SERVER,
server->name,
@@ -5120,7 +5124,10 @@ irc_command_display_server (struct t_irc_server *server, int with_detail)
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_RESET,
str_nick,
+ /* TRANSLATORS: "temporary IRC server" */
(server->temp_server) ? _(" (temporary)") : "",
+ /* TRANSLATORS: "fake IRC server" */
+ (server->fake_server) ? _(" (fake)") : "",
num_channels,
NG_("channel", "channels", num_channels),
num_pv);
@@ -5129,11 +5136,14 @@ irc_command_display_server (struct t_irc_server *server, int with_detail)
{
weechat_printf (
NULL,
- " %s%s%s%s",
+ " %s%s%s%s%s",
IRC_COLOR_CHAT_SERVER,
server->name,
IRC_COLOR_RESET,
- (server->temp_server) ? _(" (temporary)") : "");
+ /* TRANSLATORS: "temporary IRC server" */
+ (server->temp_server) ? _(" (temporary)") : "",
+ /* TRANSLATORS: "fake IRC server" */
+ (server->fake_server) ? _(" (fake)") : "");
}
}
}
@@ -5147,6 +5157,7 @@ IRC_COMMAND_CALLBACK(server)
int i, detailed_list, one_server_found, length, count, refresh;
struct t_irc_server *ptr_server2, *server_found, *new_server;
char *server_name, *message;
+ const char *ptr_address;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
@@ -5240,20 +5251,32 @@ IRC_COMMAND_CALLBACK(server)
return WEECHAT_RC_OK;
}
+ ptr_address = argv[3];
+ if (strncmp (ptr_address, "fake:", 5) == 0)
+ {
+ /*
+ * fake server: no data is received/sent to this server,
+ * which is used for testing purposes only
+ */
+ new_server->fake_server = 1;
+ ptr_address += 5;
+ }
+
weechat_config_option_set (
new_server->options[IRC_SERVER_OPTION_ADDRESSES], argv[3], 1);
irc_server_apply_command_line_options (new_server, argc, argv);
weechat_printf (
NULL,
- (new_server->temp_server) ?
- _("%s: server %s%s%s added "
- "(temporary server, NOT SAVED!)") :
- _("%s: server %s%s%s added"),
+ _("%s: server added: %s%s%s%s%s"),
IRC_PLUGIN_NAME,
IRC_COLOR_CHAT_SERVER,
new_server->name,
- IRC_COLOR_RESET);
+ IRC_COLOR_RESET,
+ /* TRANSLATORS: "temporary IRC server" */
+ (new_server->temp_server) ? _(" (temporary)") : "",
+ /* TRANSLATORS: "fake IRC server" */
+ (new_server->fake_server) ? _(" (fake)") : "");
/* do not connect to server after adding it */
/*
@@ -5540,7 +5563,7 @@ IRC_COMMAND_CALLBACK(server)
if (weechat_strcasecmp (argv[1], "fakerecv") == 0)
{
WEECHAT_COMMAND_MIN_ARGS(3, "fakerecv");
- IRC_COMMAND_CHECK_SERVER("server fakerecv", 1);
+ IRC_COMMAND_CHECK_SERVER("server fakerecv", 0, 1);
length = strlen (argv_eol[2]);
if (length > 0)
{
@@ -5568,7 +5591,7 @@ IRC_COMMAND_CALLBACK(server)
IRC_COMMAND_CALLBACK(service)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("service", 1);
+ IRC_COMMAND_CHECK_SERVER("service", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5591,7 +5614,7 @@ IRC_COMMAND_CALLBACK(service)
IRC_COMMAND_CALLBACK(servlist)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("servlist", 1);
+ IRC_COMMAND_CHECK_SERVER("servlist", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5619,7 +5642,7 @@ IRC_COMMAND_CALLBACK(servlist)
IRC_COMMAND_CALLBACK(squery)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("squery", 1);
+ IRC_COMMAND_CHECK_SERVER("squery", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5648,7 +5671,7 @@ IRC_COMMAND_CALLBACK(squery)
IRC_COMMAND_CALLBACK(squit)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("squit", 1);
+ IRC_COMMAND_CHECK_SERVER("squit", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5669,7 +5692,7 @@ IRC_COMMAND_CALLBACK(squit)
IRC_COMMAND_CALLBACK(stats)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("stats", 1);
+ IRC_COMMAND_CHECK_SERVER("stats", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5698,7 +5721,7 @@ IRC_COMMAND_CALLBACK(stats)
IRC_COMMAND_CALLBACK(summon)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("summon", 1);
+ IRC_COMMAND_CHECK_SERVER("summon", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5720,7 +5743,7 @@ IRC_COMMAND_CALLBACK(summon)
IRC_COMMAND_CALLBACK(time)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("time", 1);
+ IRC_COMMAND_CHECK_SERVER("time", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5750,7 +5773,7 @@ IRC_COMMAND_CALLBACK(topic)
char *channel_name, *new_topic, *new_topic_color;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("topic", 1);
+ IRC_COMMAND_CHECK_SERVER("topic", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5825,7 +5848,7 @@ IRC_COMMAND_CALLBACK(topic)
IRC_COMMAND_CALLBACK(trace)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("trace", 1);
+ IRC_COMMAND_CHECK_SERVER("trace", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5856,7 +5879,7 @@ IRC_COMMAND_CALLBACK(unban)
int pos_args;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("unban", 1);
+ IRC_COMMAND_CHECK_SERVER("unban", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5909,7 +5932,7 @@ IRC_COMMAND_CALLBACK(unquiet)
int pos_args;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("unquiet", 1);
+ IRC_COMMAND_CHECK_SERVER("unquiet", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5969,7 +5992,7 @@ IRC_COMMAND_CALLBACK(unquiet)
IRC_COMMAND_CALLBACK(userhost)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("userhost", 1);
+ IRC_COMMAND_CHECK_SERVER("userhost", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -5991,7 +6014,7 @@ IRC_COMMAND_CALLBACK(userhost)
IRC_COMMAND_CALLBACK(users)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("users", 1);
+ IRC_COMMAND_CHECK_SERVER("users", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -6020,7 +6043,7 @@ IRC_COMMAND_CALLBACK(users)
IRC_COMMAND_CALLBACK(version)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("version", 1);
+ IRC_COMMAND_CHECK_SERVER("version", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -6057,7 +6080,7 @@ IRC_COMMAND_CALLBACK(version)
IRC_COMMAND_CALLBACK(voice)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("voice", 1);
+ IRC_COMMAND_CHECK_SERVER("voice", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -6101,7 +6124,7 @@ IRC_COMMAND_CALLBACK(wallchops)
struct t_irc_nick *ptr_nick;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("wallchops", 1);
+ IRC_COMMAND_CHECK_SERVER("wallchops", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -6207,7 +6230,7 @@ IRC_COMMAND_CALLBACK(wallchops)
IRC_COMMAND_CALLBACK(wallops)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("wallops", 1);
+ IRC_COMMAND_CHECK_SERVER("wallops", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -6230,7 +6253,7 @@ IRC_COMMAND_CALLBACK(wallops)
IRC_COMMAND_CALLBACK(who)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("who", 1);
+ IRC_COMMAND_CHECK_SERVER("who", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -6261,7 +6284,7 @@ IRC_COMMAND_CALLBACK(whois)
const char *ptr_nick;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- IRC_COMMAND_CHECK_SERVER("whois", 1);
+ IRC_COMMAND_CHECK_SERVER("whois", 1, 1);
/* make C compiler happy */
(void) pointer;
@@ -6309,7 +6332,7 @@ IRC_COMMAND_CALLBACK(whois)
IRC_COMMAND_CALLBACK(whowas)
{
IRC_BUFFER_GET_SERVER(buffer);
- IRC_COMMAND_CHECK_SERVER("whowas", 1);
+ IRC_COMMAND_CHECK_SERVER("whowas", 1, 1);
/* make C compiler happy */
(void) pointer;
diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h
index d86d22ba6..216136ebc 100644
--- a/src/plugins/irc/irc-command.h
+++ b/src/plugins/irc/irc-command.h
@@ -29,7 +29,9 @@ struct t_irc_channel;
struct t_gui_buffer *buffer, \
int argc, char **argv, char **argv_eol)
-#define IRC_COMMAND_CHECK_SERVER(__command, __check_connection) \
+#define IRC_COMMAND_CHECK_SERVER(__command, \
+ __check_connection, \
+ __check_socket) \
if (!ptr_server) \
{ \
weechat_printf (NULL, \
@@ -39,7 +41,9 @@ struct t_irc_channel;
__command); \
return WEECHAT_RC_OK; \
} \
- if (__check_connection && !ptr_server->is_connected) \
+ if ((__check_connection && !ptr_server->is_connected) \
+ || (__check_socket && !ptr_server->fake_server \
+ && (ptr_server->sock < 0))) \
{ \
weechat_printf (NULL, \
_("%s%s: command \"%s\" must be executed on " \
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 436b53c22..5cf8dd0c0 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -573,13 +573,25 @@ irc_server_set_addresses (struct t_irc_server *server, const char *addresses)
{
int i;
char *pos, *error, *addresses_eval;
+ const char *ptr_addresses;
long number;
addresses_eval = NULL;
- if (addresses && addresses[0])
+ ptr_addresses = addresses;
+ if (ptr_addresses && (strncmp (ptr_addresses, "fake:", 5) == 0))
{
- addresses_eval = irc_server_eval_expression (server, addresses);
+ server->fake_server = 1;
+ ptr_addresses += 5;
+ }
+ else
+ {
+ server->fake_server = 0;
+ }
+
+ if (ptr_addresses && ptr_addresses[0])
+ {
+ addresses_eval = irc_server_eval_expression (server, ptr_addresses);
if (server->addresses_eval
&& (strcmp (server->addresses_eval, addresses_eval) == 0))
{
@@ -1367,6 +1379,7 @@ irc_server_alloc (const char *name)
/* internal vars */
new_server->temp_server = 0;
+ new_server->fake_server = 0;
new_server->reloading_from_config = 0;
new_server->reloaded_from_config = 0;
new_server->addresses_eval = NULL;
@@ -2027,8 +2040,9 @@ irc_server_copy (struct t_irc_server *server, const char *new_name)
if (!new_server)
return NULL;
- /* duplicate temporary server flag */
+ /* duplicate temporary/fake server flags */
new_server->temp_server = server->temp_server;
+ new_server->fake_server = server->fake_server;
/* duplicate options */
length = 32 + strlen (server->name) + 1;
@@ -2275,6 +2289,9 @@ irc_server_send (struct t_irc_server *server, const char *buffer, int size_buf)
{
int rc;
+ if (server->fake_server)
+ return size_buf;
+
if (!server)
{
weechat_printf (
@@ -2976,8 +2993,12 @@ irc_server_msgq_flush ()
{
if (irc_recv_msgq->data)
{
- /* read message only if connection was not lost */
- if (irc_recv_msgq->server->sock != -1)
+ /*
+ * read message only if connection was not lost
+ * (or if we are on a fake server)
+ */
+ if ((irc_recv_msgq->server->sock != -1)
+ || irc_recv_msgq->server->fake_server)
{
ptr_data = irc_recv_msgq->data;
while (ptr_data[0] == ' ')
@@ -3204,7 +3225,7 @@ irc_server_recv_cb (const void *pointer, void *data, int fd)
(void) fd;
server = (struct t_irc_server *)pointer;
- if (!server)
+ if (!server || server->fake_server)
return WEECHAT_RC_ERROR;
msgq_flush = 0;
@@ -3907,10 +3928,13 @@ irc_server_connect_cb (const void *pointer, void *data,
server->current_address,
server->current_port,
(server->current_ip) ? server->current_ip : "?");
- server->hook_fd = weechat_hook_fd (server->sock,
- 1, 0, 0,
- &irc_server_recv_cb,
- server, NULL);
+ if (!server->fake_server)
+ {
+ server->hook_fd = weechat_hook_fd (server->sock,
+ 1, 0, 0,
+ &irc_server_recv_cb,
+ server, NULL);
+ }
/* login to server */
irc_server_login (server);
break;
@@ -5031,38 +5055,55 @@ irc_server_connect (struct t_irc_server *server)
#ifdef HAVE_GNUTLS
if (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL))
server->ssl_connected = 1;
- server->hook_connect = weechat_hook_connect (
- proxy,
- server->current_address,
- server->current_port,
- proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6),
- server->current_retry,
- (server->ssl_connected) ? &server->gnutls_sess : NULL,
- (server->ssl_connected) ? &irc_server_gnutls_callback : NULL,
- IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE),
- IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SSL_PRIORITIES),
- IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
- &irc_server_connect_cb,
- server,
- NULL);
+ if (!server->fake_server)
+ {
+ server->hook_connect = weechat_hook_connect (
+ proxy,
+ server->current_address,
+ server->current_port,
+ proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6),
+ server->current_retry,
+ (server->ssl_connected) ? &server->gnutls_sess : NULL,
+ (server->ssl_connected) ? &irc_server_gnutls_callback : NULL,
+ IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE),
+ IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SSL_PRIORITIES),
+ IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
+ &irc_server_connect_cb,
+ server,
+ NULL);
+ }
#else
- server->hook_connect = weechat_hook_connect (
- proxy,
- server->current_address,
- server->current_port,
- proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6),
- server->current_retry,
- NULL, NULL, 0, NULL,
- IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
- &irc_server_connect_cb,
- server,
- NULL);
+ if (!server->fake_recv)
+ {
+ server->hook_connect = weechat_hook_connect (
+ proxy,
+ server->current_address,
+ server->current_port,
+ proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6),
+ server->current_retry,
+ NULL, NULL, 0, NULL,
+ IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
+ &irc_server_connect_cb,
+ server,
+ NULL);
+ }
#endif /* HAVE_GNUTLS */
/* send signal "irc_server_connecting" with server name */
(void) weechat_hook_signal_send ("irc_server_connecting",
WEECHAT_HOOK_SIGNAL_STRING, server->name);
+ if (server->fake_server)
+ {
+ irc_server_connect_cb (server,
+ NULL, /* data */
+ WEECHAT_HOOK_CONNECT_OK, /* status */
+ 0, /* gnutls_rc */
+ -1, /* sock */
+ NULL, /* error */
+ "1.2.3.4"); /* ip_address */
+ }
+
return 1;
}
@@ -5726,6 +5767,7 @@ irc_server_hdata_server_cb (const void *pointer, void *data,
WEECHAT_HDATA_VAR(struct t_irc_server, name, STRING, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, options, POINTER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, temp_server, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, fake_server, INTEGER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, reloading_from_config, INTEGER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, reloaded_from_config, INTEGER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, addresses_eval, STRING, 0, NULL, NULL);
@@ -5965,6 +6007,8 @@ irc_server_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "temp_server", server->temp_server))
return 0;
+ if (!weechat_infolist_new_var_integer (ptr_item, "fake_server", server->fake_server))
+ return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "index_current_address", server->index_current_address))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "current_address", server->current_address))
@@ -6356,6 +6400,7 @@ irc_server_print_log ()
weechat_config_string (ptr_server->options[IRC_SERVER_OPTION_MSG_QUIT]));
/* other server variables */
weechat_log_printf (" temp_server. . . . . : %d", ptr_server->temp_server);
+ weechat_log_printf (" fake_server. . . . . : %d", ptr_server->fake_server);
weechat_log_printf (" reloading_from_config: %d", ptr_server->reloaded_from_config);
weechat_log_printf (" reloaded_from_config : %d", ptr_server->reloaded_from_config);
weechat_log_printf (" addresses_eval . . . : '%s'", ptr_server->addresses_eval);
diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h
index 50dbd0c76..09d16fe8b 100644
--- a/src/plugins/irc/irc-server.h
+++ b/src/plugins/irc/irc-server.h
@@ -166,6 +166,7 @@ struct t_irc_server
/* internal vars */
int temp_server; /* temporary server (not saved) */
+ int fake_server; /* fake server (no I/O, for tests) */
int reloading_from_config; /* 1 if reloading from config file */
int reloaded_from_config; /* 1 if reloaded from config file */
char *addresses_eval; /* evaluation of addresses */
diff --git a/src/plugins/irc/irc-upgrade.c b/src/plugins/irc/irc-upgrade.c
index 0ed9b2625..33a4667fd 100644
--- a/src/plugins/irc/irc-upgrade.c
+++ b/src/plugins/irc/irc-upgrade.c
@@ -368,6 +368,8 @@ irc_upgrade_read_cb (const void *pointer, void *data,
{
irc_upgrade_current_server->temp_server =
weechat_infolist_integer (infolist, "temp_server");
+ irc_upgrade_current_server->fake_server =
+ weechat_infolist_integer (infolist, "fake_server");
irc_upgrade_current_server->buffer = NULL;
buffer_name = weechat_infolist_string (infolist, "buffer_name");
if (buffer_name && buffer_name[0])