diff options
-rw-r--r-- | ChangeLog.asciidoc | 1 | ||||
-rw-r--r-- | doc/de/autogen/plugin_api/infos.txt | 2 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/infos.txt | 2 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/infos.txt | 2 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/infos.txt | 2 | ||||
-rw-r--r-- | doc/ja/autogen/plugin_api/infos.txt | 2 | ||||
-rw-r--r-- | doc/pl/autogen/plugin_api/infos.txt | 2 | ||||
-rw-r--r-- | po/cs.po | 12 | ||||
-rw-r--r-- | po/de.po | 12 | ||||
-rw-r--r-- | po/es.po | 12 | ||||
-rw-r--r-- | po/fr.po | 18 | ||||
-rw-r--r-- | po/hu.po | 12 | ||||
-rw-r--r-- | po/it.po | 12 | ||||
-rw-r--r-- | po/ja.po | 12 | ||||
-rw-r--r-- | po/pl.po | 12 | ||||
-rw-r--r-- | po/pt_BR.po | 12 | ||||
-rw-r--r-- | po/ru.po | 12 | ||||
-rw-r--r-- | po/tr.po | 11 | ||||
-rw-r--r-- | po/weechat.pot | 11 | ||||
-rw-r--r-- | src/plugins/relay/relay-client.c | 21 | ||||
-rw-r--r-- | src/plugins/relay/relay-client.h | 1 | ||||
-rw-r--r-- | src/plugins/relay/relay-info.c | 48 |
22 files changed, 218 insertions, 13 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index db0909de6..ea329c52d 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -59,6 +59,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * lua: fix interpreter used after unload of a script * perl: fix context used after unload of a script * python: fix interpreter used after unload of a script +* relay: add info "relay_client_count" with optional status name as argument * relay: add signals "relay_client_xxx" for client status changes (closes #2) * relay: add option relay.network.clients_purge_delay * relay: fix freeze after /upgrade when many disconnected clients still exist diff --git a/doc/de/autogen/plugin_api/infos.txt b/doc/de/autogen/plugin_api/infos.txt index fa95c86c3..340290cf1 100644 --- a/doc/de/autogen/plugin_api/infos.txt +++ b/doc/de/autogen/plugin_api/infos.txt @@ -26,6 +26,8 @@ | python | python2_bin | Pfad für Python 2.x Interpreter | - +| relay | relay_client_count | number of clients for relay | status name (optional): connecting, waiting_auth, connected, auth_failed, disconnected + | weechat | charset_internal | Interner WeeChat Zeichensatz | - | weechat | charset_terminal | Terminal Zeichensatz | - diff --git a/doc/en/autogen/plugin_api/infos.txt b/doc/en/autogen/plugin_api/infos.txt index 81aaee62d..ef961b510 100644 --- a/doc/en/autogen/plugin_api/infos.txt +++ b/doc/en/autogen/plugin_api/infos.txt @@ -26,6 +26,8 @@ | python | python2_bin | path to python 2.x interpreter | - +| relay | relay_client_count | number of clients for relay | status name (optional): connecting, waiting_auth, connected, auth_failed, disconnected + | weechat | charset_internal | WeeChat internal charset | - | weechat | charset_terminal | terminal charset | - diff --git a/doc/fr/autogen/plugin_api/infos.txt b/doc/fr/autogen/plugin_api/infos.txt index bf329af2d..924c9039c 100644 --- a/doc/fr/autogen/plugin_api/infos.txt +++ b/doc/fr/autogen/plugin_api/infos.txt @@ -26,6 +26,8 @@ | python | python2_bin | chemin vers l'interpréteur python 2.x | - +| relay | relay_client_count | nombre de clients pour le relai | nom du statut (optionnel): connecting, waiting_auth, connected, auth_failed, disconnected + | weechat | charset_internal | charset interne à WeeChat | - | weechat | charset_terminal | charset du terminal | - diff --git a/doc/it/autogen/plugin_api/infos.txt b/doc/it/autogen/plugin_api/infos.txt index e303a258a..d384c36f2 100644 --- a/doc/it/autogen/plugin_api/infos.txt +++ b/doc/it/autogen/plugin_api/infos.txt @@ -26,6 +26,8 @@ | python | python2_bin | path per l'interprete python 2.x | - +| relay | relay_client_count | number of clients for relay | status name (optional): connecting, waiting_auth, connected, auth_failed, disconnected + | weechat | charset_internal | set caratteri interno di WeeChat | - | weechat | charset_terminal | set caratteri terminale | - diff --git a/doc/ja/autogen/plugin_api/infos.txt b/doc/ja/autogen/plugin_api/infos.txt index 470205d80..95e92932e 100644 --- a/doc/ja/autogen/plugin_api/infos.txt +++ b/doc/ja/autogen/plugin_api/infos.txt @@ -26,6 +26,8 @@ | python | python2_bin | python 2.x インタプリタへのパス | - +| relay | relay_client_count | number of clients for relay | status name (optional): connecting, waiting_auth, connected, auth_failed, disconnected + | weechat | charset_internal | WeeChat 内部文字集合 | - | weechat | charset_terminal | ターミナルの文字集合 | - diff --git a/doc/pl/autogen/plugin_api/infos.txt b/doc/pl/autogen/plugin_api/infos.txt index fbfccaee8..ecf1853fc 100644 --- a/doc/pl/autogen/plugin_api/infos.txt +++ b/doc/pl/autogen/plugin_api/infos.txt @@ -26,6 +26,8 @@ | python | python2_bin | ścieżka do interpretera pythona 2.x | - +| relay | relay_client_count | number of clients for relay | status name (optional): connecting, waiting_auth, connected, auth_failed, disconnected + | weechat | charset_internal | wewnętrzne kodowanie WeeChat | - | weechat | charset_terminal | kodowanie terminala | - @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:20+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8935,6 +8935,16 @@ msgid "" "sent as irc tag); empty string = disable time in backlog messages" msgstr "" +#, fuzzy +msgid "number of clients for relay" +msgstr "Seznam klientů pro přenos" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "seznam klientů přesměrování" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:21+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <weechatter@arcor.de>\n" @@ -9969,6 +9969,16 @@ msgstr "" "gesendet wird); keine Zeichenkette = deaktiviert die Zeitanzeige im " "Verlaufsspeicher" +#, fuzzy +msgid "number of clients for relay" +msgstr "Liste der Relay-Clients" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "Liste der Relay-Clients" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:21+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -9223,6 +9223,16 @@ msgid "" "sent as irc tag); empty string = disable time in backlog messages" msgstr "" +#, fuzzy +msgid "number of clients for relay" +msgstr "Lista de clientes a retransmitir" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "Lista de clientes en el repetidor" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" -"PO-Revision-Date: 2014-03-04 21:47+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" +"PO-Revision-Date: 2014-03-05 11:36+0100\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -9720,6 +9720,17 @@ msgstr "" "activée par le client, car l'heure est envoyée sous forme d'étiquette irc); " "chaîne vide = désactiver l'heure dans les messages d'historique" +msgid "number of clients for relay" +msgstr "nombre de clients pour le relai" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" +"nom du statut (optionnel): connecting, waiting_auth, connected, auth_failed, " +"disconnected" + msgid "list of relay clients" msgstr "liste des clients pour le relai" @@ -11329,3 +11340,6 @@ msgstr "" #, c-format msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s%s: délai d'attente dépassé pour \"%s\" avec %s" + +#~ msgid "number of clients for relay (for optional status)" +#~ msgstr "nombre de clients pour le relai" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:21+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8355,6 +8355,16 @@ msgid "" msgstr "" #, fuzzy +msgid "number of clients for relay" +msgstr "Nincs szerver.\n" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + +#, fuzzy msgid "list of relay clients" msgstr "Aliaszok listája:\n" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:21+0100\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -9376,6 +9376,16 @@ msgid "" "sent as irc tag); empty string = disable time in backlog messages" msgstr "" +#, fuzzy +msgid "number of clients for relay" +msgstr "Elenco dei client per il relay" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "elenco di client relay" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:21+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/WeeChat>\n" @@ -9365,6 +9365,16 @@ msgstr "" "\"server-time\" 機能を利用可能にした場合、これは利用されません); 空文字列 = " "バックログメッセージで時間を表示しない" +#, fuzzy +msgid "number of clients for relay" +msgstr "中継するクライアントのリスト" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "リレークライアントのリスト" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:21+0100\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -9547,6 +9547,16 @@ msgstr "" "czas jest wysyłany jako tag irc); pusty ciąg = wyłącza znacznik czasu w " "backlogu" +#, fuzzy +msgid "number of clients for relay" +msgstr "Lista klientów do przekazania" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "lista zdalnych klientów" diff --git a/po/pt_BR.po b/po/pt_BR.po index da46275a7..b50d383fd 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: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:21+0100\n" "Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8589,6 +8589,16 @@ msgid "" "sent as irc tag); empty string = disable time in backlog messages" msgstr "" +#, fuzzy +msgid "number of clients for relay" +msgstr "Clientes para relay:" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-03-04 11:21+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8380,6 +8380,16 @@ msgid "" msgstr "" #, fuzzy +msgid "number of clients for relay" +msgstr "Нет сервера.\n" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + +#, fuzzy msgid "list of relay clients" msgstr "Список сокращений:\n" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7480,6 +7480,15 @@ msgid "" "sent as irc tag); empty string = disable time in backlog messages" msgstr "" +msgid "number of clients for relay" +msgstr "" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index 227ecc5bf..913e134da 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-04 21:46+0100\n" +"POT-Creation-Date: 2014-03-05 11:39+0100\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7440,6 +7440,15 @@ msgid "" "sent as irc tag); empty string = disable time in backlog messages" msgstr "" +msgid "number of clients for relay" +msgstr "" + +#. TRANSLATORS: please do not translate the status names, they must be used in English +msgid "" +"status name (optional): connecting, waiting_auth, connected, auth_failed, " +"disconnected" +msgstr "" + msgid "list of relay clients" msgstr "" diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c index c60870c94..6153ddfb3 100644 --- a/src/plugins/relay/relay-client.c +++ b/src/plugins/relay/relay-client.c @@ -138,6 +138,27 @@ relay_client_search_by_id (int id) } /* + * Searches for a client status. + * + * Returns index of status in enum t_relay_status, -1 if status is not found. + */ + +int +relay_client_status_search (const char *name) +{ + int i; + + for (i = 0; i < RELAY_NUM_STATUS; i++) + { + if (strcmp (relay_client_status_name[i], name) == 0) + return i; + } + + /* status not found */ + return -1; +} + +/* * Sends a signal with the status of client ("relay_client_xxx"). */ diff --git a/src/plugins/relay/relay-client.h b/src/plugins/relay/relay-client.h index 5ee8dd9b7..148e6aeec 100644 --- a/src/plugins/relay/relay-client.h +++ b/src/plugins/relay/relay-client.h @@ -113,6 +113,7 @@ extern int relay_client_count; extern int relay_client_valid (struct t_relay_client *client); extern struct t_relay_client *relay_client_search_by_number (int number); extern struct t_relay_client *relay_client_search_by_id (int id); +extern int relay_client_status_search (const char *name); extern void relay_client_set_desc (struct t_relay_client *client); extern int relay_client_recv_cb (void *arg_client, int fd); extern int relay_client_send (struct t_relay_client *client, const char *data, diff --git a/src/plugins/relay/relay-info.c b/src/plugins/relay/relay-info.c index a5208d796..1d9cbb729 100644 --- a/src/plugins/relay/relay-info.c +++ b/src/plugins/relay/relay-info.c @@ -28,6 +28,45 @@ /* + * Returns relay info. + */ + +const char * +relay_info_get_info_cb (void *data, const char *info_name, + const char *arguments) +{ + static char str_count[32]; + int count, status; + struct t_relay_client *ptr_client; + + /* make C compiler happy */ + (void) data; + + if (weechat_strcasecmp (info_name, "relay_client_count") == 0) + { + str_count[0] = '\0'; + count = relay_client_count; + if (arguments && arguments[0]) + { + status = relay_client_status_search (arguments); + if (status < 0) + return NULL; + count = 0; + for (ptr_client = relay_clients; ptr_client; + ptr_client = ptr_client->next_client) + { + if ((int)ptr_client->status == status) + count++; + } + } + snprintf (str_count, sizeof (str_count), "%d", count); + return str_count; + } + + return NULL; +} + +/* * Returns infolist with relay info. */ @@ -90,6 +129,15 @@ relay_info_get_infolist_cb (void *data, const char *infolist_name, void relay_info_init () { + /* info hooks */ + weechat_hook_info ("relay_client_count", + N_("number of clients for relay"), + /* TRANSLATORS: please do not translate the status names, they must be used in English */ + N_("status name (optional): connecting, waiting_auth, " + "connected, auth_failed, disconnected"), + &relay_info_get_info_cb, NULL); + + /* infolist hooks */ weechat_hook_infolist ("relay", N_("list of relay clients"), N_("relay pointer (optional)"), NULL, |