diff options
55 files changed, 4019 insertions, 447 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 757e9f7c3..f2dabef10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,7 @@ OPTION(DISABLE_FIFO "Disable FIFO plugin") OPTION(DISABLE_IRC "Disable IRC plugin") OPTION(DISABLE_LOGGER "Disable Logger plugin") OPTION(DISABLE_NOTIFY "Disable Notify plugin") +OPTION(DISABLE_RELAY "Disable Relay plugin") OPTION(DISABLE_SCRIPTS "Disable script plugins") OPTION(DISABLE_PERL "Disable Perl scripting language") OPTION(DISABLE_PYTHON "Disable Python scripting language") @@ -1,10 +1,12 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2008-11-23 +ChangeLog - 2008-12-10 Version 0.2.7 (under dev!): + * new relay plugin (network communication between WeeChat and remote + application) * add support for more than one proxy, with proxy selection for each IRC server (task #6859) * add smart join/part/quit message filter in IRC plugin (task #8503) @@ -48,7 +50,7 @@ Version 0.2.7 (under dev!): * add /reload command to reload WeeChat and plugins config files (signal SIGHUP is catched to reload config files) * new plugins: alias, debug, demo, fifo, irc, logger, notify, tcl, trigger, - xfer + xfer, relay * add hooks: command, timer, file descriptor, connection, print, signal, config, completion, modifier, info, infolist * new plugin API with many new functions: hooks, buffer management, bars, diff --git a/configure.in b/configure.in index cdd63bf8c..28e3d2883 100644 --- a/configure.in +++ b/configure.in @@ -101,6 +101,7 @@ AH_VERBATIM([PLUGIN_FIFO], [#undef PLUGIN_FIFO]) AH_VERBATIM([PLUGIN_IRC], [#undef PLUGIN_IRC]) AH_VERBATIM([PLUGIN_LOGGER], [#undef PLUGIN_LOGGER]) AH_VERBATIM([PLUGIN_NOTIFY], [#undef PLUGIN_NOTIFY]) +AH_VERBATIM([PLUGIN_RELAY], [#undef PLUGIN_RELAY]) AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL]) AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON]) AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY]) @@ -126,6 +127,7 @@ AC_ARG_ENABLE(fifo, [ --disable-fifo turn off Fifo plugin (def AC_ARG_ENABLE(irc, [ --disable-irc turn off IRC plugin (default=compiled)],enable_irc=$enableval,enable_irc=yes) AC_ARG_ENABLE(logger, [ --disable-logger turn off Logger plugin (default=compiled)],enable_logger=$enableval,enable_logger=yes) AC_ARG_ENABLE(notify, [ --disable-notify turn off Notify plugin (default=compiled)],enable_notify=$enableval,enable_notify=yes) +AC_ARG_ENABLE(relay, [ --disable-relay turn off Relay plugin (default=compiled)],enable_relay=$enableval,enable_relay=yes) AC_ARG_ENABLE(scripts, [ --disable-scripts turn off script plugins (default=compiled if found)],enable_scripts=$enableval,enable_scripts=yes) AC_ARG_ENABLE(perl, [ --disable-perl turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes) AC_ARG_ENABLE(python, [ --disable-python turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes) @@ -396,6 +398,18 @@ else not_asked="$not_asked notify" fi +# --------------------------------- relay -------------------------------------- + +if test "x$enable_relay" = "xyes" ; then + RELAY_CFLAGS="" + RELAY_LFLAGS="" + AC_SUBST(RELAY_CFLAGS) + AC_SUBST(RELAY_LFLAGS) + AC_DEFINE(PLUGIN_RELAY) +else + not_asked="$not_asked relay" +fi + # ---------------------------------- perl -------------------------------------- PERL_VERSION= @@ -961,6 +975,7 @@ AM_CONDITIONAL(PLUGIN_FIFO, test "$enable_fifo" = "yes") AM_CONDITIONAL(PLUGIN_IRC, test "$enable_irc" = "yes") AM_CONDITIONAL(PLUGIN_LOGGER, test "$enable_logger" = "yes") AM_CONDITIONAL(PLUGIN_NOTIFY, test "$enable_notify" = "yes") +AM_CONDITIONAL(PLUGIN_RELAY, test "$enable_relay" = "yes") AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes") AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes") AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes") @@ -991,6 +1006,7 @@ AC_OUTPUT([Makefile src/plugins/irc/Makefile src/plugins/logger/Makefile src/plugins/notify/Makefile + src/plugins/relay/Makefile src/plugins/scripts/Makefile src/plugins/scripts/perl/Makefile src/plugins/scripts/python/Makefile @@ -1056,6 +1072,9 @@ fi if test "x$enable_notify" = "xyes"; then listplugins="$listplugins notify" fi +if test "x$enable_relay" = "xyes"; then + listplugins="$listplugins relay" +fi if test "x$enable_perl" = "xyes"; then listplugins="$listplugins perl($PERL_VERSION)" fi diff --git a/debian/control b/debian/control index 243f40b07..98e96ba16 100644 --- a/debian/control +++ b/debian/control @@ -54,7 +54,7 @@ Depends: ${misc:Depends}, ${shlibs:Depends}, weechat-curses (= ${binary:Version} Suggests: weechat-scripts Description: Plugins for WeeChat This package provides some plugins to enhance WeeChat. It currently ships - the following plugins: Perl, Python, Ruby, Lua, Tcl, Aspell and Fifo. + the following plugins: Perl, Python, Ruby, Lua, Tcl, Aspell, Relay and Fifo. Package: weechat-doc Section: doc diff --git a/debian/weechat-plugins.install b/debian/weechat-plugins.install index a5ed3eeb0..0f47f431d 100644 --- a/debian/weechat-plugins.install +++ b/debian/weechat-plugins.install @@ -1,7 +1,8 @@ +usr/lib/weechat/plugins/aspell.so usr/lib/weechat/plugins/fifo.so +usr/lib/weechat/plugins/relay.so usr/lib/weechat/plugins/perl.so usr/lib/weechat/plugins/python.so usr/lib/weechat/plugins/ruby.so usr/lib/weechat/plugins/lua.so -usr/lib/weechat/plugins/aspell.so usr/lib/weechat/plugins/tcl.so diff --git a/doc/de/autogen/relay_commands.xml b/doc/de/autogen/relay_commands.xml new file mode 100644 index 000000000..6ba15b874 --- /dev/null +++ b/doc/de/autogen/relay_commands.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<command>/relay</command> +<programlisting> +relay control + +Open buffer with relay clients list +</programlisting> + diff --git a/doc/de/autogen/relay_infos.xml b/doc/de/autogen/relay_infos.xml new file mode 100644 index 000000000..eb979c513 --- /dev/null +++ b/doc/de/autogen/relay_infos.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<row> + <entry>infolist</entry> + <entry>relay</entry> + <entry>list of relay clients</entry> +</row> diff --git a/doc/de/autogen/relay_options.xml b/doc/de/autogen/relay_options.xml new file mode 100644 index 000000000..48337494d --- /dev/null +++ b/doc/de/autogen/relay_options.xml @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<command>relay.color.status_active</command>: text color for "connected" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: lightblue)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_auth_failed</command>: text color for "authentication failed" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: lightred)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_connecting</command>: text color for "connecting" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: yellow)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_disconnected</command>: text color for "disconnected" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: lightred)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_waiting_auth</command>: text color for "waiting authentication" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: brown)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text</command>: text color +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: default)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text_bg</command>: background color +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: default)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text_selected</command>: text color of selected client line +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: white)</para> + </listitem> +</itemizedlist> + +<command>relay.look.auto_open_buffer</command>: auto open relay buffer when a new client is connecting +<itemizedlist> + <listitem> + <para>type: boolean</para> + </listitem> + <listitem> + <para>values: on, off (default value: on)</para> + </listitem> +</itemizedlist> + +<command>relay.network.listen_port_range</command>: port number (or range of ports) that relay plugin listens on (syntax: a single port, ie. 5000 or a port range, ie. 5000-5015) +<itemizedlist> + <listitem> + <para>type: string</para> + </listitem> + <listitem> + <para>values: any string (default value: '22373-22400')</para> + </listitem> +</itemizedlist> + +<command>relay.network.timeout</command>: timeout for relay request (in seconds) +<itemizedlist> + <listitem> + <para>type: integer</para> + </listitem> + <listitem> + <para>values: 5 .. 2147483647 (default value: 300)</para> + </listitem> +</itemizedlist> + diff --git a/doc/docgen.pl b/doc/docgen.pl index 060c67e06..4151a5b20 100644 --- a/doc/docgen.pl +++ b/doc/docgen.pl @@ -66,10 +66,10 @@ my %plugin_list = ("weechat" => "co", "alias" => "", "aspell" => "o", "charset" => "co", "demo" => "co", "fifo" => "co", "irc" => "co", "logger" => "co", - "notify" => "co", "perl" => "", - "python" => "", "ruby" => "", - "lua" => "", "tcl" => "", - "xfer" => "co"); + "notify" => "co", "relay" => "co", + "perl" => "", "python" => "", + "ruby" => "", "lua" => "", + "tcl" => "", "xfer" => "co"); # options to ignore my @ignore_options = ("aspell\\.dict\\..*", diff --git a/doc/en/autogen/relay_commands.xml b/doc/en/autogen/relay_commands.xml new file mode 100644 index 000000000..6ba15b874 --- /dev/null +++ b/doc/en/autogen/relay_commands.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<command>/relay</command> +<programlisting> +relay control + +Open buffer with relay clients list +</programlisting> + diff --git a/doc/en/autogen/relay_infos.xml b/doc/en/autogen/relay_infos.xml new file mode 100644 index 000000000..eb979c513 --- /dev/null +++ b/doc/en/autogen/relay_infos.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<row> + <entry>infolist</entry> + <entry>relay</entry> + <entry>list of relay clients</entry> +</row> diff --git a/doc/en/autogen/relay_options.xml b/doc/en/autogen/relay_options.xml new file mode 100644 index 000000000..48337494d --- /dev/null +++ b/doc/en/autogen/relay_options.xml @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<command>relay.color.status_active</command>: text color for "connected" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: lightblue)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_auth_failed</command>: text color for "authentication failed" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: lightred)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_connecting</command>: text color for "connecting" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: yellow)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_disconnected</command>: text color for "disconnected" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: lightred)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_waiting_auth</command>: text color for "waiting authentication" status +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: brown)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text</command>: text color +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: default)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text_bg</command>: background color +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: default)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text_selected</command>: text color of selected client line +<itemizedlist> + <listitem> + <para>type: color</para> + </listitem> + <listitem> + <para>values: a color name (default value: white)</para> + </listitem> +</itemizedlist> + +<command>relay.look.auto_open_buffer</command>: auto open relay buffer when a new client is connecting +<itemizedlist> + <listitem> + <para>type: boolean</para> + </listitem> + <listitem> + <para>values: on, off (default value: on)</para> + </listitem> +</itemizedlist> + +<command>relay.network.listen_port_range</command>: port number (or range of ports) that relay plugin listens on (syntax: a single port, ie. 5000 or a port range, ie. 5000-5015) +<itemizedlist> + <listitem> + <para>type: string</para> + </listitem> + <listitem> + <para>values: any string (default value: '22373-22400')</para> + </listitem> +</itemizedlist> + +<command>relay.network.timeout</command>: timeout for relay request (in seconds) +<itemizedlist> + <listitem> + <para>type: integer</para> + </listitem> + <listitem> + <para>values: 5 .. 2147483647 (default value: 300)</para> + </listitem> +</itemizedlist> + diff --git a/doc/en/dev/plugin_c_api.en.xml b/doc/en/dev/plugin_c_api.en.xml index 097e8d80c..58eabed6f 100644 --- a/doc/en/dev/plugin_c_api.en.xml +++ b/doc/en/dev/plugin_c_api.en.xml @@ -722,7 +722,9 @@ char *weechat_string_strip ( </note> <para> Example: - <screen>char *str = weechat_strip (string, " ", 0, 1); /* remove spaces at end of string */</screen> +<screen> +char *str = weechat_string_strip (string, " ", 0, 1); /* remove spaces at end of string */ +</screen> </para> </section> @@ -857,7 +859,7 @@ char **weechat_string_explode ( </note> <para> Examples: - <screen> +<screen> char **argv; int argc; argv = weechat_string_explode ("abc de fghi", " ", 0, 0, &argc); @@ -877,7 +879,7 @@ argv = weechat_string_explode ("abc de fghi", " ", 1, 0, &argc); argc == 3 */ weechat_string_free_exploded (argv); - </screen> +</screen> </para> </section> @@ -909,13 +911,13 @@ void weechat_string_free_exploded (char **exploded_string); </para> <para> Example: - <screen> +<screen> char *argv; int argc; argv = weechat_string_explode (string, " ", 0, 0, &argc); ... weechat_string_free_exploded (, argv); - </screen> +</screen> </para> </section> @@ -959,13 +961,13 @@ char *weechat_string_build_with_exploded ( </note> <para> Example: - <screen> +<screen> char **argv; int argc; argv = weechat_string_explode ("abc def ghi", " ", 0, 0, &argc); char *string = weechat_string_build_with_exploded (argv, ";"); /* string == "abc;def;ghi" */ - </screen> +</screen> </para> </section> @@ -1040,11 +1042,60 @@ void weechat_string_free_splitted_command (char **splitted_command); </para> <para> Example: - <screen> +<screen> char **argv = weechat_string_split_command ("/command1;/command2", ';'); ... weechat_string_free_splitted_command (argv); - </screen> +</screen> + </para> + </section> + + <section id="secPluginCApi_weechat_string_format_size"> + <title>weechat_string_format_size</title> + + <para> + Prototype: +<programlisting> +char *weechat_string_format_size (unsigned long size); +</programlisting> + </para> + <para> + Build a string with formated size and translated unit. + </para> + <para> + Arguments: + <itemizedlist> + <listitem> + <para> + <option>size</option>: size + </para> + </listitem> + </itemizedlist> + </para> + <para> + Return value: string with formated size and translated unit. + </para> + <note> + <para> + Result has to be free by a call to "free" after use. + </para> + </note> + <para> + Example: +<screen> +char *str = weechat_string_format_size (0); /* str == "0 byte" (english locale) */ +if (str) + free (str); +char *str = weechat_string_format_size (200); /* str == "200 bytes" (english locale) */ +if (str) + free (str); +char *str = weechat_string_format_size (1536); /* str == "1.5 KB" (english locale) */ +if (str) + free (str); +char *str = weechat_string_format_size (2097152); /* str == "2 MB" (english locale) */ +if (str) + free (str); +</screen> </para> </section> @@ -1123,10 +1174,10 @@ int weechat_utf8_is_valid (const char *string, char **error); </para> <para> Example: - <screen> +<screen> char *error; if (weechat_utf8_is_valid (string, &error)) ... - </screen> +</screen> </para> </section> diff --git a/doc/fr/autogen/relay_commands.xml b/doc/fr/autogen/relay_commands.xml new file mode 100644 index 000000000..e7e644f71 --- /dev/null +++ b/doc/fr/autogen/relay_commands.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<command>/relay</command> +<programlisting> +contrĂ´le du relai + +Ouverture du tampon avec la liste des clients pour le relai +</programlisting> + diff --git a/doc/fr/autogen/relay_infos.xml b/doc/fr/autogen/relay_infos.xml new file mode 100644 index 000000000..9e9834a12 --- /dev/null +++ b/doc/fr/autogen/relay_infos.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<row> + <entry>infolist</entry> + <entry>relay</entry> + <entry>liste des clients pour le relai</entry> +</row> diff --git a/doc/fr/autogen/relay_options.xml b/doc/fr/autogen/relay_options.xml new file mode 100644 index 000000000..77bfc3e09 --- /dev/null +++ b/doc/fr/autogen/relay_options.xml @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ********* WARNING! ********* + + This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** + docgen.pl builds XML doc files to include in many languages +--> + +<command>relay.color.status_active</command>: couleur du texte pour le statut "connectĂ©" +<itemizedlist> + <listitem> + <para>type: couleur</para> + </listitem> + <listitem> + <para>valeurs: un nom de couleur (valeur par dĂ©faut: lightblue)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_auth_failed</command>: couleur du texte pour le statut "Ă©chec auth" +<itemizedlist> + <listitem> + <para>type: couleur</para> + </listitem> + <listitem> + <para>valeurs: un nom de couleur (valeur par dĂ©faut: lightred)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_connecting</command>: couleur du texte pour le statut "connexion" +<itemizedlist> + <listitem> + <para>type: couleur</para> + </listitem> + <listitem> + <para>valeurs: un nom de couleur (valeur par dĂ©faut: yellow)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_disconnected</command>: couleur du texte pour le statut "dĂ©connectĂ©" +<itemizedlist> + <listitem> + <para>type: couleur</para> + </listitem> + <listitem> + <para>valeurs: un nom de couleur (valeur par dĂ©faut: lightred)</para> + </listitem> +</itemizedlist> + +<command>relay.color.status_waiting_auth</command>: couleur du texte pour le statut "attente auth" +<itemizedlist> + <listitem> + <para>type: couleur</para> + </listitem> + <listitem> + <para>valeurs: un nom de couleur (valeur par dĂ©faut: brown)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text</command>: couleur du texte +<itemizedlist> + <listitem> + <para>type: couleur</para> + </listitem> + <listitem> + <para>valeurs: un nom de couleur (valeur par dĂ©faut: default)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text_bg</command>: couleur du fond +<itemizedlist> + <listitem> + <para>type: couleur</para> + </listitem> + <listitem> + <para>valeurs: un nom de couleur (valeur par dĂ©faut: default)</para> + </listitem> +</itemizedlist> + +<command>relay.color.text_selected</command>: couleur du texte pour la ligne client sĂ©lectionnĂ©e +<itemizedlist> + <listitem> + <para>type: couleur</para> + </listitem> + <listitem> + <para>valeurs: un nom de couleur (valeur par dĂ©faut: white)</para> + </listitem> +</itemizedlist> + +<command>relay.look.auto_open_buffer</command>: ouvrir automatiquement le tampon des clients lorsqu'un nouveau client est ajoutĂ© Ă la liste +<itemizedlist> + <listitem> + <para>type: boolĂ©en</para> + </listitem> + <listitem> + <para>valeurs: on, off (valeur par dĂ©faut: on)</para> + </listitem> +</itemizedlist> + +<command>relay.network.listen_port_range</command>: numĂ©ro de port (ou intervalle de ports) sur lesquels Ă©coute l'extension relay (syntaxe: un port simple, par exemple 5000, un intervalle de ports, par exemple 5000-5015) +<itemizedlist> + <listitem> + <para>type: chaĂ®ne</para> + </listitem> + <listitem> + <para>valeurs: toute chaĂ®ne (valeur par dĂ©faut: '22373-22400')</para> + </listitem> +</itemizedlist> + +<command>relay.network.timeout</command>: dĂ©lai d'attente pour la requĂªte relai (en secondes) +<itemizedlist> + <listitem> + <para>type: entier</para> + </listitem> + <listitem> + <para>valeurs: 5 .. 2147483647 (valeur par dĂ©faut: 300)</para> + </listitem> +</itemizedlist> + diff --git a/doc/include_autogen.xml b/doc/include_autogen.xml index e7dafb9dc..b4098dc8b 100644 --- a/doc/include_autogen.xml +++ b/doc/include_autogen.xml @@ -10,6 +10,7 @@ <!ENTITY notify_commands.xml SYSTEM "autogen/notify_commands.xml"> <!ENTITY perl_commands.xml SYSTEM "autogen/perl_commands.xml"> <!ENTITY python_commands.xml SYSTEM "autogen/python_commands.xml"> +<!ENTITY relay_commands.xml SYSTEM "autogen/relay_commands.xml"> <!ENTITY ruby_commands.xml SYSTEM "autogen/ruby_commands.xml"> <!ENTITY tcl_commands.xml SYSTEM "autogen/tcl_commands.xml"> <!ENTITY weechat_commands.xml SYSTEM "autogen/weechat_commands.xml"> @@ -21,6 +22,7 @@ <!ENTITY charset_options.xml SYSTEM "autogen/charset_options.xml"> <!ENTITY irc_options.xml SYSTEM "autogen/irc_options.xml"> <!ENTITY logger_options.xml SYSTEM "autogen/logger_options.xml"> +<!ENTITY relay_options.xml SYSTEM "autogen/relay_options.xml"> <!ENTITY weechat_options.xml SYSTEM "autogen/weechat_options.xml"> <!ENTITY xfer_options.xml SYSTEM "autogen/xfer_options.xml"> @@ -30,5 +32,6 @@ <!ENTITY fifo_infos.xml SYSTEM "autogen/fifo_infos.xml"> <!ENTITY irc_infos.xml SYSTEM "autogen/irc_infos.xml"> <!ENTITY logger_infos.xml SYSTEM "autogen/logger_infos.xml"> +<!ENTITY relay_infos.xml SYSTEM "autogen/relay_infos.xml"> <!ENTITY weechat_infos.xml SYSTEM "autogen/weechat_infos.xml"> <!ENTITY xfer_infos.xml SYSTEM "autogen/xfer_infos.xml"> diff --git a/po/POTFILES.in b/po/POTFILES.in index c0f4d92bb..b4e0587f1 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -148,6 +148,22 @@ ./src/plugins/plugin-config.c ./src/plugins/plugin-config.h ./src/plugins/plugin.h +./src/plugins/relay/relay-buffer.c +./src/plugins/relay/relay-buffer.h +./src/plugins/relay/relay.c +./src/plugins/relay/relay-client.c +./src/plugins/relay/relay-client.h +./src/plugins/relay/relay-command.c +./src/plugins/relay/relay-command.h +./src/plugins/relay/relay-config.c +./src/plugins/relay/relay-config.h +./src/plugins/relay/relay.h +./src/plugins/relay/relay-info.c +./src/plugins/relay/relay-info.h +./src/plugins/relay/relay-network.c +./src/plugins/relay/relay-network.h +./src/plugins/relay/relay-upgrade.c +./src/plugins/relay/relay-upgrade.h ./src/plugins/scripts/lua/weechat-lua-api.c ./src/plugins/scripts/lua/weechat-lua-api.h ./src/plugins/scripts/lua/weechat-lua.c @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-11-23 22:44+0100\n" +"POT-Creation-Date: 2008-12-10 17:02+0100\n" "PO-Revision-Date: 2008-09-17 16:19+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1827,6 +1827,22 @@ msgstr "uživatelskĂ© jmĂ©no pro proxy server" msgid "password for proxy server" msgstr "heslo pro proxy server" +msgid "bytes" +msgstr "bajtů" + +msgid "KB" +msgstr "KB" + +msgid "MB" +msgstr "MB" + +msgid "GB" +msgstr "GB" + +#, fuzzy +msgid "byte" +msgstr "bajtů" + #, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "%s nemohu vytvoÅ™it soubor \"%s\"\n" @@ -4367,6 +4383,161 @@ msgstr "Plugin \"%s\" odebrĂ¡n.\n" msgid "%sError: plugin \"%s\" not found" msgstr "%s plugin \"%s\" nenalezen\n" +msgid "Actions (letter+enter):" +msgstr "Akce (pĂsmeno+enter):" + +msgid " [D] Disconnect" +msgstr "" + +msgid " [R] Remove" +msgstr " [R] Odebrat" + +#, fuzzy +msgid " [P] Purge finished" +msgstr " [P] ProÄistit starĂ© DCC" + +#, fuzzy +msgid " [Q] Close this buffer" +msgstr " [Q] ZavÅ™Ăt DCC pohled" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s%s] %s (started on: %s)" +msgstr "%s%s%s je pryÄ: %s\n" + +#, fuzzy, c-format +msgid "%s%-26s received: %s, sent: %s" +msgstr "DCC: soubor %s%s%s" + +msgid "List of clients for relay" +msgstr "" + +#, fuzzy +msgid "connecting" +msgstr "PÅ™ipojuji" + +#, fuzzy +msgid "waiting auth" +msgstr "ÄŒekĂ¡m" + +#, fuzzy +msgid "auth failed" +msgstr "Selhal" + +#, fuzzy +msgid "disconnected" +msgstr "pÅ™ipojen" + +#, fuzzy, c-format +msgid "%s%s: error sending data to client %s" +msgstr "%s chyba pÅ™i zasĂlĂ¡nĂ dat na IRC server\n" + +#, c-format +msgid "%s: new client @ %s" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: not enough memory for new client" +msgstr "%s nedostatek pamÄ›ti pro novĂ© DCC\n" + +#, fuzzy, c-format +msgid "%s%s: authentication failed with client @ %s" +msgstr "Nemůžu zapsat log soubor \"%s\"\n" + +#, fuzzy, c-format +msgid "%s: disconnected from client @ %s" +msgstr "Odpojen od serveru!\n" + +msgid "Clients for relay:" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s, last activity: %s, bytes: %lu recv, %lu sent" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s" +msgstr "" + +msgid "No client for relay" +msgstr "" + +#, fuzzy +msgid "relay control" +msgstr "ovlĂ¡dĂ¡nĂ xfer" + +msgid "" +" list: list relay clients\n" +"listfull: list relay clients (verbose)\n" +"\n" +"Without argument, this command opens buffer with list of relay clients." +msgstr "" + +#, fuzzy +msgid "auto open relay buffer when a new client is connecting" +msgstr "" +"automaticky otevÅ™Ăt xfer buffer, když je pÅ™idĂ¡na novĂ¡ položka do xfer seznamu" + +#, fuzzy +msgid "text color" +msgstr "barva pro text rozhovoru" + +#, fuzzy +msgid "background color" +msgstr "pozadĂ pÅ™ezdĂvek" + +#, fuzzy +msgid "text color of selected client line" +msgstr "barva pro jemĂ©no serveru" + +#, fuzzy +msgid "text color for \"connecting\" status" +msgstr "barva pro \"connecting\" status dcc" + +#, fuzzy +msgid "text color for \"waiting authentication\" status" +msgstr "barva pro \"waiting\" status dcc" + +#, fuzzy +msgid "text color for \"connected\" status" +msgstr "barva pro \"connecting\" status dcc" + +#, fuzzy +msgid "text color for \"authentication failed\" status" +msgstr "barva pro \"failed\" status dcc" + +#, fuzzy +msgid "text color for \"disconnected\" status" +msgstr "barva pro \"connecting\" status dcc" + +#, fuzzy +msgid "" +"port number (or range of ports) that relay plugin listens on (syntax: a " +"single port, ie. 5000 or a port range, ie. 5000-5015)" +msgstr "" +"omezit odchozĂ dcc pro použĂvanĂ portů pouze v zadanĂ©m rozsahu (užiteÄnĂ© pro " +"NAT) (syntaxe: samostatnĂ½ port, napÅ™. 5000 nebo rozsah portů napÅ™. 5000-" +"5015, prĂ¡zdnĂ¡ hodnota znamenĂ¡ jakĂ½koliv port)" + +#, fuzzy +msgid "list of relay clients" +msgstr "Seznam pro aliasy:\n" + +#, fuzzy, c-format +msgid "%s%s: cannot accept client" +msgstr "%s nemohu vytvoÅ™it soket\n" + +#, c-format +msgid "%s%s: option \"listen_port_range\" is not defined" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: cannot find available port for listening" +msgstr "%s nemůžu najĂt dostupnĂ½ port pro DCC\n" + +#, c-format +msgid "%s: listening on port %d" +msgstr "" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4605,38 +4776,12 @@ msgstr "%s nemohu vytvoÅ™it server\n" msgid "%s%s: error occured while parsing file \"%s\": %s" msgstr "Nemůžu zapsat log soubor \"%s\"\n" -msgid "bytes" -msgstr "bajtů" - -msgid "KB" -msgstr "KB" - -msgid "MB" -msgstr "MB" - -msgid "GB" -msgstr "GB" - -msgid "Actions (letter+enter):" -msgstr "Akce (pĂsmeno+enter):" - msgid " [A] Accept" msgstr " [A] Akceptovat" msgid " [C] Cancel" msgstr " [C] Storno" -msgid " [R] Remove" -msgstr " [R] Odebrat" - -#, fuzzy -msgid " [P] Purge finished" -msgstr " [P] ProÄistit starĂ© DCC" - -#, fuzzy -msgid " [Q] Close xfer list" -msgstr " [Q] ZavÅ™Ăt DCC pohled" - msgid "xfer chat" msgstr "xfer chat" @@ -4652,10 +4797,6 @@ msgid "waiting" msgstr "ÄŒekĂ¡m" #, fuzzy -msgid "connecting" -msgstr "PÅ™ipojuji" - -#, fuzzy msgid "active" msgstr "AktivnĂ" @@ -4827,8 +4968,12 @@ msgstr "Å½Ă¡dnĂ½ xfer" msgid "xfer control" msgstr "ovlĂ¡dĂ¡nĂ xfer" -msgid "Open buffer with xfer list" -msgstr "OtevÅ™enĂ© buffery s xfer seznamem" +msgid "" +" list: list xfer\n" +"listfull: list xfer (verbose)\n" +"\n" +"Without argument, this command opens buffer with xfer list." +msgstr "" msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -4838,14 +4983,6 @@ msgid "size of progress bar, in chars (if 0, progress bar is disabled)" msgstr "velikost ukazatele průbÄ›hu ve znacĂch (0 pro vypnutĂ ukazatele)" #, fuzzy -msgid "text color" -msgstr "barva pro text rozhovoru" - -#, fuzzy -msgid "background color" -msgstr "pozadĂ pÅ™ezdĂvek" - -#, fuzzy msgid "text color of selected xfer line" msgstr "barva pro jemĂ©no serveru" @@ -4854,10 +4991,6 @@ msgid "text color for \"waiting\" status" msgstr "barva pro \"waiting\" status dcc" #, fuzzy -msgid "text color for \"connecting\" status" -msgstr "barva pro \"connecting\" status dcc" - -#, fuzzy msgid "text color for \"active\" status" msgstr "barva pro \"active\" status dcc" @@ -4992,6 +5125,29 @@ msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s chybĂ argument pro volbu \"%s\"\n" #, fuzzy +#~ msgid "timeout for relay request (in seconds)" +#~ msgstr "ÄasovĂ½ limit pro dcc požadavek (v sekundĂ¡ch)" + +#, fuzzy +#~ msgid "Open buffer with relay clients list" +#~ msgstr "OtevÅ™enĂ© buffery s xfer seznamem" + +#~ msgid "Open buffer with xfer list" +#~ msgstr "OtevÅ™enĂ© buffery s xfer seznamem" + +#, fuzzy +#~ msgid "%s%s: disconnecting client @ %s" +#~ msgstr "%s: Navazuji novĂ© spojenĂ se serverem za %d sekund\n" + +#, fuzzy +#~ msgid "%s%s: cannot bind socket" +#~ msgstr "%s nemohu vytvoÅ™it soket\n" + +#, fuzzy +#~ msgid " [Q] Close client list" +#~ msgstr " [Q] ZavÅ™Ăt DCC pohled" + +#, fuzzy #~ msgid "use a proxy server" #~ msgstr "uživatelskĂ© jmĂ©no pro proxy server" @@ -5154,9 +5310,5 @@ msgstr "%s chybĂ argument pro volbu \"%s\"\n" #~ msgstr "Seznam bufferů:" #, fuzzy -#~ msgid "%s: disconnected from server" -#~ msgstr "Odpojen od serveru!\n" - -#, fuzzy #~ msgid "%s: connecting to server %s/%d%s%s..." #~ msgstr "%s: pÅ™ipojuji se k serveru %s:%d%s%s...\n" @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-11-23 22:44+0100\n" +"POT-Creation-Date: 2008-12-10 17:02+0100\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1846,6 +1846,22 @@ msgstr "Benutzername fĂ¼r die Proxyverbindung" msgid "password for proxy server" msgstr "Passwort fĂ¼r die Proxyverbindung" +msgid "bytes" +msgstr "Bytes" + +msgid "KB" +msgstr "KB" + +msgid "MB" +msgstr "MB" + +msgid "GB" +msgstr "GB" + +#, fuzzy +msgid "byte" +msgstr "Bytes" + #, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "Aktualisiere WeeChat...\n" @@ -4343,6 +4359,159 @@ msgstr "Plugin \"%s\" entladen.\n" msgid "%sError: plugin \"%s\" not found" msgstr "%s Plugin \"%s\" nicht gefunden\n" +msgid "Actions (letter+enter):" +msgstr "" + +msgid " [D] Disconnect" +msgstr "" + +msgid " [R] Remove" +msgstr " [R] entfernen" + +#, fuzzy +msgid " [P] Purge finished" +msgstr " [P] alte DCCs entfernen" + +#, fuzzy +msgid " [Q] Close this buffer" +msgstr " [Q] DCC-Ansicht schlieĂŸen" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s%s] %s (started on: %s)" +msgstr "%s%s%s ist abwesend: %s\n" + +#, fuzzy, c-format +msgid "%s%-26s received: %s, sent: %s" +msgstr "DCC: Datei %s%s%s" + +msgid "List of clients for relay" +msgstr "" + +#, fuzzy +msgid "connecting" +msgstr "verbinden" + +#, fuzzy +msgid "waiting auth" +msgstr "warten" + +#, fuzzy +msgid "auth failed" +msgstr "fehlg." + +#, fuzzy +msgid "disconnected" +msgstr "verbunden" + +#, fuzzy, c-format +msgid "%s%s: error sending data to client %s" +msgstr "%s Fehler beim Senden von Daten an den IRC-Server\n" + +#, c-format +msgid "%s: new client @ %s" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: not enough memory for new client" +msgstr "%s nicht genug Speicher fĂ¼r neuen DCC\n" + +#, fuzzy, c-format +msgid "%s%s: authentication failed with client @ %s" +msgstr "Kann das Logfile nicht schreiben\n" + +#, fuzzy, c-format +msgid "%s: disconnected from client @ %s" +msgstr "Vom Server getrennt!\n" + +msgid "Clients for relay:" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s, last activity: %s, bytes: %lu recv, %lu sent" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s" +msgstr "" + +msgid "No client for relay" +msgstr "" + +msgid "relay control" +msgstr "" + +msgid "" +" list: list relay clients\n" +"listfull: list relay clients (verbose)\n" +"\n" +"Without argument, this command opens buffer with list of relay clients." +msgstr "" + +msgid "auto open relay buffer when a new client is connecting" +msgstr "" + +#, fuzzy +msgid "text color" +msgstr "Farbe vom Chat-Text" + +#, fuzzy +msgid "background color" +msgstr "Hintergrundfarbe der Nicknames" + +#, fuzzy +msgid "text color of selected client line" +msgstr "Farbe des Servernamens" + +#, fuzzy +msgid "text color for \"connecting\" status" +msgstr "Farbe des DCC-Status 'verbinden'" + +#, fuzzy +msgid "text color for \"waiting authentication\" status" +msgstr "Farbe des DCC-Status 'warten'" + +#, fuzzy +msgid "text color for \"connected\" status" +msgstr "Farbe des DCC-Status 'verbinden'" + +#, fuzzy +msgid "text color for \"authentication failed\" status" +msgstr "Farbe des DCC-Status 'fehlgeschlagen'" + +#, fuzzy +msgid "text color for \"disconnected\" status" +msgstr "Farbe des DCC-Status 'verbinden'" + +#, fuzzy +msgid "" +"port number (or range of ports) that relay plugin listens on (syntax: a " +"single port, ie. 5000 or a port range, ie. 5000-5015)" +msgstr "" +"beschränkt ausgehenden DCC auf die ausschlieĂŸliche Benutzung von Ports in " +"einem vorgegebenen Bereich (hilfreich bei NAT) (Syntax: ein einzelner Port, " +"z.B. 5000, oder eine Port-Bereich, z.B. 5000-5015,wenn kein Bereich " +"angegeben ist, ist jeder Port möglich)" + +#, fuzzy +msgid "list of relay clients" +msgstr "Liste der Aliases:\n" + +#, fuzzy, c-format +msgid "%s%s: cannot accept client" +msgstr "%s Socket konnte nicht angelegt werden\n" + +#, c-format +msgid "%s%s: option \"listen_port_range\" is not defined" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: cannot find available port for listening" +msgstr "%s kann keinen freien Port fĂ¼r DCC ermitteln\n" + +#, c-format +msgid "%s: listening on port %d" +msgstr "" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4573,38 +4742,12 @@ msgstr "%s kann den Server nicht anlegen\n" msgid "%s%s: error occured while parsing file \"%s\": %s" msgstr "Kann das Logfile nicht schreiben\n" -msgid "bytes" -msgstr "Bytes" - -msgid "KB" -msgstr "KB" - -msgid "MB" -msgstr "MB" - -msgid "GB" -msgstr "GB" - -msgid "Actions (letter+enter):" -msgstr "" - msgid " [A] Accept" msgstr " [A] annehmen" msgid " [C] Cancel" msgstr " [C] abbrechen" -msgid " [R] Remove" -msgstr " [R] entfernen" - -#, fuzzy -msgid " [P] Purge finished" -msgstr " [P] alte DCCs entfernen" - -#, fuzzy -msgid " [Q] Close xfer list" -msgstr " [Q] DCC-Ansicht schlieĂŸen" - msgid "xfer chat" msgstr "" @@ -4620,10 +4763,6 @@ msgid "waiting" msgstr "warten" #, fuzzy -msgid "connecting" -msgstr "verbinden" - -#, fuzzy msgid "active" msgstr "aktiv" @@ -4793,9 +4932,12 @@ msgstr "Kein Server.\n" msgid "xfer control" msgstr "" -#, fuzzy -msgid "Open buffer with xfer list" -msgstr "Offene Puffer:\n" +msgid "" +" list: list xfer\n" +"listfull: list xfer (verbose)\n" +"\n" +"Without argument, this command opens buffer with xfer list." +msgstr "" msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -4804,14 +4946,6 @@ msgid "size of progress bar, in chars (if 0, progress bar is disabled)" msgstr "" #, fuzzy -msgid "text color" -msgstr "Farbe vom Chat-Text" - -#, fuzzy -msgid "background color" -msgstr "Hintergrundfarbe der Nicknames" - -#, fuzzy msgid "text color of selected xfer line" msgstr "Farbe des Servernamens" @@ -4820,10 +4954,6 @@ msgid "text color for \"waiting\" status" msgstr "Farbe des DCC-Status 'warten'" #, fuzzy -msgid "text color for \"connecting\" status" -msgstr "Farbe des DCC-Status 'verbinden'" - -#, fuzzy msgid "text color for \"active\" status" msgstr "Farbe des DCC-Status 'aktiv'" @@ -4958,6 +5088,30 @@ msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s fehlende Argumente fĂ¼r die \"--dir\"-Option\n" #, fuzzy +#~ msgid "timeout for relay request (in seconds)" +#~ msgstr "DCC-Timeout in Sekunden" + +#, fuzzy +#~ msgid "Open buffer with relay clients list" +#~ msgstr "Offene Puffer:\n" + +#, fuzzy +#~ msgid "Open buffer with xfer list" +#~ msgstr "Offene Puffer:\n" + +#, fuzzy +#~ msgid "%s%s: disconnecting client @ %s" +#~ msgstr "%s: Neuverbinden in %d Sekunden\n" + +#, fuzzy +#~ msgid "%s%s: cannot bind socket" +#~ msgstr "%s Socket konnte nicht angelegt werden\n" + +#, fuzzy +#~ msgid " [Q] Close client list" +#~ msgstr " [Q] DCC-Ansicht schlieĂŸen" + +#, fuzzy #~ msgid "use a proxy server" #~ msgstr "Benutzername fĂ¼r die Proxyverbindung" @@ -5110,9 +5264,5 @@ msgstr "%s fehlende Argumente fĂ¼r die \"--dir\"-Option\n" #~ msgstr "-MEHR-" #, fuzzy -#~ msgid "%s: disconnected from server" -#~ msgstr "Vom Server getrennt!\n" - -#, fuzzy #~ msgid "%s: connecting to server %s/%d%s%s..." #~ msgstr "%s: verbinden zu Server %s:%d%s%s...\n" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-11-23 22:44+0100\n" +"POT-Creation-Date: 2008-12-10 17:02+0100\n" "PO-Revision-Date: 2007-09-19 12:09+0200\n" "Last-Translator: Roberto GonzĂƒÂ¡lez Cardenete <robert.glez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1827,6 +1827,22 @@ msgstr "nombre de usuario para el servidor proxy" msgid "password for proxy server" msgstr "contraseĂƒÂ±a para el servidor proxy" +msgid "bytes" +msgstr "bytes" + +msgid "KB" +msgstr "" + +msgid "MB" +msgstr "" + +msgid "GB" +msgstr "" + +#, fuzzy +msgid "byte" +msgstr "bytes" + #, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "Actualizando Weechat...\n" @@ -4344,6 +4360,158 @@ msgstr "Plugin \"%s\" descargado.\n" msgid "%sError: plugin \"%s\" not found" msgstr "%s plugin \"%s\" no encontrado\n" +msgid "Actions (letter+enter):" +msgstr "" + +msgid " [D] Disconnect" +msgstr "" + +msgid " [R] Remove" +msgstr " [R] Eliminar" + +#, fuzzy +msgid " [P] Purge finished" +msgstr " [P] Purgar los viejos DCC" + +#, fuzzy +msgid " [Q] Close this buffer" +msgstr " [Q] Cerrar la vista DCC" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s%s] %s (started on: %s)" +msgstr "%s%s%s estĂƒÂ¡ ausente: %s\n" + +#, fuzzy, c-format +msgid "%s%-26s received: %s, sent: %s" +msgstr "DCC: fichero %s%s%s" + +msgid "List of clients for relay" +msgstr "" + +#, fuzzy +msgid "connecting" +msgstr "Conectando" + +#, fuzzy +msgid "waiting auth" +msgstr "Esperando" + +#, fuzzy +msgid "auth failed" +msgstr "FallĂƒÂ³" + +#, fuzzy +msgid "disconnected" +msgstr "conectado" + +#, fuzzy, c-format +msgid "%s%s: error sending data to client %s" +msgstr "%s error enviando datos al servidor IRC\n" + +#, c-format +msgid "%s: new client @ %s" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: not enough memory for new client" +msgstr "%s no hay memoria suficiente para un nuevo DCC\n" + +#, fuzzy, c-format +msgid "%s%s: authentication failed with client @ %s" +msgstr "No es posible escribir un fichero de log para un bĂƒÂºfer\n" + +#, fuzzy, c-format +msgid "%s: disconnected from client @ %s" +msgstr "Ă‚Â¡Desconectado del servidor!\n" + +msgid "Clients for relay:" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s, last activity: %s, bytes: %lu recv, %lu sent" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s" +msgstr "" + +msgid "No client for relay" +msgstr "" + +msgid "relay control" +msgstr "" + +msgid "" +" list: list relay clients\n" +"listfull: list relay clients (verbose)\n" +"\n" +"Without argument, this command opens buffer with list of relay clients." +msgstr "" + +msgid "auto open relay buffer when a new client is connecting" +msgstr "" + +#, fuzzy +msgid "text color" +msgstr "color para el texto de conversaciĂƒÂ³n" + +#, fuzzy +msgid "background color" +msgstr "color de fondo para los nombres de usuario" + +#, fuzzy +msgid "text color of selected client line" +msgstr "color para el nombre del servidor" + +#, fuzzy +msgid "text color for \"connecting\" status" +msgstr "color para el estado dcc \"conectando\"" + +#, fuzzy +msgid "text color for \"waiting authentication\" status" +msgstr "color para el estado dcc \"esperando\"" + +#, fuzzy +msgid "text color for \"connected\" status" +msgstr "color para el estado dcc \"conectando\"" + +#, fuzzy +msgid "text color for \"authentication failed\" status" +msgstr "color para el estado dcc \"fallo\"" + +#, fuzzy +msgid "text color for \"disconnected\" status" +msgstr "color para el estado dcc \"conectando\"" + +#, fuzzy +msgid "" +"port number (or range of ports) that relay plugin listens on (syntax: a " +"single port, ie. 5000 or a port range, ie. 5000-5015)" +msgstr "" +"restringe el dcc de salida a utilizar ĂƒÂºnicamente los puertos del rango " +"especificado (ĂƒÂºtil para NAT) (sintaxis: un puerto simple, e.g. 5000, o un " +"rango de puertos, e.g. 5000-5015, un valor vacĂƒÂo significa cualquier puerto)" + +#, fuzzy +msgid "list of relay clients" +msgstr "Lista de alias:\n" + +#, fuzzy, c-format +msgid "%s%s: cannot accept client" +msgstr "%s no ha sido posible crear el socket\n" + +#, c-format +msgid "%s%s: option \"listen_port_range\" is not defined" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: cannot find available port for listening" +msgstr "%s no puede encontrar un puerto disponible para el DCC\n" + +#, c-format +msgid "%s: listening on port %d" +msgstr "" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4573,38 +4741,12 @@ msgstr "%s no es posible crear el servidor\n" msgid "%s%s: error occured while parsing file \"%s\": %s" msgstr "No es posible escribir un fichero de log para un bĂƒÂºfer\n" -msgid "bytes" -msgstr "bytes" - -msgid "KB" -msgstr "" - -msgid "MB" -msgstr "" - -msgid "GB" -msgstr "" - -msgid "Actions (letter+enter):" -msgstr "" - msgid " [A] Accept" msgstr " [A] Aceptar" msgid " [C] Cancel" msgstr " [C] Cancelar" -msgid " [R] Remove" -msgstr " [R] Eliminar" - -#, fuzzy -msgid " [P] Purge finished" -msgstr " [P] Purgar los viejos DCC" - -#, fuzzy -msgid " [Q] Close xfer list" -msgstr " [Q] Cerrar la vista DCC" - msgid "xfer chat" msgstr "" @@ -4620,10 +4762,6 @@ msgid "waiting" msgstr "Esperando" #, fuzzy -msgid "connecting" -msgstr "Conectando" - -#, fuzzy msgid "active" msgstr "Activo" @@ -4795,9 +4933,12 @@ msgstr "NingĂƒÂºn servidor.\n" msgid "xfer control" msgstr "" -#, fuzzy -msgid "Open buffer with xfer list" -msgstr "BĂƒÂºfers abiertos:\n" +msgid "" +" list: list xfer\n" +"listfull: list xfer (verbose)\n" +"\n" +"Without argument, this command opens buffer with xfer list." +msgstr "" msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -4806,14 +4947,6 @@ msgid "size of progress bar, in chars (if 0, progress bar is disabled)" msgstr "" #, fuzzy -msgid "text color" -msgstr "color para el texto de conversaciĂƒÂ³n" - -#, fuzzy -msgid "background color" -msgstr "color de fondo para los nombres de usuario" - -#, fuzzy msgid "text color of selected xfer line" msgstr "color para el nombre del servidor" @@ -4822,10 +4955,6 @@ msgid "text color for \"waiting\" status" msgstr "color para el estado dcc \"esperando\"" #, fuzzy -msgid "text color for \"connecting\" status" -msgstr "color para el estado dcc \"conectando\"" - -#, fuzzy msgid "text color for \"active\" status" msgstr "color para el estado dcc \"activo\"" @@ -4963,6 +5092,30 @@ msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s falta un argumento para la opciĂƒÂ³n --dir\n" #, fuzzy +#~ msgid "timeout for relay request (in seconds)" +#~ msgstr "tiempo de espera para la peticiĂƒÂ³n dcc (en segundos)" + +#, fuzzy +#~ msgid "Open buffer with relay clients list" +#~ msgstr "BĂƒÂºfers abiertos:\n" + +#, fuzzy +#~ msgid "Open buffer with xfer list" +#~ msgstr "BĂƒÂºfers abiertos:\n" + +#, fuzzy +#~ msgid "%s%s: disconnecting client @ %s" +#~ msgstr "%s: ReconexiĂƒÂ³n al servidor en %d segundos\n" + +#, fuzzy +#~ msgid "%s%s: cannot bind socket" +#~ msgstr "%s no ha sido posible crear el socket\n" + +#, fuzzy +#~ msgid " [Q] Close client list" +#~ msgstr " [Q] Cerrar la vista DCC" + +#, fuzzy #~ msgid "use a proxy server" #~ msgstr "nombre de usuario para el servidor proxy" @@ -5111,9 +5264,5 @@ msgstr "%s falta un argumento para la opciĂƒÂ³n --dir\n" #~ msgstr "-MĂƒÂS-" #, fuzzy -#~ msgid "%s: disconnected from server" -#~ msgstr "Ă‚Â¡Desconectado del servidor!\n" - -#, fuzzy #~ msgid "%s: connecting to server %s/%d%s%s..." #~ msgstr "%s: conectando al servidor %s:%d%s%s...\n" @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-11-23 22:44+0100\n" -"PO-Revision-Date: 2008-11-23 22:46+0100\n" +"POT-Creation-Date: 2008-12-10 17:02+0100\n" +"PO-Revision-Date: 2008-12-10 17:02+0100\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "MIME-Version: 1.0\n" @@ -1910,6 +1910,21 @@ msgstr "nom d'utilisateur pour le serveur proxy" msgid "password for proxy server" msgstr "mot de passe pour le serveur proxy" +msgid "bytes" +msgstr "octets" + +msgid "KB" +msgstr "Ko" + +msgid "MB" +msgstr "Mo" + +msgid "GB" +msgstr "Go" + +msgid "byte" +msgstr "octet" + #, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "%sErreur de mise Ă jour de WeeChat avec le fichier \"%s\":" @@ -4506,6 +4521,151 @@ msgstr "Extension \"%s\" dĂ©chargĂ©e" msgid "%sError: plugin \"%s\" not found" msgstr "%sErreur: extension \"%s\" non trouvĂ©e" +msgid "Actions (letter+enter):" +msgstr "Actions (lettre+entrĂ©e):" + +msgid " [D] Disconnect" +msgstr " [D] DĂ©connecter" + +msgid " [R] Remove" +msgstr " [R] Retirer" + +msgid " [P] Purge finished" +msgstr " [P] Purger terminĂ©s" + +msgid " [Q] Close this buffer" +msgstr " [Q] Fermer ce tampon" + +#, c-format +msgid "%s%s[%s%s%s%s] %s (started on: %s)" +msgstr "%s%s[%s%s%s%s] %s (dĂ©marrĂ© le: %s)" + +#, c-format +msgid "%s%-26s received: %s, sent: %s" +msgstr "%s%-26s reçu: %s, envoyĂ©: %s" + +msgid "List of clients for relay" +msgstr "Liste des clients pour le relai" + +msgid "connecting" +msgstr "connexion" + +msgid "waiting auth" +msgstr "attente auth" + +msgid "auth failed" +msgstr "Ă©chec auth" + +msgid "disconnected" +msgstr "dĂ©connectĂ©" + +#, c-format +msgid "%s%s: error sending data to client %s" +msgstr "%s%s: erreur d'envoi de donnĂ©es au client %s" + +#, c-format +msgid "%s: new client @ %s" +msgstr "%s: nouveau client @ %s" + +#, c-format +msgid "%s%s: not enough memory for new client" +msgstr "%s%s: pas assez de mĂ©moire pour un nouveau client" + +#, c-format +msgid "%s%s: authentication failed with client @ %s" +msgstr "%s%s: l'authentification a Ă©chouĂ© avec le client @ %s" + +#, c-format +msgid "%s: disconnected from client @ %s" +msgstr "%s: dĂ©connectĂ© du client @ %s" + +msgid "Clients for relay:" +msgstr "Clients pour le relai:" + +#, c-format +msgid "%3d. %s, started on: %s, last activity: %s, bytes: %lu recv, %lu sent" +msgstr "" +"%3d. %s, dĂ©marrĂ© le: %s, dernière activitĂ©: %s, octets: %lu reçus, %lu " +"envoyĂ©s" + +#, c-format +msgid "%3d. %s, started on: %s" +msgstr "%3d. %s, dĂ©marrĂ© le: %s" + +msgid "No client for relay" +msgstr "Pas de client pour le relai" + +msgid "relay control" +msgstr "contrĂ´le du relai" + +msgid "" +" list: list relay clients\n" +"listfull: list relay clients (verbose)\n" +"\n" +"Without argument, this command opens buffer with list of relay clients." +msgstr "" +" list: liste les clients pour le relai\n" +"listfull: liste les clients pour le relai (verbeux)\n" +"\n" +"Sans paramètre, cette commande ouvre le tampon avec la liste des clients " +"pour le relai." + +msgid "auto open relay buffer when a new client is connecting" +msgstr "" +"ouvrir automatiquement le tampon des clients pour le relai lorsqu'un nouveau " +"client est ajoutĂ© Ă la liste" + +msgid "text color" +msgstr "couleur du texte" + +msgid "background color" +msgstr "couleur du fond" + +msgid "text color of selected client line" +msgstr "couleur du texte pour la ligne client sĂ©lectionnĂ©e" + +msgid "text color for \"connecting\" status" +msgstr "couleur du texte pour le statut \"connexion\"" + +msgid "text color for \"waiting authentication\" status" +msgstr "couleur du texte pour le statut \"attente auth\"" + +msgid "text color for \"connected\" status" +msgstr "couleur du texte pour le statut \"connectĂ©\"" + +msgid "text color for \"authentication failed\" status" +msgstr "couleur du texte pour le statut \"Ă©chec auth\"" + +msgid "text color for \"disconnected\" status" +msgstr "couleur du texte pour le statut \"dĂ©connectĂ©\"" + +msgid "" +"port number (or range of ports) that relay plugin listens on (syntax: a " +"single port, ie. 5000 or a port range, ie. 5000-5015)" +msgstr "" +"numĂ©ro de port (ou intervalle de ports) sur lesquels Ă©coute l'extension " +"relay (syntaxe: un port simple, par exemple 5000, un intervalle de ports, " +"par exemple 5000-5015)" + +msgid "list of relay clients" +msgstr "liste des clients pour le relai" + +#, c-format +msgid "%s%s: cannot accept client" +msgstr "%s%s: impossible d'accepter le client" + +#, c-format +msgid "%s%s: option \"listen_port_range\" is not defined" +msgstr "%s%s: l'option \"listen_port_range\" n'est pas dĂ©finie" + +#, c-format +msgid "%s%s: cannot find available port for listening" +msgstr "%s%s: impossible de trouver un port disponible pour Ă©couter" + +#, c-format +msgid "%s: listening on port %d" +msgstr "%s: Ă©coute sur le port %d" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4746,36 +4906,12 @@ msgstr "%s%s: impossible de crĂ©er l'interprĂ©teur" msgid "%s%s: error occured while parsing file \"%s\": %s" msgstr "%s%s: erreur d'analyse du fichier \"%s\": %s" -msgid "bytes" -msgstr "octets" - -msgid "KB" -msgstr "Ko" - -msgid "MB" -msgstr "Mo" - -msgid "GB" -msgstr "Go" - -msgid "Actions (letter+enter):" -msgstr "Actions (lettre+entrĂ©e):" - msgid " [A] Accept" msgstr " [A] Accepter" msgid " [C] Cancel" msgstr " [C] Annuler" -msgid " [R] Remove" -msgstr " [R] Retirer" - -msgid " [P] Purge finished" -msgstr " [P] Purger terminĂ©s" - -msgid " [Q] Close xfer list" -msgstr " [Q] Fermer la liste xfer" - msgid "xfer chat" msgstr "discussion xfer" @@ -4788,9 +4924,6 @@ msgstr "Liste Xfer" msgid "waiting" msgstr "attente" -msgid "connecting" -msgstr "connexion" - msgid "active" msgstr "actif" @@ -4953,8 +5086,16 @@ msgstr "Pas de xfer" msgid "xfer control" msgstr "contrĂ´le xfer" -msgid "Open buffer with xfer list" -msgstr "Ouverture du tampon avec la liste des xfers" +msgid "" +" list: list xfer\n" +"listfull: list xfer (verbose)\n" +"\n" +"Without argument, this command opens buffer with xfer list." +msgstr "" +" list: liste les xfer\n" +"listfull: liste les xfer (verbeux)\n" +"\n" +"Sans paramètre, cette commande ouvre le tampon avec la liste des xfer." msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -4966,21 +5107,12 @@ msgstr "" "taille de la barre de progression, en caractères (si 0, la barre de " "progression est dĂ©sactivĂ©e)" -msgid "text color" -msgstr "couleur du texte" - -msgid "background color" -msgstr "couleur du fond" - msgid "text color of selected xfer line" msgstr "couleur du texte pour la ligne xfer sĂ©lectionnĂ©e" msgid "text color for \"waiting\" status" msgstr "couleur du texte pour le statut \"en attente\"" -msgid "text color for \"connecting\" status" -msgstr "couleur du texte pour le statut \"connexion\"" - msgid "text color for \"active\" status" msgstr "couleur du texte pour le statut \"actif\"" @@ -5107,42 +5239,3 @@ msgstr "%s%s: impossible de positionner l'option \"nonblock\" pour la socket" #, c-format msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s%s: dĂ©lai d'attente dĂ©passĂ© pour \"%s\" avec %s" - -#~ msgid "use a proxy server" -#~ msgstr "utiliser un serveur proxy" - -#~ msgid "text color for title bar" -#~ msgstr "create a socks5 proxy with username/password:" - -#~ msgid "background color for title bar" -#~ msgstr "couleur du fond pour la barre de titre" - -#~ msgid "text color for status bar" -#~ msgstr "couleur du texte pour la barre de statut" - -#~ msgid "background color for status bar" -#~ msgstr "couleur du fond pour la barre de statut" - -#~ msgid "text color for status bar delimiters" -#~ msgstr "couleur du texte pour les dĂ©limiteurs de la barre de statut" - -#~ msgid "text color for input line" -#~ msgstr "couleur du texte pour la ligne de saisie" - -#~ msgid "background color for input line" -#~ msgstr "couleur du fond pour la ligne de saisie" - -#~ msgid "text color for server name in input line" -#~ msgstr "couleur du texte pour le nom du serveur dans la ligne de saisie" - -#~ msgid "text color for channel name in input line" -#~ msgstr "couleur du texte pour le canal dans la ligne de saisie" - -#~ msgid "text color for delimiters in input line" -#~ msgstr "couleur du texte pour les dĂ©limiteurs dans la ligne de saisie" - -#~ msgid "text color for nicklist" -#~ msgstr "couleur du texte pour la liste des pseudos" - -#~ msgid "background color for nicklist" -#~ msgstr "couleur du fond pour la liste des pseudos" @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-11-23 22:44+0100\n" +"POT-Creation-Date: 2008-12-10 17:02+0100\n" "PO-Revision-Date: 2007-10-10 18:07+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1855,6 +1855,22 @@ msgstr "felhasznĂ¡lĂ³nĂ©v a proxy szerverhez" msgid "password for proxy server" msgstr "jelszĂ³ a proxy szerverhez" +msgid "bytes" +msgstr "byte" + +msgid "KB" +msgstr "KB" + +msgid "MB" +msgstr "MB" + +msgid "GB" +msgstr "GB" + +#, fuzzy +msgid "byte" +msgstr "byte" + #, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "WeeChat frissĂtĂ©se...\n" @@ -4369,6 +4385,158 @@ msgstr "A \"%s\" modul eltĂ¡volĂtva.\n" msgid "%sError: plugin \"%s\" not found" msgstr "%s a \"%s\" modul nem talĂ¡lhatĂ³\n" +msgid "Actions (letter+enter):" +msgstr "" + +msgid " [D] Disconnect" +msgstr "" + +msgid " [R] Remove" +msgstr " [R] EltĂ¡volĂtĂ¡s" + +#, fuzzy +msgid " [P] Purge finished" +msgstr " [P] RĂ©gi DCC törlĂ©se" + +#, fuzzy +msgid " [Q] Close this buffer" +msgstr " [Q] DCC nĂ©zet bezĂ¡rĂ¡sa" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s%s] %s (started on: %s)" +msgstr "%s%s%s tĂ¡vol: %s\n" + +#, fuzzy, c-format +msgid "%s%-26s received: %s, sent: %s" +msgstr "DCC: fĂ¡jl %s%s%s" + +msgid "List of clients for relay" +msgstr "" + +#, fuzzy +msgid "connecting" +msgstr "KapcsolĂ³dĂ¡s" + +#, fuzzy +msgid "waiting auth" +msgstr "VĂ¡rakozĂ¡s" + +#, fuzzy +msgid "auth failed" +msgstr "Sikertelen" + +#, fuzzy +msgid "disconnected" +msgstr "csatlakozva" + +#, fuzzy, c-format +msgid "%s%s: error sending data to client %s" +msgstr "%s adatkĂ¼ldĂ©si hiba az IRC szerveren\n" + +#, c-format +msgid "%s: new client @ %s" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: not enough memory for new client" +msgstr "%s nincs elegendÅ‘ memĂ³ria Ăºj DCC szĂ¡mĂ¡ra\n" + +#, fuzzy, c-format +msgid "%s%s: authentication failed with client @ %s" +msgstr "Nem sikerĂ¼lt a(z) \"%s\" naplĂ³fĂ¡jlt Ărni\n" + +#, fuzzy, c-format +msgid "%s: disconnected from client @ %s" +msgstr "LekapcsolĂ³dott a szerverrÅ‘l!\n" + +msgid "Clients for relay:" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s, last activity: %s, bytes: %lu recv, %lu sent" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s" +msgstr "" + +msgid "No client for relay" +msgstr "" + +msgid "relay control" +msgstr "" + +msgid "" +" list: list relay clients\n" +"listfull: list relay clients (verbose)\n" +"\n" +"Without argument, this command opens buffer with list of relay clients." +msgstr "" + +msgid "auto open relay buffer when a new client is connecting" +msgstr "" + +#, fuzzy +msgid "text color" +msgstr "Ă¼zenetek szĂne" + +#, fuzzy +msgid "background color" +msgstr "nevek hĂ¡ttere" + +#, fuzzy +msgid "text color of selected client line" +msgstr "szerver nevĂ©nek szĂne" + +#, fuzzy +msgid "text color for \"connecting\" status" +msgstr "\"connecting\" dcc stĂ¡tusz szĂne" + +#, fuzzy +msgid "text color for \"waiting authentication\" status" +msgstr "\"waiting\" dcc stĂ¡tusz szĂne" + +#, fuzzy +msgid "text color for \"connected\" status" +msgstr "\"connecting\" dcc stĂ¡tusz szĂne" + +#, fuzzy +msgid "text color for \"authentication failed\" status" +msgstr "\"failed\" dcc stĂ¡tusz szĂne" + +#, fuzzy +msgid "text color for \"disconnected\" status" +msgstr "\"connecting\" dcc stĂ¡tusz szĂne" + +#, fuzzy +msgid "" +"port number (or range of ports) that relay plugin listens on (syntax: a " +"single port, ie. 5000 or a port range, ie. 5000-5015)" +msgstr "" +"korlĂ¡tozza a dcc-t, hogy csak egy bizonyos tartomĂ¡nyban lĂ©vÅ‘ portokat " +"hasznĂ¡lja (NAT esetĂ©n hasznos) (szintaxis: egyetlen port, pl. 5000 vagy egy " +"port intervallum, pl. 5000-5015, Ă¼resen hagyva tetszÅ‘leges port)" + +#, fuzzy +msgid "list of relay clients" +msgstr "Aliaszok listĂ¡ja:\n" + +#, fuzzy, c-format +msgid "%s%s: cannot accept client" +msgstr "%s nem sikerĂ¼lt a csatornĂ¡t lĂ©trehozni\n" + +#, c-format +msgid "%s%s: option \"listen_port_range\" is not defined" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: cannot find available port for listening" +msgstr "%s nem sikerĂ¼lt elĂ©rhetÅ‘ portot talĂ¡lni a DCC-hez\n" + +#, c-format +msgid "%s: listening on port %d" +msgstr "" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4599,38 +4767,12 @@ msgstr "%s nem sikerĂ¼lt a szervert lĂ©trehozni\n" msgid "%s%s: error occured while parsing file \"%s\": %s" msgstr "Nem sikerĂ¼lt a(z) \"%s\" naplĂ³fĂ¡jlt Ărni\n" -msgid "bytes" -msgstr "byte" - -msgid "KB" -msgstr "KB" - -msgid "MB" -msgstr "MB" - -msgid "GB" -msgstr "GB" - -msgid "Actions (letter+enter):" -msgstr "" - msgid " [A] Accept" msgstr " [A] ElfogadĂ¡s" msgid " [C] Cancel" msgstr " [C] MĂ©gsem" -msgid " [R] Remove" -msgstr " [R] EltĂ¡volĂtĂ¡s" - -#, fuzzy -msgid " [P] Purge finished" -msgstr " [P] RĂ©gi DCC törlĂ©se" - -#, fuzzy -msgid " [Q] Close xfer list" -msgstr " [Q] DCC nĂ©zet bezĂ¡rĂ¡sa" - msgid "xfer chat" msgstr "" @@ -4646,10 +4788,6 @@ msgid "waiting" msgstr "VĂ¡rakozĂ¡s" #, fuzzy -msgid "connecting" -msgstr "KapcsolĂ³dĂ¡s" - -#, fuzzy msgid "active" msgstr "AktĂv" @@ -4821,9 +4959,12 @@ msgstr "Nincs szerver.\n" msgid "xfer control" msgstr "" -#, fuzzy -msgid "Open buffer with xfer list" -msgstr "Nyitott pufferek:\n" +msgid "" +" list: list xfer\n" +"listfull: list xfer (verbose)\n" +"\n" +"Without argument, this command opens buffer with xfer list." +msgstr "" msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -4832,14 +4973,6 @@ msgid "size of progress bar, in chars (if 0, progress bar is disabled)" msgstr "" #, fuzzy -msgid "text color" -msgstr "Ă¼zenetek szĂne" - -#, fuzzy -msgid "background color" -msgstr "nevek hĂ¡ttere" - -#, fuzzy msgid "text color of selected xfer line" msgstr "szerver nevĂ©nek szĂne" @@ -4848,10 +4981,6 @@ msgid "text color for \"waiting\" status" msgstr "\"waiting\" dcc stĂ¡tusz szĂne" #, fuzzy -msgid "text color for \"connecting\" status" -msgstr "\"connecting\" dcc stĂ¡tusz szĂne" - -#, fuzzy msgid "text color for \"active\" status" msgstr "\"active\" dcc stĂ¡tusz szĂne" @@ -4981,6 +5110,30 @@ msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s hiĂ¡nyzĂ³ argumentum a(z) \"%s\" opciĂ³nak\n" #, fuzzy +#~ msgid "timeout for relay request (in seconds)" +#~ msgstr "dcc kĂ©rĂ©sek idÅ‘korlĂ¡tja (mĂ¡sodpercben)" + +#, fuzzy +#~ msgid "Open buffer with relay clients list" +#~ msgstr "Nyitott pufferek:\n" + +#, fuzzy +#~ msgid "Open buffer with xfer list" +#~ msgstr "Nyitott pufferek:\n" + +#, fuzzy +#~ msgid "%s%s: disconnecting client @ %s" +#~ msgstr "%s: ĂjracsatlakozĂ¡s a szerverhez %d mĂ¡sodperc mĂºlva\n" + +#, fuzzy +#~ msgid "%s%s: cannot bind socket" +#~ msgstr "%s nem sikerĂ¼lt a csatornĂ¡t lĂ©trehozni\n" + +#, fuzzy +#~ msgid " [Q] Close client list" +#~ msgstr " [Q] DCC nĂ©zet bezĂ¡rĂ¡sa" + +#, fuzzy #~ msgid "use a proxy server" #~ msgstr "felhasznĂ¡lĂ³nĂ©v a proxy szerverhez" @@ -5136,9 +5289,5 @@ msgstr "%s hiĂ¡nyzĂ³ argumentum a(z) \"%s\" opciĂ³nak\n" #~ msgstr "-TOVĂBB-" #, fuzzy -#~ msgid "%s: disconnected from server" -#~ msgstr "LekapcsolĂ³dott a szerverrÅ‘l!\n" - -#, fuzzy #~ msgid "%s: connecting to server %s/%d%s%s..." #~ msgstr "%s: csatlakozĂ¡s a(z) %s:%d%s%s szerverhez...\n" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-11-23 22:44+0100\n" +"POT-Creation-Date: 2008-12-10 17:02+0100\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1858,6 +1858,22 @@ msgstr "Đ¸Đ¼Ñ Đ¿Đ¾Đ»ÑŒĐ·Đ¾Đ²Đ°Ñ‚ĐµĐ»Ñ, иÑĐ¿Đ¾Đ»ÑŒĐ·ÑƒĐµĐ¼Đ¾Đµ Đ¿Ñ€Đ¸ Đ¿Đ¾Đ´Đ msgid "password for proxy server" msgstr "Đ¿Đ°Ñ€Đ¾Đ»ÑŒ Đº proxy ÑĐµÑ€Đ²ĐµÑ€Ñƒ" +msgid "bytes" +msgstr "Đ±Đ°Đ¹Ñ‚Đ¾Đ²" + +msgid "KB" +msgstr "ĐĐ‘" + +msgid "MB" +msgstr "ĐœĐ‘" + +msgid "GB" +msgstr "Đ“Đ‘" + +#, fuzzy +msgid "byte" +msgstr "Đ±Đ°Đ¹Ñ‚Đ¾Đ²" + #, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "ĐĐ±Đ½Đ¾Đ²Đ»ÑÑ WeeChat...\n" @@ -4356,6 +4372,158 @@ msgstr "Plugin \"%s\" Đ²Ñ‹Đ³Ñ€ÑƒĐ¶ĐµĐ½.\n" msgid "%sError: plugin \"%s\" not found" msgstr "%s plugin \"%s\" Đ½Đµ Đ½Đ°Đ¹Đ´ĐµĐ½\n" +msgid "Actions (letter+enter):" +msgstr "" + +msgid " [D] Disconnect" +msgstr "" + +msgid " [R] Remove" +msgstr " [R] Đ£Đ´Đ°Đ»Đ¸Ñ‚ÑŒ" + +#, fuzzy +msgid " [P] Purge finished" +msgstr " [P] ĐÑ‡Đ¸ÑÑ‚Đ¸Ñ‚ÑŒ ÑĐ¿Đ¸ÑĐ¾Đº" + +#, fuzzy +msgid " [Q] Close this buffer" +msgstr " [Q] Đ—Đ°ĐºÑ€Ñ‹Ñ‚ÑŒ Đ¾ĐºĐ½Đ¾" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s%s] %s (started on: %s)" +msgstr "%s%s%s Đ¾Ñ‚ÑутÑÑ‚Đ²ÑƒĐµÑ‚: %s\n" + +#, fuzzy, c-format +msgid "%s%-26s received: %s, sent: %s" +msgstr "DCC: Ñ„Đ°Đ¹Đ» %s%s%s" + +msgid "List of clients for relay" +msgstr "" + +#, fuzzy +msgid "connecting" +msgstr "ĐŸĐ¾Đ´ĐºĐ»ÑÑ‡ĐµĐ½Đ¸Đµ" + +#, fuzzy +msgid "waiting auth" +msgstr "ĐĐ¶Đ¸Đ´Đ°Đ½Đ¸Đµ" + +#, fuzzy +msgid "auth failed" +msgstr "ĐĐµÑƒĐ´Đ°Ñ‡Đ°" + +#, fuzzy +msgid "disconnected" +msgstr "Đ¿Đ¾Đ´ĐºĐ»ÑÑ‡ĐµĐ½" + +#, fuzzy, c-format +msgid "%s%s: error sending data to client %s" +msgstr "%s Đ¾ÑˆĐ¸Đ±ĐºĐ° Đ¿Ñ€Đ¸ Đ¾Ñ‚Đ¿Ñ€Đ°Đ²ĐºĐµ Đ´Đ°Đ½Đ½Ñ‹Ñ… IRC ÑĐµÑ€Đ²ĐµÑ€Ñƒ\n" + +#, c-format +msgid "%s: new client @ %s" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: not enough memory for new client" +msgstr "%s Đ½ĐµĐ´Đ¾ÑÑ‚Đ°Ñ‚Đ¾Ñ‡Đ½Đ¾ Đ¿Đ°Đ¼ÑÑ‚Đ¸ Đ´Đ»Ñ Đ½Đ¾Đ²Đ¾Đ³Đ¾ DCC\n" + +#, fuzzy, c-format +msgid "%s%s: authentication failed with client @ %s" +msgstr "Đе Đ¼Đ¾Đ³Ñƒ Đ·Đ°Đ¿Đ¸ÑĐ°Ñ‚ÑŒ Đ»Đ¾Đ³-Ñ„Đ°Đ¹Đ» \"%s\"\n" + +#, fuzzy, c-format +msgid "%s: disconnected from client @ %s" +msgstr "ĐÑ‚ĐºĐ»ÑÑ‡ĐµĐ½ Đ¾Ñ‚ ÑĐµÑ€Đ²ĐµÑ€Đ°!\n" + +msgid "Clients for relay:" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s, last activity: %s, bytes: %lu recv, %lu sent" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s" +msgstr "" + +msgid "No client for relay" +msgstr "" + +msgid "relay control" +msgstr "" + +msgid "" +" list: list relay clients\n" +"listfull: list relay clients (verbose)\n" +"\n" +"Without argument, this command opens buffer with list of relay clients." +msgstr "" + +msgid "auto open relay buffer when a new client is connecting" +msgstr "" + +#, fuzzy +msgid "text color" +msgstr "Ñ†Đ²ĐµÑ‚ Ñ‡Đ°Ñ‚Đ°" + +#, fuzzy +msgid "background color" +msgstr "Ñ„Đ¾Đ½ Đ½Đ¸ĐºĐ¾Đ²" + +#, fuzzy +msgid "text color of selected client line" +msgstr "Ñ†Đ²ĐµÑ‚ Đ½Đ°Đ·Đ²Đ°Đ½Đ¸Ñ ÑĐµÑ€Đ²ĐµÑ€Đ°" + +#, fuzzy +msgid "text color for \"connecting\" status" +msgstr "Ñ†Đ²ĐµÑ‚ \"ÑĐ¾ĐµĐ´Đ¸Đ½ĐµĐ½Đ¸Ñ\" Đ² Đ¾ĐºĐ½Đµ DCC" + +#, fuzzy +msgid "text color for \"waiting authentication\" status" +msgstr "Ñ†Đ²ĐµÑ‚ \"Đ¾Đ¶Đ¸Đ´Đ°Đ½Đ¸Ñ\" Đ² Đ¾ĐºĐ½Đµ DCC" + +#, fuzzy +msgid "text color for \"connected\" status" +msgstr "Ñ†Đ²ĐµÑ‚ \"ÑĐ¾ĐµĐ´Đ¸Đ½ĐµĐ½Đ¸Ñ\" Đ² Đ¾ĐºĐ½Đµ DCC" + +#, fuzzy +msgid "text color for \"authentication failed\" status" +msgstr "Ñ†Đ²ĐµÑ‚ \"Đ½ĐµÑƒĐ´Đ°Ñ‡Đ½Ñ‹Ñ…\" Đ² Đ¾ĐºĐ½Đµ DCC" + +#, fuzzy +msgid "text color for \"disconnected\" status" +msgstr "Ñ†Đ²ĐµÑ‚ \"ÑĐ¾ĐµĐ´Đ¸Đ½ĐµĐ½Đ¸Ñ\" Đ² Đ¾ĐºĐ½Đµ DCC" + +#, fuzzy +msgid "" +"port number (or range of ports) that relay plugin listens on (syntax: a " +"single port, ie. 5000 or a port range, ie. 5000-5015)" +msgstr "" +"Đ¿Ñ€Đ¸Đ²ÑĐ·Ñ‹Đ²Đ°ĐµÑ‚ иÑÑ…Đ¾Đ´ÑÑ‰Đ¸Đµ DCĐ¡ ÑĐ¾ĐµĐ´Đ¸Đ½ĐµĐ½Đ¸Ñ Đº Đ¾Đ¿Ñ€ĐµĐ´ĐµĐ»Ñ‘Đ½Đ½Đ¾Đ¼Ñƒ Đ¸Đ½Ñ‚ĐµÑ€Đ²Đ°Đ»Ñƒ Đ¿Đ¾Ñ€Ñ‚Đ¾Đ² " +"(Đ¿Đ¾Đ»ĐµĐ·Đ½Đ¾ Đ´Đ»Ñ NAT) (ÑĐ¸Đ½Ñ‚Đ°ĐºÑиÑ: Đ¾Đ¿Ñ€ĐµĐ´ĐµĐ»Ñ‘Đ½Đ½Ñ‹Đ¹ Đ¿Đ¾Ñ€Ñ‚, Đ½Đ°Đ¿Ñ€Đ¸Đ¼ĐµÑ€ 5000, или Đ¸Đ½Ñ‚ĐµÑ€Đ²Đ°Đ» " +"Đ¿Đ¾Ñ€Ñ‚Đ¾Đ², Đ½Đ°Đ¿Ñ€Đ¸Đ¼ĐµÑ€ 5000-5015, Đ¿ÑƒÑÑ‚Đ¾Đµ Đ·Đ½Đ°Ñ‡ĐµĐ½Đ¸Đµ Đ¾Đ·Đ½Đ°Ñ‡Đ°ĐµÑ‚ Đ»ÑĐ±Đ¾Đ¹ Đ¿Đ¾Ñ€Ñ‚)" + +#, fuzzy +msgid "list of relay clients" +msgstr "Đ¡Đ¿Đ¸ÑĐ¾Đº ÑĐ¾ĐºÑ€Đ°Ñ‰ĐµĐ½Đ¸Đ¹:\n" + +#, fuzzy, c-format +msgid "%s%s: cannot accept client" +msgstr "%s Đ½ĐµĐ²Đ¾Đ·Đ¼Đ¾Đ¶Đ½Đ¾ ÑĐ¾Đ·Đ´Đ°Ñ‚ÑŒ ÑĐ¾ĐºĐµÑ‚\n" + +#, c-format +msgid "%s%s: option \"listen_port_range\" is not defined" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: cannot find available port for listening" +msgstr "%s Đ½Đµ Đ¼Đ¾Đ³Ñƒ Đ½Đ°Đ¹Ñ‚Đ¸ ÑĐ²Đ¾Đ±Đ¾Đ´Đ½Ñ‹Đ¹ Đ¿Đ¾Ñ€Ñ‚ Đ´Đ»Ñ DCC\n" + +#, c-format +msgid "%s: listening on port %d" +msgstr "" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4586,38 +4754,12 @@ msgstr "%s Đ½Đµ Đ¼Đ¾Đ³Ñƒ ÑĐ¾Đ·Đ´Đ°Ñ‚ÑŒ ÑĐµÑ€Đ²ĐµÑ€\n" msgid "%s%s: error occured while parsing file \"%s\": %s" msgstr "Đе Đ¼Đ¾Đ³Ñƒ Đ·Đ°Đ¿Đ¸ÑĐ°Ñ‚ÑŒ Đ»Đ¾Đ³-Ñ„Đ°Đ¹Đ» \"%s\"\n" -msgid "bytes" -msgstr "Đ±Đ°Đ¹Ñ‚Đ¾Đ²" - -msgid "KB" -msgstr "ĐĐ‘" - -msgid "MB" -msgstr "ĐœĐ‘" - -msgid "GB" -msgstr "Đ“Đ‘" - -msgid "Actions (letter+enter):" -msgstr "" - msgid " [A] Accept" msgstr " [A] ĐŸÑ€Đ¸Đ½ÑÑ‚ÑŒ" msgid " [C] Cancel" msgstr " [C] ĐÑ‚Đ¼ĐµĐ½Đ¸Ñ‚ÑŒ" -msgid " [R] Remove" -msgstr " [R] Đ£Đ´Đ°Đ»Đ¸Ñ‚ÑŒ" - -#, fuzzy -msgid " [P] Purge finished" -msgstr " [P] ĐÑ‡Đ¸ÑÑ‚Đ¸Ñ‚ÑŒ ÑĐ¿Đ¸ÑĐ¾Đº" - -#, fuzzy -msgid " [Q] Close xfer list" -msgstr " [Q] Đ—Đ°ĐºÑ€Ñ‹Ñ‚ÑŒ Đ¾ĐºĐ½Đ¾" - msgid "xfer chat" msgstr "" @@ -4633,10 +4775,6 @@ msgid "waiting" msgstr "ĐĐ¶Đ¸Đ´Đ°Đ½Đ¸Đµ" #, fuzzy -msgid "connecting" -msgstr "ĐŸĐ¾Đ´ĐºĐ»ÑÑ‡ĐµĐ½Đ¸Đµ" - -#, fuzzy msgid "active" msgstr "ĐĐºÑ‚Đ¸Đ²Đ½Đ¾" @@ -4801,9 +4939,12 @@ msgstr "ĐĐµÑ‚ ÑĐµÑ€Đ²ĐµÑ€Đ°.\n" msgid "xfer control" msgstr "" -#, fuzzy -msgid "Open buffer with xfer list" -msgstr "ĐÑ‚ĐºÑ€Ñ‹Ñ‚Ñ‹Đµ Đ±ÑƒÑ„ĐµÑ€Ñ‹:\n" +msgid "" +" list: list xfer\n" +"listfull: list xfer (verbose)\n" +"\n" +"Without argument, this command opens buffer with xfer list." +msgstr "" msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -4812,14 +4953,6 @@ msgid "size of progress bar, in chars (if 0, progress bar is disabled)" msgstr "" #, fuzzy -msgid "text color" -msgstr "Ñ†Đ²ĐµÑ‚ Ñ‡Đ°Ñ‚Đ°" - -#, fuzzy -msgid "background color" -msgstr "Ñ„Đ¾Đ½ Đ½Đ¸ĐºĐ¾Đ²" - -#, fuzzy msgid "text color of selected xfer line" msgstr "Ñ†Đ²ĐµÑ‚ Đ½Đ°Đ·Đ²Đ°Đ½Đ¸Ñ ÑĐµÑ€Đ²ĐµÑ€Đ°" @@ -4828,10 +4961,6 @@ msgid "text color for \"waiting\" status" msgstr "Ñ†Đ²ĐµÑ‚ \"Đ¾Đ¶Đ¸Đ´Đ°Đ½Đ¸Ñ\" Đ² Đ¾ĐºĐ½Đµ DCC" #, fuzzy -msgid "text color for \"connecting\" status" -msgstr "Ñ†Đ²ĐµÑ‚ \"ÑĐ¾ĐµĐ´Đ¸Đ½ĐµĐ½Đ¸Ñ\" Đ² Đ¾ĐºĐ½Đµ DCC" - -#, fuzzy msgid "text color for \"active\" status" msgstr "Ñ†Đ²ĐµÑ‚ \"Đ°ĐºÑ‚Đ¸Đ²Đ½Đ¾ÑÑ‚Đ¸\" Đ² Đ¾ĐºĐ½Đµ DCC" @@ -4963,6 +5092,30 @@ msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s Đ½ĐµÑ‚ Đ°Ñ€Đ³ÑƒĐ¼ĐµĐ½Ñ‚Đ° Đ´Đ»Ñ Đ¿Đ°Ñ€Đ°Đ¼ĐµÑ‚Ñ€Đ° \"%s\"\n" #, fuzzy +#~ msgid "timeout for relay request (in seconds)" +#~ msgstr "Ñ‚Đ°Đ¹Đ¼Đ°ÑƒÑ‚ Đ·Đ°Đ¿Ñ€Đ¾ÑĐ¾Đ² dcc-ÑĐ¾ĐµĐ´Đ¸Đ½ĐµĐ½Đ¸Đ¹ (Đ² ÑĐµĐºÑƒĐ½Đ´Đ°Ñ…)" + +#, fuzzy +#~ msgid "Open buffer with relay clients list" +#~ msgstr "ĐÑ‚ĐºÑ€Ñ‹Ñ‚Ñ‹Đµ Đ±ÑƒÑ„ĐµÑ€Ñ‹:\n" + +#, fuzzy +#~ msgid "Open buffer with xfer list" +#~ msgstr "ĐÑ‚ĐºÑ€Ñ‹Ñ‚Ñ‹Đµ Đ±ÑƒÑ„ĐµÑ€Ñ‹:\n" + +#, fuzzy +#~ msgid "%s%s: disconnecting client @ %s" +#~ msgstr "%s: ĐŸĐ¾Đ²Ñ‚Đ¾Ñ€Đ½Đ¾Đµ Đ¿Đ¾Đ´ĐºĐ»ÑÑ‡ĐµĐ½Đ¸Đµ Đº ÑĐµÑ€Đ²ĐµÑ€Ñƒ Ñ‡ĐµÑ€ĐµĐ· %d ÑĐµĐºÑƒĐ½Đ´\n" + +#, fuzzy +#~ msgid "%s%s: cannot bind socket" +#~ msgstr "%s Đ½ĐµĐ²Đ¾Đ·Đ¼Đ¾Đ¶Đ½Đ¾ ÑĐ¾Đ·Đ´Đ°Ñ‚ÑŒ ÑĐ¾ĐºĐµÑ‚\n" + +#, fuzzy +#~ msgid " [Q] Close client list" +#~ msgstr " [Q] Đ—Đ°ĐºÑ€Ñ‹Ñ‚ÑŒ Đ¾ĐºĐ½Đ¾" + +#, fuzzy #~ msgid "use a proxy server" #~ msgstr "Đ¸Đ¼Ñ Đ¿Đ¾Đ»ÑŒĐ·Đ¾Đ²Đ°Ñ‚ĐµĐ»Ñ, иÑĐ¿Đ¾Đ»ÑŒĐ·ÑƒĐµĐ¼Đ¾Đµ Đ¿Ñ€Đ¸ Đ¿Đ¾Đ´ĐºĐ»ÑÑ‡ĐµĐ½Đ¸Ñ Đº proxy-ÑĐµÑ€Đ²ĐµÑ€Ñƒ" @@ -5118,9 +5271,5 @@ msgstr "%s Đ½ĐµÑ‚ Đ°Ñ€Đ³ÑƒĐ¼ĐµĐ½Ñ‚Đ° Đ´Đ»Ñ Đ¿Đ°Ñ€Đ°Đ¼ĐµÑ‚Ñ€Đ° \"%s\"\n" #~ msgstr "-Đ”ĐЛЬШЕ-" #, fuzzy -#~ msgid "%s: disconnected from server" -#~ msgstr "ĐÑ‚ĐºĐ»ÑÑ‡ĐµĐ½ Đ¾Ñ‚ ÑĐµÑ€Đ²ĐµÑ€Đ°!\n" - -#, fuzzy #~ msgid "%s: connecting to server %s/%d%s%s..." #~ msgstr "%s: Đ¿Đ¾ĐºĐ»ÑÑ‡Đ°ÑÑÑŒ Đº ÑĐµÑ€Đ²ĐµÑ€Ñƒ %s:%d%s%s...\n" diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index 3ea49cf37..55d082d04 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -149,6 +149,22 @@ SET(WEECHAT_SOURCES ./src/plugins/plugin-config.c ./src/plugins/plugin-config.h ./src/plugins/plugin.h +./src/plugins/relay/relay-buffer.c +./src/plugins/relay/relay-buffer.h +./src/plugins/relay/relay.c +./src/plugins/relay/relay-client.c +./src/plugins/relay/relay-client.h +./src/plugins/relay/relay-command.c +./src/plugins/relay/relay-command.h +./src/plugins/relay/relay-config.c +./src/plugins/relay/relay-config.h +./src/plugins/relay/relay.h +./src/plugins/relay/relay-info.c +./src/plugins/relay/relay-info.h +./src/plugins/relay/relay-network.c +./src/plugins/relay/relay-network.h +./src/plugins/relay/relay-upgrade.c +./src/plugins/relay/relay-upgrade.h ./src/plugins/scripts/lua/weechat-lua-api.c ./src/plugins/scripts/lua/weechat-lua-api.h ./src/plugins/scripts/lua/weechat-lua.c diff --git a/po/weechat.pot b/po/weechat.pot index 0055eaf90..d6fcb3409 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-11-23 22:44+0100\n" +"POT-Creation-Date: 2008-12-10 17:02+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -1561,6 +1561,21 @@ msgstr "" msgid "password for proxy server" msgstr "" +msgid "bytes" +msgstr "" + +msgid "KB" +msgstr "" + +msgid "MB" +msgstr "" + +msgid "GB" +msgstr "" + +msgid "byte" +msgstr "" + #, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "" @@ -3781,6 +3796,139 @@ msgstr "" msgid "%sError: plugin \"%s\" not found" msgstr "" +msgid "Actions (letter+enter):" +msgstr "" + +msgid " [D] Disconnect" +msgstr "" + +msgid " [R] Remove" +msgstr "" + +msgid " [P] Purge finished" +msgstr "" + +msgid " [Q] Close this buffer" +msgstr "" + +#, c-format +msgid "%s%s[%s%s%s%s] %s (started on: %s)" +msgstr "" + +#, c-format +msgid "%s%-26s received: %s, sent: %s" +msgstr "" + +msgid "List of clients for relay" +msgstr "" + +msgid "connecting" +msgstr "" + +msgid "waiting auth" +msgstr "" + +msgid "auth failed" +msgstr "" + +msgid "disconnected" +msgstr "" + +#, c-format +msgid "%s%s: error sending data to client %s" +msgstr "" + +#, c-format +msgid "%s: new client @ %s" +msgstr "" + +#, c-format +msgid "%s%s: not enough memory for new client" +msgstr "" + +#, c-format +msgid "%s%s: authentication failed with client @ %s" +msgstr "" + +#, c-format +msgid "%s: disconnected from client @ %s" +msgstr "" + +msgid "Clients for relay:" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s, last activity: %s, bytes: %lu recv, %lu sent" +msgstr "" + +#, c-format +msgid "%3d. %s, started on: %s" +msgstr "" + +msgid "No client for relay" +msgstr "" + +msgid "relay control" +msgstr "" + +msgid "" +" list: list relay clients\n" +"listfull: list relay clients (verbose)\n" +"\n" +"Without argument, this command opens buffer with list of relay clients." +msgstr "" + +msgid "auto open relay buffer when a new client is connecting" +msgstr "" + +msgid "text color" +msgstr "" + +msgid "background color" +msgstr "" + +msgid "text color of selected client line" +msgstr "" + +msgid "text color for \"connecting\" status" +msgstr "" + +msgid "text color for \"waiting authentication\" status" +msgstr "" + +msgid "text color for \"connected\" status" +msgstr "" + +msgid "text color for \"authentication failed\" status" +msgstr "" + +msgid "text color for \"disconnected\" status" +msgstr "" + +msgid "" +"port number (or range of ports) that relay plugin listens on (syntax: a " +"single port, ie. 5000 or a port range, ie. 5000-5015)" +msgstr "" + +msgid "list of relay clients" +msgstr "" + +#, c-format +msgid "%s%s: cannot accept client" +msgstr "" + +#, c-format +msgid "%s%s: option \"listen_port_range\" is not defined" +msgstr "" + +#, c-format +msgid "%s%s: cannot find available port for listening" +msgstr "" + +#, c-format +msgid "%s: listening on port %d" +msgstr "" + #, c-format msgid "" "%s%s: unable to register script \"%s\" (another script already exists with " @@ -4004,36 +4152,12 @@ msgstr "" msgid "%s%s: error occured while parsing file \"%s\": %s" msgstr "" -msgid "bytes" -msgstr "" - -msgid "KB" -msgstr "" - -msgid "MB" -msgstr "" - -msgid "GB" -msgstr "" - -msgid "Actions (letter+enter):" -msgstr "" - msgid " [A] Accept" msgstr "" msgid " [C] Cancel" msgstr "" -msgid " [R] Remove" -msgstr "" - -msgid " [P] Purge finished" -msgstr "" - -msgid " [Q] Close xfer list" -msgstr "" - msgid "xfer chat" msgstr "" @@ -4046,9 +4170,6 @@ msgstr "" msgid "waiting" msgstr "" -msgid "connecting" -msgstr "" - msgid "active" msgstr "" @@ -4200,7 +4321,11 @@ msgstr "" msgid "xfer control" msgstr "" -msgid "Open buffer with xfer list" +msgid "" +" list: list xfer\n" +"listfull: list xfer (verbose)\n" +"\n" +"Without argument, this command opens buffer with xfer list." msgstr "" msgid "auto open xfer buffer when a new xfer is added to list" @@ -4209,21 +4334,12 @@ msgstr "" msgid "size of progress bar, in chars (if 0, progress bar is disabled)" msgstr "" -msgid "text color" -msgstr "" - -msgid "background color" -msgstr "" - msgid "text color of selected xfer line" msgstr "" msgid "text color for \"waiting\" status" msgstr "" -msgid "text color for \"connecting\" status" -msgstr "" - msgid "text color for \"active\" status" msgstr "" diff --git a/src/core/wee-string.c b/src/core/wee-string.c index cf9a0b8c4..2988b67b6 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -1244,3 +1244,39 @@ string_iconv_fprintf (FILE *file, const char *data, ...) if (buf2) free (buf2); } + +/* + * string_format_size: format a string with size and unit name (bytes, KB, MB, GB) + * note: returned value has to be free() after use + */ + +char * +string_format_size (unsigned long size) +{ + char *unit_name[] = { N_("bytes"), N_("KB"), N_("MB"), N_("GB") }; + char *unit_format[] = { "%.0f", "%.1f", "%.02f", "%.02f" }; + float unit_divide[] = { 1, 1024, 1024*1024, 1024*1024*1024 }; + char format_size[128], str_size[128]; + int num_unit; + + str_size[0] = '\0'; + + if (size < 1024*10) + num_unit = 0; + else if (size < 1024*1024) + num_unit = 1; + else if (size < 1024*1024*1024) + num_unit = 2; + else + num_unit = 3; + + snprintf (format_size, sizeof (format_size), + "%s %%s", + unit_format[num_unit]); + snprintf (str_size, sizeof (str_size), + format_size, + ((float)size) / ((float)(unit_divide[num_unit])), + (size <= 1) ? _("byte") : _(unit_name[num_unit])); + + return strdup (str_size); +} diff --git a/src/core/wee-string.h b/src/core/wee-string.h index d5042aaf8..16f3a2598 100644 --- a/src/core/wee-string.h +++ b/src/core/wee-string.h @@ -55,5 +55,6 @@ extern char *string_iconv_to_internal (const char *charset, const char *string); extern char *string_iconv_from_internal (const char *charset, const char *string); extern void string_iconv_fprintf (FILE *file, const char *data, ...); +extern char *string_format_size (unsigned long size); #endif /* wee-string.h */ diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index ba6c807b8..70079814c 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1156,9 +1156,6 @@ gui_buffer_clear (struct t_gui_buffer *buffer) if (!buffer) return; - /* remove buffer from hotlist */ - gui_hotlist_remove_buffer (buffer); - /* remove all lines */ gui_chat_line_free_all (buffer); diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index fabe7700f..8a98324b5 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -66,6 +66,10 @@ IF(NOT DISABLE_NOTIFY) ADD_SUBDIRECTORY( notify ) ENDIF(NOT DISABLE_NOTIFY) +IF(NOT DISABLE_RELAY) + ADD_SUBDIRECTORY( relay ) +ENDIF(NOT DISABLE_RELAY) + IF(NOT DISABLE_SCRIPTS AND NOT DISABLE_PERL AND NOT DISABLE_PYTHON AND NOT DISABLE_RUBY AND NOT DISABLE_LUA AND NOT DISABLE_TCL) ADD_SUBDIRECTORY( scripts ) ENDIF(NOT DISABLE_SCRIPTS AND NOT DISABLE_PERL AND NOT DISABLE_PYTHON AND NOT DISABLE_RUBY AND NOT DISABLE_LUA AND NOT DISABLE_TCL) diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index ffc1a20f9..e93fbb99a 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -58,6 +58,10 @@ if PLUGIN_NOTIFY notify_dir = notify endif +if PLUGIN_RELAY +relay_dir = relay +endif + if PLUGIN_PERL script_dir = scripts endif @@ -87,5 +91,5 @@ xfer_dir = xfer endif SUBDIRS = . $(alias_dir) $(aspell_dir) $(charset_dir) $(demo_dir) $(fifo_dir) \ - $(irc_dir) $(logger_dir) $(notify_dir) $(script_dir) \ + $(irc_dir) $(logger_dir) $(notify_dir) $(relay_dir) $(script_dir) \ $(trigger_dir) $(xfer_dir) diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index d023719a6..4b1c9fe7b 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -346,6 +346,7 @@ plugin_load (const char *filename) new_plugin->string_build_with_exploded = &string_build_with_exploded; new_plugin->string_split_command = &string_split_command; new_plugin->string_free_splitted_command = &string_free_splitted_command; + new_plugin->string_format_size = &string_format_size; new_plugin->utf8_has_8bits = &utf8_has_8bits; new_plugin->utf8_is_valid = &utf8_is_valid; @@ -829,9 +830,6 @@ plugin_reload_name (const char *name) if (filename) { plugin_unload (ptr_plugin); - gui_chat_printf (NULL, - _("Plugin \"%s\" unloaded"), - name); plugin_load (filename); free (filename); } diff --git a/src/plugins/relay/CMakeLists.txt b/src/plugins/relay/CMakeLists.txt new file mode 100644 index 000000000..4ad5fbce6 --- /dev/null +++ b/src/plugins/relay/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright (c) 2003-2008 FlashCode <flashcode@flashtux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +ADD_LIBRARY(relay MODULE +relay.c relay.h +relay-buffer.c relay-buffer.h +relay-client.c relay-client.h +relay-command.c relay-command.h +relay-config.c relay-config.h +relay-info.c relay-info.h +relay-network.c relay-network.h +relay-upgrade.c relay-upgrade.h) +SET_TARGET_PROPERTIES(relay PROPERTIES PREFIX "") + +TARGET_LINK_LIBRARIES(relay) + +INSTALL(TARGETS relay LIBRARY DESTINATION lib/${PROJECT_NAME}/plugins) diff --git a/src/plugins/relay/Makefile.am b/src/plugins/relay/Makefile.am new file mode 100644 index 000000000..c2cf6e165 --- /dev/null +++ b/src/plugins/relay/Makefile.am @@ -0,0 +1,41 @@ +# Copyright (c) 2003-2008 FlashCode <flashcode@flashtux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" + +libdir = ${weechat_libdir}/plugins + +lib_LTLIBRARIES = relay.la + +relay_la_SOURCES = relay.c \ + relay.h \ + relay-buffer.c \ + relay-buffer.h \ + relay-client.c \ + relay-client.h \ + relay-command.c \ + relay-command.h \ + relay-config.c \ + relay-config.h \ + relay-info.c \ + relay-info.h \ + relay-network.c \ + relay-network.h \ + relay-upgrade.c \ + relay-upgrade.h + +relau_la_LDFLAGS = -module +relay_la_LIBADD = $(RELAY_LFLAGS) diff --git a/src/plugins/relay/relay-buffer.c b/src/plugins/relay/relay-buffer.c new file mode 100644 index 000000000..36b30bc1f --- /dev/null +++ b/src/plugins/relay/relay-buffer.c @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* relay-buffer.c: display clients list on relay buffer */ + + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <time.h> + +#include "../weechat-plugin.h" +#include "relay.h" +#include "relay-client.h" +#include "relay-config.h" + + +struct t_gui_buffer *relay_buffer = NULL; +int relay_buffer_selected_line = 0; + + +/* + * relay_buffer_refresh: update a client in buffer and update hotlist for + * relay buffer + */ + +void +relay_buffer_refresh (const char *hotlist) +{ + struct t_relay_client *ptr_client, *client_selected; + char str_color[256], status[64], date_start[128]; + char *str_recv, *str_sent; + int i, length, line; + struct tm *date_tmp; + + if (relay_buffer) + { + weechat_buffer_clear (relay_buffer); + line = 0; + client_selected = relay_client_search_by_number (relay_buffer_selected_line); + if (client_selected) + { + weechat_printf_y (relay_buffer, 0, + "%s%s%s%s%s%s%s", + weechat_color("green"), + _("Actions (letter+enter):"), + weechat_color("lightgreen"), + /* disconnect */ + (RELAY_CLIENT_HAS_ENDED(client_selected->status)) ? + "" : _(" [D] Disconnect"), + /* remove */ + (RELAY_CLIENT_HAS_ENDED(client_selected->status)) ? + _(" [R] Remove") : "", + /* purge old */ + _(" [P] Purge finished"), + /* quit */ + _(" [Q] Close this buffer")); + } + for (ptr_client = relay_clients; ptr_client; + ptr_client = ptr_client->next_client) + { + snprintf (str_color, sizeof (str_color), + "%s,%s", + (line == relay_buffer_selected_line) ? + weechat_config_string (relay_config_color_text_selected) : + weechat_config_string (relay_config_color_text), + weechat_config_string (relay_config_color_text_bg)); + + snprintf (status, sizeof (status), + "%s", _(relay_client_status_string[ptr_client->status])); + length = weechat_utf8_strlen_screen (status); + if (length < 20) + { + for (i = 0; i < 20 - length; i++) + { + strcat (status, " "); + } + } + + date_tmp = localtime (&(ptr_client->start_time)); + strftime (date_start, sizeof (date_start), + "%a, %d %b %Y %H:%M:%S", date_tmp); + + /* first line with status and start time */ + weechat_printf_y (relay_buffer, (line * 2) + 2, + _("%s%s[%s%s%s%s] %s (started on: %s)"), + weechat_color(str_color), + (line == relay_buffer_selected_line) ? + "*** " : " ", + weechat_color(weechat_config_string (relay_config_color_status[ptr_client->status])), + status, + weechat_color ("reset"), + weechat_color (str_color), + ptr_client->address, + date_start); + + /* second line with bytes recv/sent */ + str_recv = weechat_string_format_size (ptr_client->bytes_recv); + str_sent = weechat_string_format_size (ptr_client->bytes_sent); + weechat_printf_y (relay_buffer, (line * 2) + 3, + _("%s%-26s received: %s, sent: %s"), + weechat_color(str_color), + " ", + (str_recv) ? str_recv : "?", + (str_sent) ? str_sent : "?"); + if (str_recv) + free (str_recv); + if (str_sent) + free (str_sent); + + line++; + } + if (hotlist) + weechat_buffer_set (relay_buffer, "hotlist", hotlist); + } +} + +/* + * relay_buffer_input_cb: callback called when user send data to client list + * buffer + */ + +int +relay_buffer_input_cb (void *data, struct t_gui_buffer *buffer, + const char *input_data) +{ + struct t_relay_client *client, *ptr_client, *next_client; + + /* make C compiler happy */ + (void) data; + + client = relay_client_search_by_number (relay_buffer_selected_line); + + /* disconnect client */ + if (weechat_strcasecmp (input_data, "d") == 0) + { + if (client && !RELAY_CLIENT_HAS_ENDED(client->status)) + { + relay_client_disconnect (client); + relay_buffer_refresh (WEECHAT_HOTLIST_MESSAGE); + } + } + /* purge old clients */ + else if (weechat_strcasecmp (input_data, "p") == 0) + { + ptr_client = relay_clients; + while (ptr_client) + { + next_client = ptr_client->next_client; + if (RELAY_CLIENT_HAS_ENDED(ptr_client->status)) + relay_client_free (ptr_client); + ptr_client = next_client; + } + relay_buffer_refresh (WEECHAT_HOTLIST_MESSAGE); + } + /* quit relay buffer (close it) */ + else if (weechat_strcasecmp (input_data, "q") == 0) + { + weechat_buffer_close (buffer); + } + /* remove client */ + else if (weechat_strcasecmp (input_data, "r") == 0) + { + if (client && RELAY_CLIENT_HAS_ENDED(client->status)) + { + relay_client_free (client); + relay_buffer_refresh (WEECHAT_HOTLIST_MESSAGE); + } + } + + return WEECHAT_RC_OK; +} + +/* + * relay_buffer_close_cb: callback called when relay buffer is closed + */ + +int +relay_buffer_close_cb (void *data, struct t_gui_buffer *buffer) +{ + /* make C compiler happy */ + (void) data; + (void) buffer; + + relay_buffer = NULL; + + return WEECHAT_RC_OK; +} + +/* + * relay_buffer_open: open relay buffer (to display list of clients) + */ + +void +relay_buffer_open () +{ + if (!relay_buffer) + { + relay_buffer = weechat_buffer_new ("relay.list", + &relay_buffer_input_cb, NULL, + &relay_buffer_close_cb, NULL); + + /* failed to create buffer ? then exit */ + if (!relay_buffer) + return; + + weechat_buffer_set (relay_buffer, "type", "free"); + weechat_buffer_set (relay_buffer, "title", _("List of clients for relay")); + weechat_buffer_set (relay_buffer, "key_bind_meta2-A", "/relay up"); + weechat_buffer_set (relay_buffer, "key_bind_meta2-B", "/relay down"); + } +} diff --git a/src/plugins/relay/relay-buffer.h b/src/plugins/relay/relay-buffer.h new file mode 100644 index 000000000..1702e0b91 --- /dev/null +++ b/src/plugins/relay/relay-buffer.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef __WEECHAT_RELAY_DISPLAY_H +#define __WEECHAT_RELAY_DISPLAY_H 1 + +extern struct t_gui_buffer *relay_buffer; +extern int relay_buffer_selected_line; + +extern void relay_buffer_refresh (const char *hotlist); +extern int relay_buffer_input_cb (void *data, struct t_gui_buffer *buffer, + const char *input_data); +extern int relay_buffer_close_cb (void *data, struct t_gui_buffer *buffer); +extern void relay_buffer_open (); + +#endif /* relay-buffer.h */ diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c new file mode 100644 index 000000000..02a7e53fd --- /dev/null +++ b/src/plugins/relay/relay-client.c @@ -0,0 +1,506 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* relay-client.c: client functions for relay plugin */ + + +#include <stdlib.h> +#include <unistd.h> +#include <stdio.h> +#include <stdarg.h> +#include <string.h> +#include <time.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/socket.h> + +#include "../weechat-plugin.h" +#include "relay.h" +#include "relay-client.h" +#include "relay-config.h" +#include "relay-buffer.h" + + +char *relay_client_status_string[] = /* strings for status */ +{ N_("connecting"), N_("waiting auth"), + N_("connected"), N_("auth failed"), N_("disconnected") +}; + +struct t_relay_client *relay_clients = NULL; +struct t_relay_client *last_relay_client = NULL; +int relay_client_count = 0; /* number of clients */ + + +/* + * relay_client_valid: check if a client pointer exists + * return 1 if client exists + * 0 if client is not found + */ + +int +relay_client_valid (struct t_relay_client *client) +{ + struct t_relay_client *ptr_client; + + if (!client) + return 0; + + for (ptr_client = relay_clients; ptr_client; + ptr_client = ptr_client->next_client) + { + if (ptr_client == client) + return 1; + } + + /* client not found */ + return 0; +} + +/* + * relay_client_search_by_number: search a client by number (first client is 0) + */ + +struct t_relay_client * +relay_client_search_by_number (int number) +{ + struct t_relay_client *ptr_client; + int i; + + i = 0; + for (ptr_client = relay_clients; ptr_client; + ptr_client = ptr_client->next_client) + { + if (i == number) + return ptr_client; + i++; + } + + /* client not found */ + return NULL; +} + +/* + * relay_client_sendf: send formatted data to client + */ + +int +relay_client_sendf (struct t_relay_client *client, const char *format, ...) +{ + va_list args; + static char buffer[4096]; + char str_length[8]; + int length, num_sent; + + if (!client) + return 0; + + va_start (args, format); + vsnprintf (buffer + 7, sizeof (buffer) - 7 - 1, format, args); + va_end (args); + + length = strlen (buffer + 7); + snprintf (str_length, sizeof (str_length), "%07d", length); + memcpy (buffer, str_length, 7); + + num_sent = send (client->sock, buffer, length + 7, 0); + + client->bytes_sent += length + 7; + + if (num_sent < 0) + { + weechat_printf (NULL, + _("%s%s: error sending data to client %s"), + weechat_prefix ("error"), RELAY_PLUGIN_NAME, + strerror (errno)); + } + + return num_sent; +} + +/* + * relay_client_send_infolist: send infolist to client + */ + +void +relay_client_send_infolist (struct t_relay_client *client, + const char *name, + struct t_infolist *infolist) +{ + const char *fields; + char **argv; + int i, argc, size; + + relay_client_sendf (client, "name %s", name); + + while (weechat_infolist_next (infolist)) + { + fields = weechat_infolist_fields (infolist); + if (fields) + { + argv = weechat_string_explode (fields, ",", 0, 0, &argc); + if (argv && (argc > 0)) + { + for (i = 0; i < argc; i++) + { + switch (argv[i][0]) + { + case 'i': + relay_client_sendf (client, "%s %c %d", + argv[i] + 2, argv[i][0], + weechat_infolist_integer (infolist, + argv[i] + 2)); + break; + case 's': + relay_client_sendf (client, "%s %c %s", + argv[i] + 2, argv[i][0], + weechat_infolist_string (infolist, + argv[i] + 2)); + break; + case 'p': + relay_client_sendf (client, "%s %c %lx", + argv[i] + 2, argv[i][0], + (long unsigned int)weechat_infolist_pointer (infolist, + argv[i] + 2)); + break; + case 'b': + relay_client_sendf (client, "%s %c %lx", + argv[i] + 2, argv[i][0], + (long unsigned int)weechat_infolist_buffer (infolist, + argv[i] + 2, + &size)); + break; + case 't': + relay_client_sendf (client, "%s %c %ld", + argv[i] + 2, argv[i][0], + weechat_infolist_time (infolist, argv[i] + 2)); + break; + } + } + } + if (argv) + weechat_string_free_exploded (argv); + } + } +} + +/* + * relay_client_recv_cb: read data from a client + */ + +int +relay_client_recv_cb (void *arg_client) +{ + struct t_relay_client *client; + static char buffer[4096 + 2]; + struct t_infolist *infolist; + int num_read; + + client = (struct t_relay_client *)arg_client; + + num_read = recv (client->sock, buffer, sizeof (buffer) - 1, 0); + if (num_read > 0) + { + client->bytes_recv += num_read; + buffer[num_read] = '\0'; + if (buffer[num_read - 1] == '\n') + buffer[--num_read] = '\0'; + if (buffer[num_read - 1] == '\r') + buffer[--num_read] = '\0'; + if (weechat_relay_plugin->debug) + { + weechat_printf (NULL, "%s: data received from %s: \"%s\"", + RELAY_PLUGIN_NAME, client->address, buffer); + } + if (weechat_strcasecmp (buffer, "quit") == 0) + relay_client_set_status (client, RELAY_STATUS_DISCONNECTED); + else + { + infolist = weechat_infolist_get (buffer, NULL, NULL); + if (infolist) + { + relay_client_send_infolist (client, buffer, infolist); + weechat_infolist_free (infolist); + } + } + relay_buffer_refresh (NULL); + } + else + { + relay_client_set_status (client, RELAY_STATUS_DISCONNECTED); + } + + return WEECHAT_RC_OK; +} + +/* + * relay_client_new: create a new client + */ + +struct t_relay_client * +relay_client_new (int sock, char *address) +{ + struct t_relay_client *new_client; + + new_client = malloc (sizeof (*new_client)); + if (new_client) + { + new_client->sock = sock; + new_client->address = strdup ((address) ? address : "?"); + new_client->status = RELAY_STATUS_CONNECTED; + new_client->start_time = time (NULL); + new_client->hook_fd = NULL; + new_client->hook_timer = NULL; + new_client->last_activity = new_client->start_time; + new_client->bytes_recv = 0; + new_client->bytes_sent = 0; + + new_client->prev_client = NULL; + new_client->next_client = relay_clients; + if (relay_clients) + relay_clients->prev_client = new_client; + else + last_relay_client = new_client; + relay_clients = new_client; + + weechat_printf (NULL, + _("%s: new client @ %s"), + RELAY_PLUGIN_NAME, + new_client->address); + + new_client->hook_fd = weechat_hook_fd (new_client->sock, + 1, 0, 0, + &relay_client_recv_cb, + new_client); + + relay_client_count++; + + if (!relay_buffer + && weechat_config_boolean (relay_config_look_auto_open_buffer)) + { + relay_buffer_open (); + } + + relay_buffer_refresh (WEECHAT_HOTLIST_PRIVATE); + } + else + { + weechat_printf (NULL, + _("%s%s: not enough memory for new client"), + weechat_prefix ("error"), RELAY_PLUGIN_NAME); + } + + return new_client; +} + +/* + * relay_client_set_status: set status for a client + */ + +void +relay_client_set_status (struct t_relay_client *client, + enum t_relay_status status) +{ + client->status = status; + + if (RELAY_CLIENT_HAS_ENDED(client->status)) + { + if (client->hook_fd) + { + weechat_unhook (client->hook_fd); + client->hook_fd = NULL; + } + if (client->hook_timer) + { + weechat_unhook (client->hook_timer); + client->hook_timer = NULL; + } + switch (client->status) + { + case RELAY_STATUS_AUTH_FAILED: + weechat_printf (NULL, + _("%s%s: authentication failed with client @ %s"), + weechat_prefix ("error"), RELAY_PLUGIN_NAME, + client->address); + break; + case RELAY_STATUS_DISCONNECTED: + weechat_printf (NULL, + _("%s: disconnected from client @ %s"), + RELAY_PLUGIN_NAME, client->address); + break; + default: + break; + } + + if (client->sock >= 0) + { + close (client->sock); + client->sock = -1; + } + } + + relay_buffer_refresh (WEECHAT_HOTLIST_MESSAGE); +} + +/* + * relay_client_free: remove a client + */ + +void +relay_client_free (struct t_relay_client *client) +{ + struct t_relay_client *new_relay_clients; + + if (!client) + return; + + /* remove client from list */ + if (last_relay_client == client) + last_relay_client = client->prev_client; + if (client->prev_client) + { + (client->prev_client)->next_client = client->next_client; + new_relay_clients = relay_clients; + } + else + new_relay_clients = client->next_client; + if (client->next_client) + (client->next_client)->prev_client = client->prev_client; + + /* free data */ + if (client->address) + free (client->address); + if (client->hook_fd) + weechat_unhook (client->hook_fd); + if (client->hook_timer) + weechat_unhook (client->hook_timer); + + free (client); + + relay_clients = new_relay_clients; + + relay_client_count--; + if (relay_buffer_selected_line >= relay_client_count) + { + relay_buffer_selected_line = (relay_client_count == 0) ? + 0 : relay_client_count - 1; + } +} + +/* + * relay_client_disconnect: disconnect one client + */ + +void +relay_client_disconnect (struct t_relay_client *client) +{ + if (client->sock >= 0) + { + relay_client_set_status (client, RELAY_STATUS_DISCONNECTED); + } +} + +/* + * relay_client_disconnect_all: disconnect from all clients + */ + +void +relay_client_disconnect_all () +{ + struct t_relay_client *ptr_client; + + for (ptr_client = relay_clients; ptr_client; + ptr_client = ptr_client->next_client) + { + relay_client_disconnect (ptr_client); + } +} + +/* + * relay_client_add_to_infolist: add a client in an infolist + * return 1 if ok, 0 if error + */ + +int +relay_client_add_to_infolist (struct t_infolist *infolist, + struct t_relay_client *client) +{ + struct t_infolist_item *ptr_item; + char value[128]; + + if (!infolist || !client) + return 0; + + ptr_item = weechat_infolist_new_item (infolist); + if (!ptr_item) + return 0; + + if (!weechat_infolist_new_var_integer (ptr_item, "sock", client->sock)) + return 0; + if (!weechat_infolist_new_var_string (ptr_item, "address", client->address)) + return 0; + if (!weechat_infolist_new_var_integer (ptr_item, "status", client->status)) + return 0; + if (!weechat_infolist_new_var_string (ptr_item, "status_string", relay_client_status_string[client->status])) + return 0; + if (!weechat_infolist_new_var_time (ptr_item, "start_time", client->start_time)) + return 0; + if (!weechat_infolist_new_var_pointer (ptr_item, "hook_fd", client->hook_fd)) + return 0; + if (!weechat_infolist_new_var_pointer (ptr_item, "hook_timer", client->hook_timer)) + return 0; + if (!weechat_infolist_new_var_time (ptr_item, "last_activity", client->last_activity)) + return 0; + snprintf (value, sizeof (value), "%lu", client->bytes_recv); + if (!weechat_infolist_new_var_string (ptr_item, "bytes_recv", value)) + return 0; + snprintf (value, sizeof (value), "%lu", client->bytes_sent); + if (!weechat_infolist_new_var_string (ptr_item, "bytes_sent", value)) + return 0; + + return 1; +} + +/* + * relay_client_print_log: print client infos in log (usually for crash dump) + */ + +void +relay_client_print_log () +{ + struct t_relay_client *ptr_client; + + for (ptr_client = relay_clients; ptr_client; + ptr_client = ptr_client->next_client) + { + weechat_log_printf (""); + weechat_log_printf ("[relay client (addr:0x%lx)]", ptr_client); + weechat_log_printf (" sock. . . . . . . . : %d", ptr_client->sock); + weechat_log_printf (" address . . . . . . : '%s'", ptr_client->address); + weechat_log_printf (" status. . . . . . . : %d (%s)", + ptr_client->status, + relay_client_status_string[ptr_client->status]); + weechat_log_printf (" start_time. . . . . : %ld", ptr_client->start_time); + weechat_log_printf (" hook_fd . . . . . . : 0x%lx", ptr_client->hook_fd); + weechat_log_printf (" hook_timer. . . . . : 0x%lx", ptr_client->hook_timer); + weechat_log_printf (" last_activity . . . : %ld", ptr_client->last_activity); + weechat_log_printf (" bytes_recv. . . . . : %lu", ptr_client->bytes_recv); + weechat_log_printf (" bytes_sent. . . . . : %lu", ptr_client->bytes_sent); + weechat_log_printf (" prev_client . . . . : 0x%lx", ptr_client->prev_client); + weechat_log_printf (" next_client . . . . : 0x%lx", ptr_client->next_client); + } +} diff --git a/src/plugins/relay/relay-client.h b/src/plugins/relay/relay-client.h new file mode 100644 index 000000000..4f06e6c0e --- /dev/null +++ b/src/plugins/relay/relay-client.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef __WEECHAT_RELAY_CLIENT_H +#define __WEECHAT_RELAY_CLIENT_H 1 + +/* relay status */ + +enum t_relay_status +{ + RELAY_STATUS_CONNECTING = 0, /* connecting to client */ + RELAY_STATUS_WAITING_AUTH, /* waiting AUTH from client */ + RELAY_STATUS_CONNECTED, /* connected to client */ + RELAY_STATUS_AUTH_FAILED, /* AUTH failed with client */ + RELAY_STATUS_DISCONNECTED, /* disconnected from client */ + /* number of relay status */ + RELAY_NUM_STATUS, +}; + +/* macros for status */ + +#define RELAY_CLIENT_HAS_ENDED(status) ((status == RELAY_STATUS_AUTH_FAILED) || \ + (status == RELAY_STATUS_DISCONNECTED)) + +/* relay client */ + +struct t_relay_client +{ + int sock; /* socket for connection */ + char *address; /* string with IP address */ + enum t_relay_status status; /* status (connecting, active,..) */ + time_t start_time; /* time of client connection */ + struct t_hook *hook_fd; /* hook for socket or child pipe */ + struct t_hook *hook_timer; /* timeout for recever accept */ + time_t last_activity; /* time of last byte received/sent */ + unsigned long bytes_recv; /* bytes received from client */ + unsigned long bytes_sent; /* bytes sent to client */ + struct t_relay_client *prev_client;/* link to previous client */ + struct t_relay_client *next_client;/* link to next client */ +}; + +extern char *relay_client_status_string[]; +extern struct t_relay_client *relay_clients; +extern struct t_relay_client *last_relay_client; +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_new (int sock, char *address); +extern void relay_client_set_status (struct t_relay_client *client, + enum t_relay_status status); +extern void relay_client_free (struct t_relay_client *client); +extern void relay_client_disconnect (struct t_relay_client *client); +extern void relay_client_disconnect_all (); +extern int relay_client_add_to_infolist (struct t_infolist *infolist, + struct t_relay_client *client); +extern void relay_client_print_log (); + +#endif /* relay-client.h */ diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c new file mode 100644 index 000000000..839a02286 --- /dev/null +++ b/src/plugins/relay/relay-command.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* relay-command.c: relay command */ + + +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#include "../weechat-plugin.h" +#include "relay.h" +#include "relay-buffer.h" +#include "relay-client.h" +#include "relay-config.h" + + +/* + * relay_command_client_list: list clients + */ + +void +relay_command_client_list (int full) +{ + struct t_relay_client *ptr_client; + int i; + char date_start[128], date_activity[128]; + struct tm *date_tmp; + + if (relay_clients) + { + weechat_printf (NULL, ""); + weechat_printf (NULL, _("Clients for relay:")); + i = 1; + for (ptr_client = relay_clients; ptr_client; + ptr_client = ptr_client->next_client) + { + date_tmp = localtime (&(ptr_client->start_time)); + strftime (date_start, sizeof (date_start), + "%a, %d %b %Y %H:%M:%S", date_tmp); + + date_tmp = localtime (&(ptr_client->last_activity)); + strftime (date_activity, sizeof (date_activity), + "%a, %d %b %Y %H:%M:%S", date_tmp); + + if (full) + { + weechat_printf (NULL, + _("%3d. %s, started on: %s, last activity: %s, " + "bytes: %lu recv, %lu sent"), + i, + ptr_client->address, + date_start, + date_activity, + ptr_client->bytes_recv, + ptr_client->bytes_sent); + } + else + { + weechat_printf (NULL, + _("%3d. %s, started on: %s"), + i, + ptr_client->address); + } + i++; + } + } + else + weechat_printf (NULL, _("No client for relay")); +} + +/* + * relay_command_relay: command /relay + */ + +int +relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc, + char **argv, char **argv_eol) +{ + /* make C compiler happy */ + (void) data; + (void) buffer; + (void) argv_eol; + + if ((argc > 1) && (weechat_strcasecmp (argv[1], "list") == 0)) + { + relay_command_client_list (0); + return WEECHAT_RC_OK; + } + + if ((argc > 1) && (weechat_strcasecmp (argv[1], "listfull") == 0)) + { + relay_command_client_list (1); + return WEECHAT_RC_OK; + } + + if (!relay_buffer) + relay_buffer_open (); + + if (relay_buffer) + { + weechat_buffer_set (relay_buffer, "display", "1"); + + if (argc > 1) + { + if (strcmp (argv[1], "up") == 0) + { + if (relay_buffer_selected_line > 0) + relay_buffer_selected_line--; + } + else if (strcmp (argv[1], "down") == 0) + { + if (relay_buffer_selected_line < relay_client_count - 1) + relay_buffer_selected_line++; + } + } + } + + relay_buffer_refresh (NULL); + + return WEECHAT_RC_OK; +} + +/* + * relay_command_init: add /relay command + */ + +void +relay_command_init () +{ + weechat_hook_command ("relay", + N_("relay control"), + "[list | listfull]", + N_(" list: list relay clients\n" + "listfull: list relay clients (verbose)\n\n" + "Without argument, this command opens buffer " + "with list of relay clients."), + "list|listfull", &relay_command_relay, NULL); +} diff --git a/src/plugins/relay/relay-command.h b/src/plugins/relay/relay-command.h new file mode 100644 index 000000000..8236768f5 --- /dev/null +++ b/src/plugins/relay/relay-command.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef __WEECHAT_RELAY_COMMAND_H +#define __WEECHAT_RELAY_COMMAND_H 1 + +extern void relay_command_init (); + +#endif /* relay-command.h */ diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c new file mode 100644 index 000000000..a8cd965a6 --- /dev/null +++ b/src/plugins/relay/relay-config.c @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* relay-config.c: relay configuration options */ + + +#include <stdlib.h> +#include <limits.h> + +#include "../weechat-plugin.h" +#include "relay.h" +#include "relay-config.h" +#include "relay-client.h" +#include "relay-buffer.h" + + +struct t_config_file *relay_config_file = NULL; + +/* relay config, look section */ + +struct t_config_option *relay_config_look_auto_open_buffer; + +/* relay config, color section */ + +struct t_config_option *relay_config_color_text; +struct t_config_option *relay_config_color_text_bg; +struct t_config_option *relay_config_color_text_selected; +struct t_config_option *relay_config_color_status[RELAY_NUM_STATUS]; + +/* relay config, network section */ + +struct t_config_option *relay_config_network_listen_port_range; + + +/* + * relay_config_refresh_cb: callback called when user changes relay option that + * needs a refresh of relay list + */ + +void +relay_config_refresh_cb (void *data, struct t_config_option *option) +{ + /* make C compiler happy */ + (void) data; + (void) option; + + if (relay_buffer) + relay_buffer_refresh (NULL); +} + +/* + * relay_config_reload: reload relay configuration file + */ + +int +relay_config_reload (void *data, struct t_config_file *config_file) +{ + /* make C compiler happy */ + (void) data; + + return weechat_config_reload (config_file); +} + +/* + * relay_config_init: init relay configuration file + * return: 1 if ok, 0 if error + */ + +int +relay_config_init () +{ + struct t_config_section *ptr_section; + + relay_config_file = weechat_config_new (RELAY_CONFIG_NAME, + &relay_config_reload, NULL); + if (!relay_config_file) + return 0; + + ptr_section = weechat_config_new_section (relay_config_file, "look", + 0, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL); + if (!ptr_section) + { + weechat_config_free (relay_config_file); + return 0; + } + + relay_config_look_auto_open_buffer = weechat_config_new_option ( + relay_config_file, ptr_section, + "auto_open_buffer", "boolean", + N_("auto open relay buffer when a new client is connecting"), + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); + + ptr_section = weechat_config_new_section (relay_config_file, "color", + 0, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL); + if (!ptr_section) + { + weechat_config_free (relay_config_file); + return 0; + } + + relay_config_color_text = weechat_config_new_option ( + relay_config_file, ptr_section, + "text", "color", + N_("text color"), + NULL, 0, 0, "default", NULL, + NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL); + relay_config_color_text_bg = weechat_config_new_option ( + relay_config_file, ptr_section, + "text_bg", "color", + N_("background color"), + NULL, 0, 0, "default", NULL, + NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL); + relay_config_color_text_selected = weechat_config_new_option ( + relay_config_file, ptr_section, + "text_selected", "color", + N_("text color of selected client line"), + NULL, 0, 0, "white", NULL, + NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_CONNECTING] = weechat_config_new_option ( + relay_config_file, ptr_section, + "status_connecting", "color", + N_("text color for \"connecting\" status"), + NULL, 0, 0, "yellow", NULL, + NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_WAITING_AUTH] = weechat_config_new_option ( + relay_config_file, ptr_section, + "status_waiting_auth", "color", + N_("text color for \"waiting authentication\" status"), + NULL, 0, 0, "brown", NULL, + NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_CONNECTED] = weechat_config_new_option ( + relay_config_file, ptr_section, + "status_active", "color", + N_("text color for \"connected\" status"), + NULL, 0, 0, "lightblue", NULL, + NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_AUTH_FAILED] = weechat_config_new_option ( + relay_config_file, ptr_section, + "status_auth_failed", "color", + N_("text color for \"authentication failed\" status"), + NULL, 0, 0, "lightred", NULL, + NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL); + relay_config_color_status[RELAY_STATUS_DISCONNECTED] = weechat_config_new_option ( + relay_config_file, ptr_section, + "status_disconnected", "color", + N_("text color for \"disconnected\" status"), + NULL, 0, 0, "lightred", NULL, + NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL); + + ptr_section = weechat_config_new_section (relay_config_file, "network", + 0, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL); + if (!ptr_section) + { + weechat_config_free (relay_config_file); + return 0; + } + + relay_config_network_listen_port_range = weechat_config_new_option ( + relay_config_file, ptr_section, + "listen_port_range", "string", + N_("port number (or range of ports) that relay plugin listens on " + "(syntax: a single port, ie. 5000 or a port " + "range, ie. 5000-5015)"), + NULL, 0, 0, "22373-22400", NULL, NULL, NULL, NULL, NULL, NULL, NULL); + + return 1; +} + +/* + * relay_config_read: read relay configuration file + */ + +int +relay_config_read () +{ + return weechat_config_read (relay_config_file); +} + +/* + * relay_config_write: write relay configuration file + */ + +int +relay_config_write () +{ + return weechat_config_write (relay_config_file); +} diff --git a/src/plugins/relay/relay-config.h b/src/plugins/relay/relay-config.h new file mode 100644 index 000000000..0c35f2ff1 --- /dev/null +++ b/src/plugins/relay/relay-config.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef __WEECHAT_RELAY_CONFIG_H +#define __WEECHAT_RELAY_CONFIG_H 1 + +#define RELAY_CONFIG_NAME "relay" + +extern struct t_config_file *relay_config; + +extern struct t_config_option *relay_config_look_auto_open_buffer; + +extern struct t_config_option *relay_config_color_text; +extern struct t_config_option *relay_config_color_text_bg; +extern struct t_config_option *relay_config_color_text_selected; +extern struct t_config_option *relay_config_color_status[]; + +extern struct t_config_option *relay_config_network_listen_port_range; + +extern int relay_config_init (); +extern int relay_config_read (); +extern int relay_config_write (); + +#endif /* relay-config.h */ diff --git a/src/plugins/relay/relay-info.c b/src/plugins/relay/relay-info.c new file mode 100644 index 000000000..100e366cb --- /dev/null +++ b/src/plugins/relay/relay-info.c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* relay-info.c: info and infolist hooks for relay plugin */ + + +#include <stdlib.h> +#include <stdio.h> + +#include "../weechat-plugin.h" +#include "relay.h" +#include "relay-client.h" + + +/* + * relay_info_get_infolist_cb: callback called when relay infolist is asked + */ + +struct t_infolist * +relay_info_get_infolist_cb (void *data, const char *infolist_name, + void *pointer, const char *arguments) +{ + struct t_infolist *ptr_infolist; + struct t_relay_client *ptr_client; + + /* make C compiler happy */ + (void) data; + (void) arguments; + + if (!infolist_name || !infolist_name[0]) + return NULL; + + if (weechat_strcasecmp (infolist_name, "relay") == 0) + { + if (pointer && !relay_client_valid (pointer)) + return NULL; + + ptr_infolist = weechat_infolist_new (); + if (ptr_infolist) + { + if (pointer) + { + /* build list with only one relay */ + if (!relay_client_add_to_infolist (ptr_infolist, pointer)) + { + weechat_infolist_free (ptr_infolist); + return NULL; + } + return ptr_infolist; + } + else + { + /* build list with all relays */ + for (ptr_client = relay_clients; ptr_client; + ptr_client = ptr_client->next_client) + { + if (!relay_client_add_to_infolist (ptr_infolist, ptr_client)) + { + weechat_infolist_free (ptr_infolist); + return NULL; + } + } + return ptr_infolist; + } + } + } + + return NULL; +} + +/* + * relay_info_init: initialize info and infolist hooks for relay plugin + */ + +void +relay_info_init () +{ + /* relay infolist hooks */ + weechat_hook_infolist ("relay", N_("list of relay clients"), + &relay_info_get_infolist_cb, NULL); +} diff --git a/src/plugins/relay/relay-info.h b/src/plugins/relay/relay-info.h new file mode 100644 index 000000000..87aaabf96 --- /dev/null +++ b/src/plugins/relay/relay-info.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef __WEECHAT_RELAY_INFO_H +#define __WEECHAT_RELAY_INFO_H 1 + +extern void relay_info_init (); + +#endif /* relay-info.h */ diff --git a/src/plugins/relay/relay-network.c b/src/plugins/relay/relay-network.c new file mode 100644 index 000000000..d93ac4387 --- /dev/null +++ b/src/plugins/relay/relay-network.c @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* relay-network.c: network functions for relay plugin */ + + +#include <stdlib.h> +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> + +#include "../weechat-plugin.h" +#include "relay.h" +#include "relay-buffer.h" +#include "relay-client.h" +#include "relay-config.h" + + +int relay_network_sock = -1; /* socket used for listening and */ + /* waiting for clients */ +struct t_hook *relay_network_hook_fd = NULL; +int relay_network_listen_port = -1; /* listening port */ + + +/* + * relay_network_close_socket: close socket + */ + +void +relay_network_close_socket () +{ + if (relay_network_hook_fd) + { + weechat_unhook (relay_network_hook_fd); + relay_network_hook_fd = NULL; + } + if (relay_network_sock >= 0) + { + close (relay_network_sock); + relay_network_sock = -1; + } +} + +/* + * relay_network_sock_cb: read data from a client which is connecting on socket + */ + +int +relay_network_sock_cb (void *data) +{ + struct sockaddr_in client_addr; + unsigned int client_length; + int client_fd; + char ipv4_address[INET_ADDRSTRLEN + 1], *ptr_address; + + /* make C compiler happy */ + (void) data; + + client_length = sizeof (client_addr); + memset (&client_addr, 0, client_length); + + client_fd = accept (relay_network_sock, (struct sockaddr *) &client_addr, + &client_length); + if (client_fd < 0) + { + weechat_printf (NULL, + _("%s%s: cannot accept client"), + weechat_prefix ("error"), RELAY_PLUGIN_NAME); + return WEECHAT_RC_OK; + } + + ptr_address = NULL; + if (inet_ntop (AF_INET, + &(client_addr.sin_addr), + ipv4_address, + INET_ADDRSTRLEN)) + { + ptr_address = ipv4_address; + } + + relay_client_new (client_fd, ptr_address); + + return WEECHAT_RC_OK; +} + +/* + * relay_network_init: init socket and listen on port + * return 1 if ok, 0 if error + */ + +int +relay_network_init () +{ + int set, args, port, port_start, port_end; + struct sockaddr_in server_addr; + const char *port_range; + + relay_network_close_socket (); + + port_range = weechat_config_string (relay_config_network_listen_port_range); + if (!port_range || !port_range[0]) + { + weechat_printf (NULL, + _("%s%s: option \"listen_port_range\" is not defined"), + weechat_prefix ("error"), RELAY_PLUGIN_NAME); + return 0; + } + + relay_network_sock = socket (AF_INET, SOCK_STREAM, 0); + if (relay_network_sock < 0) + { + weechat_printf (NULL, + _("%s%s: cannot create socket"), + weechat_prefix ("error"), RELAY_PLUGIN_NAME); + return 0; + } + + set = 1; + if (setsockopt (relay_network_sock, SOL_SOCKET, SO_REUSEADDR, + (void *) &set, sizeof (set)) < 0) + { + weechat_printf (NULL, + _("%s%s: cannot set socket option " + "\"SO_REUSEADDR\""), + weechat_prefix ("error"), RELAY_PLUGIN_NAME); + close (relay_network_sock); + relay_network_sock = -1; + return 0; + } + + set = 1; + if (setsockopt (relay_network_sock, SOL_SOCKET, SO_KEEPALIVE, + (void *) &set, sizeof (set)) < 0) + { + weechat_printf (NULL, + _("%s%s: cannot set socket option " + "\"SO_KEEPALIVE\""), + weechat_prefix ("error"), RELAY_PLUGIN_NAME); + close (relay_network_sock); + relay_network_sock = -1; + return 0; + } + + memset(&server_addr, 0, sizeof(struct sockaddr_in)); + server_addr.sin_family = AF_INET; + server_addr.sin_addr.s_addr = INADDR_ANY; + + port = -1; + + /* find a free port in the specified range */ + args = sscanf (weechat_config_string (relay_config_network_listen_port_range), + "%d-%d", &port_start, &port_end); + if (args > 0) + { + port = port_start; + if (args == 1) + port_end = port_start; + + /* loop through the entire allowed port range */ + while (port <= port_end) + { + /* attempt to bind to the free port */ + server_addr.sin_port = htons (port); + if (bind (relay_network_sock, (struct sockaddr *) &server_addr, + sizeof (server_addr)) == 0) + break; + port++; + } + + if (port > port_end) + port = -1; + } + + if (port < 0) + { + weechat_printf (NULL, + _("%s%s: cannot find available port for listening"), + weechat_prefix ("error"), RELAY_PLUGIN_NAME); + close (relay_network_sock); + relay_network_sock = -1; + return 0; + } + + relay_network_listen_port = port; + + listen (relay_network_sock, 5); + + weechat_printf (NULL, + _("%s: listening on port %d"), + RELAY_PLUGIN_NAME, relay_network_listen_port); + + relay_network_hook_fd = weechat_hook_fd (relay_network_sock, + 1, 0, 0, + &relay_network_sock_cb, + NULL); + + return 1; +} + +/* + * relay_network_end: close main socket + */ + +void +relay_network_end () +{ + relay_network_close_socket (); +} diff --git a/src/plugins/relay/relay-network.h b/src/plugins/relay/relay-network.h new file mode 100644 index 000000000..a090276d3 --- /dev/null +++ b/src/plugins/relay/relay-network.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef __WEECHAT_RELAY_NETWORK_H +#define __WEECHAT_RELAY_NETWORK_H 1 + +extern int relay_network_init (); +extern void relay_network_end (); + +#endif /* relay-network.h */ diff --git a/src/plugins/relay/relay-upgrade.c b/src/plugins/relay/relay-upgrade.c new file mode 100644 index 000000000..907122583 --- /dev/null +++ b/src/plugins/relay/relay-upgrade.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* relay-upgrade.c: save/restore relay plugin data */ + + +#include <stdlib.h> + +#include "../weechat-plugin.h" +#include "relay.h" +#include "relay-upgrade.h" +#include "relay-buffer.h" + + +/* + * relay_upgrade_save_clients: save clients info to upgrade file + */ + +int +relay_upgrade_save_clients (struct t_upgrade_file *upgrade_file) +{ + /* TODO: save relay data */ + (void) upgrade_file; + return 1; +} + +/* + * relay_upgrade_save: save upgrade file + * return 1 if ok, 0 if error + */ + +int +relay_upgrade_save () +{ + int rc; + struct t_upgrade_file *upgrade_file; + + upgrade_file = weechat_upgrade_create (RELAY_UPGRADE_FILENAME, 1); + if (!upgrade_file) + return 0; + + rc = relay_upgrade_save_clients (upgrade_file); + + weechat_upgrade_close (upgrade_file); + + return rc; +} + +/* + * relay_upgrade_set_buffer_callbacks: restore buffers callbacks (input and + * close) for buffers created by relay plugin + */ + +void +relay_upgrade_set_buffer_callbacks () +{ + struct t_infolist *infolist; + struct t_gui_buffer *ptr_buffer; + + infolist = weechat_infolist_get ("buffer", NULL, NULL); + if (infolist) + { + while (weechat_infolist_next (infolist)) + { + if (weechat_infolist_pointer (infolist, "plugin") == weechat_relay_plugin) + { + ptr_buffer = weechat_infolist_pointer (infolist, "pointer"); + weechat_buffer_set_pointer (ptr_buffer, "close_callback", &relay_buffer_close_cb); + weechat_buffer_set_pointer (ptr_buffer, "input_callback", &relay_buffer_input_cb); + } + } + } +} + +/* + * relay_upgrade_read_cb: read callback for relay upgrade file + */ + +int +relay_upgrade_read_cb (int object_id, + struct t_infolist *infolist) +{ + /* TODO: write relay read cb */ + (void) object_id; + (void) infolist; + return WEECHAT_RC_OK; +} + +/* + * relay_upgrade_load: load upgrade file + * return 1 if ok, 0 if error + */ + +int +relay_upgrade_load () +{ + int rc; + struct t_upgrade_file *upgrade_file; + + relay_upgrade_set_buffer_callbacks (); + + upgrade_file = weechat_upgrade_create (RELAY_UPGRADE_FILENAME, 0); + rc = weechat_upgrade_read (upgrade_file, &relay_upgrade_read_cb); + + return rc; +} diff --git a/src/plugins/relay/relay-upgrade.h b/src/plugins/relay/relay-upgrade.h new file mode 100644 index 000000000..855c1026e --- /dev/null +++ b/src/plugins/relay/relay-upgrade.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef __WEECHAT_RELAY_UPGRADE_H +#define __WEECHAT_RELAY_UPGRADE_H 1 + +#define RELAY_UPGRADE_FILENAME "relay" + +/* For developers: please add new values ONLY AT THE END of enums */ + +enum t_relay_upgrade_type +{ + RELAY_UPGRADE_TYPE_RELAY = 0, +}; + +extern int relay_upgrade_save (); +extern int relay_upgrade_load (); + +#endif /* relay-upgrade.h */ diff --git a/src/plugins/relay/relay.c b/src/plugins/relay/relay.c new file mode 100644 index 000000000..252d91590 --- /dev/null +++ b/src/plugins/relay/relay.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* relay.c: network communication between WeeChat and remote application */ + + +#include <stdlib.h> + +#include "../weechat-plugin.h" +#include "relay.h" +#include "relay-client.h" +#include "relay-command.h" +#include "relay-config.h" +#include "relay-info.h" +#include "relay-network.h" +#include "relay-upgrade.h" + + +WEECHAT_PLUGIN_NAME(RELAY_PLUGIN_NAME); +WEECHAT_PLUGIN_DESCRIPTION("Network communication between WeeChat and " + "remote application"); +WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); +WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); +WEECHAT_PLUGIN_WEECHAT_VERSION(WEECHAT_VERSION); +WEECHAT_PLUGIN_LICENSE("GPL3"); + +struct t_weechat_plugin *weechat_relay_plugin = NULL; + +int relay_signal_upgrade_received = 0; /* signal "upgrade" received ? */ + + +/* + * relay_signal_upgrade_cb: callback for "upgrade" signal + */ + +int +relay_signal_upgrade_cb (void *data, const char *signal, const char *type_data, + void *signal_data) +{ + /* make C compiler happy */ + (void) data; + (void) signal; + (void) type_data; + (void) signal_data; + + relay_signal_upgrade_received = 1; + + return WEECHAT_RC_OK; +} + +/* + * relay_debug_dump_cb: callback for "debug_dump" signal + */ + +int +relay_debug_dump_cb (void *data, const char *signal, const char *type_data, + void *signal_data) +{ + /* make C compiler happy */ + (void) data; + (void) signal; + (void) type_data; + (void) signal_data; + + weechat_log_printf (""); + weechat_log_printf ("***** \"%s\" plugin dump *****", + weechat_plugin->name); + + relay_client_print_log (); + + weechat_log_printf (""); + weechat_log_printf ("***** End of \"%s\" plugin dump *****", + weechat_plugin->name); + + return WEECHAT_RC_OK; +} + +/* + * weechat_plugin_init: initialize relay plugin + */ + +int +weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) +{ + /* make C compiler happy */ + (void) argc; + (void) argv; + + weechat_plugin = plugin; + + if (!relay_config_init ()) + return WEECHAT_RC_ERROR; + + if (relay_config_read () < 0) + return WEECHAT_RC_ERROR; + + relay_command_init (); + + weechat_hook_signal ("upgrade", &relay_signal_upgrade_cb, NULL); + weechat_hook_signal ("debug_dump", &relay_debug_dump_cb, NULL); + + relay_info_init (); + + relay_network_init (); + + return WEECHAT_RC_OK; +} + +/* + * weechat_plugin_end: end relay plugin + */ + +int +weechat_plugin_end (struct t_weechat_plugin *plugin) +{ + /* make C compiler happy */ + (void) plugin; + + relay_config_write (); + + relay_network_end (); + + if (relay_signal_upgrade_received) + relay_upgrade_save (); + else + relay_client_disconnect_all (); + + return WEECHAT_RC_OK; +} diff --git a/src/plugins/relay/relay.h b/src/plugins/relay/relay.h new file mode 100644 index 000000000..18e81c471 --- /dev/null +++ b/src/plugins/relay/relay.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef __WEECHAT_RELAY_H +#define __WEECHAT_RELAY_H 1 + +#define weechat_plugin weechat_relay_plugin +#define RELAY_PLUGIN_NAME "relay" + +extern struct t_weechat_plugin *weechat_relay_plugin; + +#endif /* relay.h */ diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 837462c68..6a1ad8970 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -155,6 +155,7 @@ struct t_weechat_plugin const char *separator); char **(*string_split_command) (const char *command, char separator); void (*string_free_splitted_command) (char **splitted_command); + char *(*string_format_size) (unsigned long size); /* UTF-8 strings */ int (*utf8_has_8bits) (const char *string); @@ -651,6 +652,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); weechat_plugin->string_split_command(__command, __separator) #define weechat_string_free_splitted_command(__splitted_command) \ weechat_plugin->string_free_splitted_command(__splitted_command) +#define weechat_string_format_size(__size) \ + weechat_plugin->string_format_size(__size) /* UTF-8 strings */ #define weechat_utf8_has_8bits(__string) \ diff --git a/src/plugins/xfer/xfer-buffer.c b/src/plugins/xfer/xfer-buffer.c index 6a3ba6db1..0d319453c 100644 --- a/src/plugins/xfer/xfer-buffer.c +++ b/src/plugins/xfer/xfer-buffer.c @@ -42,14 +42,10 @@ void xfer_buffer_refresh (const char *hotlist) { struct t_xfer *ptr_xfer, *xfer_selected; - char str_color[256], suffix[32], status[64], date[128], *progress_bar; - char format[128], format_per_sec[128], bytes_per_sec[256], eta[128]; - int i, length, line, progress_bar_size, num_bars, num_unit; - int num_unit_per_sec; + char str_color[256], suffix[32], status[64], date[128], eta[128]; + char *progress_bar, *str_pos, *str_total, *str_bytes_per_sec; + int i, length, line, progress_bar_size, num_bars; unsigned long pct_complete; - char *unit_name[] = { N_("bytes"), N_("KB"), N_("MB"), N_("GB") }; - char *unit_format[] = { "%.0f", "%.1f", "%.02f", "%.02f" }; - float unit_divide[] = { 1, 1024, 1024*1024, 1024*1024*1024 }; struct tm *date_tmp; if (xfer_buffer) @@ -77,7 +73,7 @@ xfer_buffer_refresh (const char *hotlist) /* purge old */ _(" [P] Purge finished"), /* quit */ - _(" [Q] Close xfer list")); + _(" [Q] Close this buffer")); } for (ptr_xfer = xfer_list; ptr_xfer; ptr_xfer = ptr_xfer->next_xfer) { @@ -170,14 +166,6 @@ xfer_buffer_refresh (const char *hotlist) } /* computes percentage */ - if (ptr_xfer->size < 1024*10) - num_unit = 0; - else if (ptr_xfer->size < 1024*1024) - num_unit = 1; - else if (ptr_xfer->size < 1024*1024*1024) - num_unit = 2; - else - num_unit = 3; if (ptr_xfer->size == 0) { if (ptr_xfer->status == XFER_STATUS_DONE) @@ -188,28 +176,10 @@ xfer_buffer_refresh (const char *hotlist) else pct_complete = (unsigned long)(((float)(ptr_xfer->pos)/(float)(ptr_xfer->size)) * 100); - snprintf (format, sizeof (format), - "%%s%%s%%s %%s%%s%%s%%s%%3lu%%%% %s %%s / %s %%s (%%s%%s)", - unit_format[num_unit], - unit_format[num_unit]); - - /* bytes per second */ - bytes_per_sec[0] = '\0'; - if (ptr_xfer->bytes_per_sec < 1024*10) - num_unit_per_sec = 0; - else if (ptr_xfer->bytes_per_sec < 1024*1024) - num_unit_per_sec = 1; - else if (ptr_xfer->bytes_per_sec < 1024*1024*1024) - num_unit_per_sec = 2; - else - num_unit_per_sec = 3; - snprintf (format_per_sec, sizeof (format_per_sec), - "%s %%s/s", - unit_format[num_unit_per_sec]); - snprintf (bytes_per_sec, sizeof (bytes_per_sec), - format_per_sec, - ((float)ptr_xfer->bytes_per_sec) / ((float)(unit_divide[num_unit_per_sec])), - _(unit_name[num_unit_per_sec])); + /* position, total and bytes per second */ + str_pos = weechat_string_format_size (ptr_xfer->pos); + str_total = weechat_string_format_size (ptr_xfer->size); + str_bytes_per_sec = weechat_string_format_size (ptr_xfer->bytes_per_sec); /* ETA */ eta[0] = '\0'; @@ -225,23 +195,25 @@ xfer_buffer_refresh (const char *hotlist) /* display second line for file with status, progress bar and estimated time */ weechat_printf_y (xfer_buffer, (line * 2) + 3, - format, + "%s%s%s %s%s%s%s%3lu%% %s / %s (%s%s/s)", weechat_color(str_color), - (line == xfer_buffer_selected_line) ? - "*** " : " ", - (XFER_IS_SEND(ptr_xfer->type)) ? - "<<--" : "-->>", + (line == xfer_buffer_selected_line) ? "*** " : " ", + (XFER_IS_SEND(ptr_xfer->type)) ? "<<--" : "-->>", weechat_color(weechat_config_string (xfer_config_color_status[ptr_xfer->status])), status, weechat_color (str_color), (progress_bar) ? progress_bar : "", pct_complete, - ((float)(ptr_xfer->pos)) / unit_divide[num_unit], - _(unit_name[num_unit]), - ((float)(ptr_xfer->size)) / unit_divide[num_unit], - _(unit_name[num_unit]), + (str_pos) ? str_pos : "?", + (str_total) ? str_total : "?", eta, - bytes_per_sec); + str_bytes_per_sec); + if (str_pos) + free (str_pos); + if (str_total) + free (str_total); + if (str_bytes_per_sec) + free (str_bytes_per_sec); } line++; } diff --git a/src/plugins/xfer/xfer-command.c b/src/plugins/xfer/xfer-command.c index 23f630a22..777766351 100644 --- a/src/plugins/xfer/xfer-command.c +++ b/src/plugins/xfer/xfer-command.c @@ -189,7 +189,7 @@ xfer_command_xfer (void *data, struct t_gui_buffer *buffer, int argc, } /* - * xfer_command: xfer command + * xfer_command_init: add /xfer command */ void @@ -197,7 +197,10 @@ xfer_command_init () { weechat_hook_command ("xfer", N_("xfer control"), - "", - N_("Open buffer with xfer list"), + "[list | listfull]", + N_(" list: list xfer\n" + "listfull: list xfer (verbose)\n\n" + "Without argument, this command opens buffer " + "with xfer list."), "list|listfull", &xfer_command_xfer, NULL); } diff --git a/src/plugins/xfer/xfer-network.c b/src/plugins/xfer/xfer-network.c index f6848e61a..c760ebaf0 100644 --- a/src/plugins/xfer/xfer-network.c +++ b/src/plugins/xfer/xfer-network.c @@ -213,7 +213,7 @@ xfer_network_send_file_fork (struct t_xfer *xfer) xfer->child_pid = pid; xfer->hook_fd = weechat_hook_fd (xfer->child_read, 1, 0, 0, - xfer_network_child_read_cb, + &xfer_network_child_read_cb, xfer); } @@ -268,7 +268,7 @@ xfer_network_recv_file_fork (struct t_xfer *xfer) xfer->child_pid = pid; xfer->hook_fd = weechat_hook_fd (xfer->child_read, 1, 0, 0, - xfer_network_child_read_cb, + &xfer_network_child_read_cb, xfer); } diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c index 0c9e69694..c04d0d113 100644 --- a/src/plugins/xfer/xfer.c +++ b/src/plugins/xfer/xfer.c @@ -1277,7 +1277,7 @@ xfer_add_to_infolist (struct t_infolist *infolist, struct t_xfer *xfer) } /* - * xfer_print_log: print DCC infos in log (usually for crash dump) + * xfer_print_log: print xfer infos in log (usually for crash dump) */ void @@ -1294,6 +1294,9 @@ xfer_print_log () weechat_log_printf (" type. . . . . . . . : %d (%s)", ptr_xfer->type, xfer_type_string[ptr_xfer->type]); + weechat_log_printf (" protocol. . . . . . : %d (%s)", + ptr_xfer->protocol, + xfer_protocol_string[ptr_xfer->protocol]); weechat_log_printf (" remote_nick . . . . : '%s'", ptr_xfer->remote_nick); weechat_log_printf (" local_nick. . . . . : '%s'", ptr_xfer->local_nick); weechat_log_printf (" filename. . . . . . : '%s'", ptr_xfer->filename); @@ -1314,6 +1317,8 @@ xfer_print_log () weechat_log_printf (" child_pid . . . . . : %d", ptr_xfer->child_pid); weechat_log_printf (" child_read. . . . . : %d", ptr_xfer->child_read); weechat_log_printf (" child_write . . . . : %d", ptr_xfer->child_write); + weechat_log_printf (" hook_fd . . . . . . : 0x%lx", ptr_xfer->hook_fd); + weechat_log_printf (" hook_timer. . . . . : 0x%lx", ptr_xfer->hook_timer); weechat_log_printf (" unterminated_message: '%s'", ptr_xfer->unterminated_message); weechat_log_printf (" file. . . . . . . . : %d", ptr_xfer->file); weechat_log_printf (" local_filename. . . : '%s'", ptr_xfer->local_filename); @@ -1380,7 +1385,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) xfer_create_directories (); xfer_command_init (); - + + weechat_hook_signal ("upgrade", &xfer_signal_upgrade_cb, NULL); weechat_hook_signal ("xfer_add", &xfer_add_cb, NULL); weechat_hook_signal ("xfer_start_resume", &xfer_start_resume_cb, NULL); weechat_hook_signal ("xfer_accept_resume", &xfer_accept_resume_cb, NULL); |