diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | doc/de/autogen/plugin_api/hdata.txt | 9 | ||||
-rw-r--r-- | doc/de/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/hdata.txt | 9 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/hdata.txt | 9 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/hdata.txt | 9 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | doc/ja/autogen/plugin_api/hdata.txt | 9 | ||||
-rw-r--r-- | doc/ja/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | po/cs.po | 18 | ||||
-rw-r--r-- | po/de.po | 19 | ||||
-rw-r--r-- | po/es.po | 18 | ||||
-rw-r--r-- | po/fr.po | 17 | ||||
-rw-r--r-- | po/hu.po | 16 | ||||
-rw-r--r-- | po/it.po | 19 | ||||
-rw-r--r-- | po/ja.po | 17 | ||||
-rw-r--r-- | po/pl.po | 17 | ||||
-rw-r--r-- | po/pt_BR.po | 18 | ||||
-rw-r--r-- | po/ru.po | 16 | ||||
-rw-r--r-- | po/weechat.pot | 14 | ||||
-rw-r--r-- | src/core/wee-proxy.c | 97 | ||||
-rw-r--r-- | src/core/wee-proxy.h | 6 | ||||
-rw-r--r-- | src/gui/gui-filter.c | 2 | ||||
-rw-r--r-- | src/plugins/plugin-api.c | 47 |
26 files changed, 385 insertions, 14 deletions
@@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.4.2-dev, 2013-06-07 +v0.4.2-dev, 2013-06-08 This document lists all changes for each version. @@ -14,6 +14,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] Version 0.4.2 (under dev!) -------------------------- +* core: add "proxy" infolist and hdata * core: fix random crash on mouse actions (bug #39094) * core: set options weechat.look.color_inactive_{buffer|window} to "on" by default diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt index c8f6e2401..01dcfb295 100644 --- a/doc/de/autogen/plugin_api/hdata.txt +++ b/doc/de/autogen/plugin_api/hdata.txt @@ -737,6 +737,15 @@ 'last_weechat_plugin' + 'weechat_plugins' +| weechat | proxy | proxy | + 'name' (string) + + 'options' (pointer) + + 'prev_proxy' (pointer, hdata: "proxy") + + 'next_proxy' (pointer, hdata: "proxy") | + | + 'last_weechat_proxy' + + 'weechat_proxies' + | weechat | window | Fenster | 'number' (integer) + 'win_x' (integer) + diff --git a/doc/de/autogen/plugin_api/infolists.txt b/doc/de/autogen/plugin_api/infolists.txt index 8aa6117ee..38a159a25 100644 --- a/doc/de/autogen/plugin_api/infolists.txt +++ b/doc/de/autogen/plugin_api/infolists.txt @@ -62,6 +62,8 @@ | weechat | plugin | Auflistung der Erweiterungen | Pointer der Erweiterung (optional) | Name einer Erweiterung (darf mit einem "*" als Platzhalter beginnen oder enden) (optional) +| weechat | proxy | list of proxies | proxy pointer (optional) | proxy name (can start or end with "*" as wildcard) (optional) + | weechat | url_options | Optionen für URL | - | - | weechat | window | Auflistung der Fenster | Fenster Pointer (optional) | "current" für aktuelles Fenster oder die Nummer eines Fensters (optional) diff --git a/doc/en/autogen/plugin_api/hdata.txt b/doc/en/autogen/plugin_api/hdata.txt index 57f1d86d5..60fafc2cc 100644 --- a/doc/en/autogen/plugin_api/hdata.txt +++ b/doc/en/autogen/plugin_api/hdata.txt @@ -737,6 +737,15 @@ 'last_weechat_plugin' + 'weechat_plugins' +| weechat | proxy | proxy | + 'name' (string) + + 'options' (pointer) + + 'prev_proxy' (pointer, hdata: "proxy") + + 'next_proxy' (pointer, hdata: "proxy") | + | + 'last_weechat_proxy' + + 'weechat_proxies' + | weechat | window | window | 'number' (integer) + 'win_x' (integer) + diff --git a/doc/en/autogen/plugin_api/infolists.txt b/doc/en/autogen/plugin_api/infolists.txt index 4c4372d64..94fa9fb6d 100644 --- a/doc/en/autogen/plugin_api/infolists.txt +++ b/doc/en/autogen/plugin_api/infolists.txt @@ -62,6 +62,8 @@ | weechat | plugin | list of plugins | plugin pointer (optional) | plugin name (can start or end with "*" as wildcard) (optional) +| weechat | proxy | list of proxies | proxy pointer (optional) | proxy name (can start or end with "*" as wildcard) (optional) + | weechat | url_options | options for URL | - | - | weechat | window | list of windows | window pointer (optional) | "current" for current window or a window number (optional) diff --git a/doc/fr/autogen/plugin_api/hdata.txt b/doc/fr/autogen/plugin_api/hdata.txt index bd2ab1b46..d41ea5d63 100644 --- a/doc/fr/autogen/plugin_api/hdata.txt +++ b/doc/fr/autogen/plugin_api/hdata.txt @@ -737,6 +737,15 @@ 'last_weechat_plugin' + 'weechat_plugins' +| weechat | proxy | proxy | + 'name' (string) + + 'options' (pointer) + + 'prev_proxy' (pointer, hdata: "proxy") + + 'next_proxy' (pointer, hdata: "proxy") | + | + 'last_weechat_proxy' + + 'weechat_proxies' + | weechat | window | fenêtre | 'number' (integer) + 'win_x' (integer) + diff --git a/doc/fr/autogen/plugin_api/infolists.txt b/doc/fr/autogen/plugin_api/infolists.txt index cf6a717d1..400e9bd9d 100644 --- a/doc/fr/autogen/plugin_api/infolists.txt +++ b/doc/fr/autogen/plugin_api/infolists.txt @@ -62,6 +62,8 @@ | weechat | plugin | liste des extensions | pointeur vers l'extension (optionnel) | nom d'extension (peut démarrer ou se terminer par "*" comme joker) (optionnel) +| weechat | proxy | liste des proxies | pointeur vers le proxy (optionnel) | nom de proxy (peut démarrer ou se terminer par "*" comme joker) (optionnel) + | weechat | url_options | options pour l'URL | - | - | weechat | window | liste des fenêtres | pointeur vers la fenêtre (optionnel) | "current" pour la fenêtre courante ou un numéro de fenêtre (optionnel) diff --git a/doc/it/autogen/plugin_api/hdata.txt b/doc/it/autogen/plugin_api/hdata.txt index 8eb5cbdcb..fb7da3bed 100644 --- a/doc/it/autogen/plugin_api/hdata.txt +++ b/doc/it/autogen/plugin_api/hdata.txt @@ -737,6 +737,15 @@ 'last_weechat_plugin' + 'weechat_plugins' +| weechat | proxy | proxy | + 'name' (string) + + 'options' (pointer) + + 'prev_proxy' (pointer, hdata: "proxy") + + 'next_proxy' (pointer, hdata: "proxy") | + | + 'last_weechat_proxy' + + 'weechat_proxies' + | weechat | window | finestra | 'number' (integer) + 'win_x' (integer) + diff --git a/doc/it/autogen/plugin_api/infolists.txt b/doc/it/autogen/plugin_api/infolists.txt index c0016d5e9..9829f7b3a 100644 --- a/doc/it/autogen/plugin_api/infolists.txt +++ b/doc/it/autogen/plugin_api/infolists.txt @@ -62,6 +62,8 @@ | weechat | plugin | elenco dei plugin | puntatore al plugin (opzionale) | nome plugin (può iniziare o terminare con "*" come carattere jolly) (opzionale) +| weechat | proxy | list of proxies | proxy pointer (optional) | proxy name (can start or end with "*" as wildcard) (optional) + | weechat | url_options | opzioni per la URL | - | - | weechat | window | elenco delle finestre | puntatore alla finestra (opzionale) | "current" per la finestra corrente o un numero della finestra (opzionale) diff --git a/doc/ja/autogen/plugin_api/hdata.txt b/doc/ja/autogen/plugin_api/hdata.txt index 794709fa6..fc4c2bc84 100644 --- a/doc/ja/autogen/plugin_api/hdata.txt +++ b/doc/ja/autogen/plugin_api/hdata.txt @@ -737,6 +737,15 @@ 'last_weechat_plugin' + 'weechat_plugins' +| weechat | proxy | proxy | + 'name' (string) + + 'options' (pointer) + + 'prev_proxy' (pointer, hdata: "proxy") + + 'next_proxy' (pointer, hdata: "proxy") | + | + 'last_weechat_proxy' + + 'weechat_proxies' + | weechat | window | ウィンドウ | 'number' (integer) + 'win_x' (integer) + diff --git a/doc/ja/autogen/plugin_api/infolists.txt b/doc/ja/autogen/plugin_api/infolists.txt index 06db5d061..58184615f 100644 --- a/doc/ja/autogen/plugin_api/infolists.txt +++ b/doc/ja/autogen/plugin_api/infolists.txt @@ -62,6 +62,8 @@ | weechat | plugin | プラグインリスト | プラグインポインタ (オプション) | プラグイン名 (ワイルドカードとして "*" で始めるか終われる) (オプション) +| weechat | proxy | list of proxies | proxy pointer (optional) | proxy name (can start or end with "*" as wildcard) (optional) + | weechat | url_options | URL のオプション | - | - | weechat | window | ウィンドウリスト | ウィンドウポインタ (オプション) | "current" は現在のウィンドウまたはウィンドウ番号 (オプション) @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:54+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7561,6 +7561,19 @@ msgstr "" "(volitelné)" #, fuzzy +msgid "list of proxies" +msgstr "Seznam proxy:" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "ukazatel přesměrování (volitelné)" + +#, fuzzy +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" +"jméno pole (může začínat nebo končit \"*\" jako zástupným znakem) (volitelné)" + +#, fuzzy msgid "options for URL" msgstr "volby pro pole" @@ -7658,6 +7671,9 @@ msgstr "přezdívky v seznamu notifikací" msgid "plugin" msgstr "Plugin" +msgid "proxy" +msgstr "" + #, fuzzy msgid "window" msgstr "spravuje okna" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:54+0200\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <weechatter@arcor.de>\n" @@ -8271,6 +8271,20 @@ msgstr "" "Name einer Erweiterung (darf mit einem \"*\" als Platzhalter beginnen oder " "enden) (optional)" +#, fuzzy +msgid "list of proxies" +msgstr "Auflistung der Proxys:" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "Relay Pointer (optional)" + +#, fuzzy +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" +"Bar Name (darf mit einem \"*\" als Platzhalter beginnen oder enden) " +"(optional)" + msgid "options for URL" msgstr "Optionen für URL" @@ -8356,6 +8370,9 @@ msgstr "Nick in Nickliste" msgid "plugin" msgstr "Erweiterung" +msgid "proxy" +msgstr "" + msgid "window" msgstr "Fenster" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:54+0200\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7825,6 +7825,19 @@ msgstr "" "nombre del plugin (puede empezar o terminar con \"*\" como comodín) " "(opcional)" +#, fuzzy +msgid "list of proxies" +msgstr "Lista de proxies:" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "puntero del retransmisor (opcional)" + +#, fuzzy +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" +"nombre de barra (puede empezar o terminar con \"*\" como comodín) (opcional)" + msgid "options for URL" msgstr "opciones para URL" @@ -7909,6 +7922,9 @@ msgstr "apodos en la lista de apodos" msgid "plugin" msgstr "plugin" +msgid "proxy" +msgstr "" + msgid "window" msgstr "ventana" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" -"PO-Revision-Date: 2013-06-07 20:48+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" +"PO-Revision-Date: 2013-06-08 11:29+0200\n" "Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -8039,6 +8039,16 @@ msgstr "" "nom d'extension (peut démarrer ou se terminer par \"*\" comme joker) " "(optionnel)" +msgid "list of proxies" +msgstr "liste des proxies" + +msgid "proxy pointer (optional)" +msgstr "pointeur vers le proxy (optionnel)" + +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" +"nom de proxy (peut démarrer ou se terminer par \"*\" comme joker) (optionnel)" + msgid "options for URL" msgstr "options pour l'URL" @@ -8121,6 +8131,9 @@ msgstr "pseudo dans la liste de pseudos" msgid "plugin" msgstr "extension" +msgid "proxy" +msgstr "proxy" + msgid "window" msgstr "fenêtre" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:54+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7042,6 +7042,17 @@ msgid "plugin name (can start or end with \"*\" as wildcard) (optional)" msgstr "" #, fuzzy +msgid "list of proxies" +msgstr "Aliaszok listája:\n" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "Beállítások mentése a lemezre\n" + +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" + +#, fuzzy msgid "options for URL" msgstr "Aliaszok listája:\n" @@ -7140,6 +7151,9 @@ msgstr "%s nem található ilyen mellőzés\n" msgid "plugin" msgstr " (nem található bővítőmodul)\n" +msgid "proxy" +msgstr "" + #, fuzzy msgid "window" msgstr "ablakok kezelése" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:54+0200\n" "Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7891,6 +7891,20 @@ msgstr "" "nome plugin (può iniziare o terminare con \"*\" come carattere jolly) " "(opzionale)" +#, fuzzy +msgid "list of proxies" +msgstr "Elenco di proxy:" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "puntatore al relay (opzionale)" + +#, fuzzy +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" +"nome barra (può iniziare o terminare con \"*\" come carattere jolly " +"(opzionale)" + msgid "options for URL" msgstr "opzioni per la URL" @@ -7976,6 +7990,9 @@ msgstr "nick nella lista nick" msgid "plugin" msgstr "plugin" +msgid "proxy" +msgstr "" + msgid "window" msgstr "finestra" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:54+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/WeeChat>\n" @@ -7762,6 +7762,18 @@ msgid "plugin name (can start or end with \"*\" as wildcard) (optional)" msgstr "" "プラグイン名 (ワイルドカードとして \"*\" で始めるか終われる) (オプション)" +#, fuzzy +msgid "list of proxies" +msgstr "プロキシリスト:" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "リレーポインタ (オプション)" + +#, fuzzy +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "バー名 (ワイルドカードとして \"*\" で始めるか終われる) (オプション)" + msgid "options for URL" msgstr "URL のオプション" @@ -7846,6 +7858,9 @@ msgstr "ニックネームリストにあるニックネーム" msgid "plugin" msgstr "プラグイン" +msgid "proxy" +msgstr "" + msgid "window" msgstr "ウィンドウ" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:54+0200\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7907,6 +7907,18 @@ msgstr "wskaźnik wtyczki (opcjonalne)" msgid "plugin name (can start or end with \"*\" as wildcard) (optional)" msgstr "nazwa wtyczki (może się zaczynać lub kończyć \"*\") (opcjonalne)" +#, fuzzy +msgid "list of proxies" +msgstr "Lista proxy:" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "wskaźnik relay (opcjonalny)" + +#, fuzzy +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "nazwa paska (może się zaczynać lub kończyć \"*\") (opcjonalne)" + msgid "options for URL" msgstr "opcje dla URLi" @@ -7991,6 +8003,9 @@ msgstr "nicki na liście nicków" msgid "plugin" msgstr "wtyczka" +msgid "proxy" +msgstr "" + msgid "window" msgstr "okno" diff --git a/po/pt_BR.po b/po/pt_BR.po index c65b2b8b0..51b0da57c 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:55+0200\n" "Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7232,6 +7232,19 @@ msgstr "" "(opcional)" #, fuzzy +msgid "list of proxies" +msgstr "Lista de proxys:" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "ponteiro da barra (opcional)" + +#, fuzzy +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" +"nome da barra (pode começar ou terminar com \"*\" como um coringa) (opcional)" + +#, fuzzy msgid "options for URL" msgstr "opções para barras" @@ -7316,6 +7329,9 @@ msgstr "apelido na lista de apelidos" msgid "plugin" msgstr "plugin" +msgid "proxy" +msgstr "" + msgid "window" msgstr "janela" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.2-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\n" "PO-Revision-Date: 2013-05-20 16:55+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7069,6 +7069,17 @@ msgid "plugin name (can start or end with \"*\" as wildcard) (optional)" msgstr "" #, fuzzy +msgid "list of proxies" +msgstr "Список сокращений:\n" + +#, fuzzy +msgid "proxy pointer (optional)" +msgstr "Сохраняю конфигурацию\n" + +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" + +#, fuzzy msgid "options for URL" msgstr "Список сокращений:\n" @@ -7167,6 +7178,9 @@ msgstr "%s игнорирования не найдены\n" msgid "plugin" msgstr " (нет pluginа)\n" +msgid "proxy" +msgstr "" + #, fuzzy msgid "window" msgstr "управление окнами" diff --git a/po/weechat.pot b/po/weechat.pot index 338eea3eb..3ace4fabf 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: 2013-06-07 20:09+0200\n" +"POT-Creation-Date: 2013-06-08 11:29+0200\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" @@ -6214,6 +6214,15 @@ msgstr "" msgid "plugin name (can start or end with \"*\" as wildcard) (optional)" msgstr "" +msgid "list of proxies" +msgstr "" + +msgid "proxy pointer (optional)" +msgstr "" + +msgid "proxy name (can start or end with \"*\" as wildcard) (optional)" +msgstr "" + msgid "options for URL" msgstr "" @@ -6295,6 +6304,9 @@ msgstr "" msgid "plugin" msgstr "" +msgid "proxy" +msgstr "" + msgid "window" msgstr "" diff --git a/src/core/wee-proxy.c b/src/core/wee-proxy.c index acebd5161..1548bf4cf 100644 --- a/src/core/wee-proxy.c +++ b/src/core/wee-proxy.c @@ -24,13 +24,17 @@ #endif #include <stdlib.h> +#include <stddef.h> #include <string.h> #include "weechat.h" #include "wee-proxy.h" #include "wee-config.h" +#include "wee-hdata.h" +#include "wee-infolist.h" #include "wee-log.h" #include "wee-string.h" +#include "../plugins/plugin.h" char *proxy_option_string[PROXY_NUM_OPTIONS] = @@ -96,6 +100,33 @@ proxy_search_type (const char *type) } /* + * Checks if a proxy pointer is valid. + * + * Returns: + * 1: proxy exists + * 0: proxy does not exist + */ + +int +proxy_valid (struct t_proxy *proxy) +{ + struct t_proxy *ptr_proxy; + + if (!proxy) + return 0; + + for (ptr_proxy = weechat_proxies; ptr_proxy; + ptr_proxy = ptr_proxy->next_proxy) + { + if (ptr_proxy == proxy) + return 1; + } + + /* proxy not found */ + return 0; +} + +/* * Searches for a proxy by name. * * Returns pointer to proxy found, NULL if not found. @@ -583,6 +614,72 @@ proxy_free_all () } /* + * Returns hdata for proxy. + */ + +struct t_hdata * +proxy_hdata_proxy_cb (void *data, const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) data; + + hdata = hdata_new (NULL, hdata_name, "prev_proxy", "next_proxy", + 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_proxy, name, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_proxy, options, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_proxy, prev_proxy, POINTER, 0, NULL, hdata_name); + HDATA_VAR(struct t_proxy, next_proxy, POINTER, 0, NULL, hdata_name); + HDATA_LIST(weechat_proxies); + HDATA_LIST(last_weechat_proxy); + } + return hdata; +} + +/* + * Adds a proxy in an infolist. + * + * Returns: + * 1: OK + * 0: error + */ + +int +proxy_add_to_infolist (struct t_infolist *infolist, struct t_proxy *proxy) +{ + struct t_infolist_item *ptr_item; + + if (!infolist || !proxy) + return 0; + + ptr_item = infolist_new_item (infolist); + if (!ptr_item) + return 0; + + if (!infolist_new_var_string (ptr_item, "name", proxy->name)) + return 0; + if (!infolist_new_var_integer (ptr_item, "type", CONFIG_INTEGER(proxy->options[PROXY_OPTION_TYPE]))) + return 0; + if (!infolist_new_var_string (ptr_item, "type_string", proxy_type_string[CONFIG_INTEGER(proxy->options[PROXY_OPTION_TYPE])])) + return 0; + if (!infolist_new_var_integer (ptr_item, "ipv6", CONFIG_INTEGER(proxy->options[PROXY_OPTION_IPV6]))) + return 0; + if (!infolist_new_var_string (ptr_item, "address", CONFIG_STRING(proxy->options[PROXY_OPTION_ADDRESS]))) + return 0; + if (!infolist_new_var_integer (ptr_item, "port", CONFIG_INTEGER(proxy->options[PROXY_OPTION_PORT]))) + return 0; + if (!infolist_new_var_string (ptr_item, "username", CONFIG_STRING(proxy->options[PROXY_OPTION_USERNAME]))) + return 0; + if (!infolist_new_var_string (ptr_item, "password", CONFIG_STRING(proxy->options[PROXY_OPTION_PASSWORD]))) + return 0; + + return 1; +} + +/* * Prints proxies in WeeChat log file (usually for crash dump). */ diff --git a/src/core/wee-proxy.h b/src/core/wee-proxy.h index c9152ec67..b0adb616a 100644 --- a/src/core/wee-proxy.h +++ b/src/core/wee-proxy.h @@ -20,6 +20,8 @@ #ifndef __WEECHAT_PROXY_H #define __WEECHAT_PROXY_H 1 +struct t_infolist; + enum t_proxy_option { PROXY_OPTION_TYPE = 0, /* type: http, socks4, socks5 */ @@ -63,6 +65,7 @@ extern struct t_proxy *last_weechat_temp_proxy; extern int proxy_search_option (const char *option_name); extern int proxy_search_type (const char *type); +extern int proxy_valid (struct t_proxy *proxy); extern struct t_proxy *proxy_search (const char *name); extern int proxy_set (struct t_proxy *bar, const char *property, const char *value); @@ -79,6 +82,9 @@ extern struct t_proxy *proxy_new (const char *name, extern void proxy_use_temp_proxies (); extern void proxy_free (struct t_proxy *proxy); extern void proxy_free_all (); +extern struct t_hdata *proxy_hdata_proxy_cb (void *data, const char *hdata_name); +extern int proxy_add_to_infolist (struct t_infolist *infolist, + struct t_proxy *proxy); extern void proxy_print_log (); #endif /* __WEECHAT_PROXY_H */ diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c index 003c011cc..25f60a74a 100644 --- a/src/gui/gui-filter.c +++ b/src/gui/gui-filter.c @@ -527,7 +527,7 @@ gui_filter_hdata_filter_cb (void *data, const char *hdata_name) } /* - * Add a filter in an infolist. + * Adds a filter in an infolist. * * Returns: * 1: OK diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index ffed78bb0..ca9dd65a7 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -40,6 +40,7 @@ #include "../core/wee-hook.h" #include "../core/wee-infolist.h" #include "../core/wee-input.h" +#include "../core/wee-proxy.h" #include "../core/wee-string.h" #include "../core/wee-url.h" #include "../core/wee-util.h" @@ -413,6 +414,7 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name, struct t_gui_hotlist *ptr_hotlist; struct t_gui_key *ptr_key; struct t_weechat_plugin *ptr_plugin; + struct t_proxy *ptr_proxy; struct t_gui_layout *ptr_layout; int context, number, i; char *error; @@ -801,6 +803,45 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name, } } } + else if (string_strcasecmp (infolist_name, "proxy") == 0) + { + /* invalid proxy pointer ? */ + if (pointer && (!proxy_valid (pointer))) + return NULL; + + ptr_infolist = infolist_new (); + if (ptr_infolist) + { + if (pointer) + { + /* build list with only one proxy */ + if (!proxy_add_to_infolist (ptr_infolist, pointer)) + { + infolist_free (ptr_infolist); + return NULL; + } + return ptr_infolist; + } + else + { + /* build list with all proxies matching arguments */ + for (ptr_proxy = weechat_proxies; ptr_proxy; + ptr_proxy = ptr_proxy->next_proxy) + { + if (!arguments || !arguments[0] + || string_match (ptr_proxy->name, arguments, 0)) + { + if (!proxy_add_to_infolist (ptr_infolist, ptr_proxy)) + { + infolist_free (ptr_infolist); + return NULL; + } + } + } + return ptr_infolist; + } + } + } else if (string_strcasecmp (infolist_name, "url_options") == 0) { ptr_infolist = infolist_new (); @@ -1144,6 +1185,10 @@ plugin_api_init () N_("plugin pointer (optional)"), N_("plugin name (can start or end with \"*\" as wildcard) (optional)"), &plugin_api_infolist_get_internal, NULL); + hook_infolist (NULL, "proxy", N_("list of proxies"), + N_("proxy pointer (optional)"), + N_("proxy name (can start or end with \"*\" as wildcard) (optional)"), + &plugin_api_infolist_get_internal, NULL); hook_infolist (NULL, "url_options", N_("options for URL"), NULL, NULL, @@ -1200,6 +1245,8 @@ plugin_api_init () &gui_nicklist_hdata_nick_cb, NULL); hook_hdata (NULL, "plugin", N_("plugin"), &plugin_hdata_plugin_cb, NULL); + hook_hdata (NULL, "proxy", N_("proxy"), + &proxy_hdata_proxy_cb, NULL); hook_hdata (NULL, "window", N_("window"), &gui_window_hdata_window_cb, NULL); hook_hdata (NULL, "window_scroll", N_("scroll info in window"), |