Add new plugin "relay", new function "string_format_size" in plugin API

v2.8-utf8proc
Sebastien Helleu 2008-12-10 17:08:56 +01:00
parent 09fdd1ace3
commit 20a1360bd8
55 changed files with 4019 additions and 447 deletions

View File

@ -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")

View File

@ -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,

View File

@ -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

2
debian/control vendored
View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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\\..*",

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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, &amp;argc);
@ -877,7 +879,7 @@ argv = weechat_string_explode ("abc de fghi", " ", 1, 0, &amp;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, &amp;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, &amp;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, &amp;error)) ...
</screen>
</screen>
</para>
</section>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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">

View File

@ -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

250
po/cs.po
View File

@ -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"
@ -4651,10 +4796,6 @@ msgstr "vyčisti hotlist"
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 ""
@ -4837,14 +4982,6 @@ msgstr ""
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"
@ -4853,10 +4990,6 @@ msgstr "barva pro jeméno serveru"
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"
@ -4991,6 +5124,29 @@ msgstr "%s DCC: nemohu nastavit 'neblokovaci' volbu na soket\n"
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"
@ -5153,10 +5309,6 @@ msgstr "%s chybí argument pro volbu \"%s\"\n"
#~ msgid "Saved buffers layout:"
#~ 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"

250
po/de.po
View File

@ -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 ""
@ -4619,10 +4762,6 @@ msgstr "Hotlist leeren"
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 ""
@ -4803,14 +4945,6 @@ msgstr ""
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"
@ -4819,10 +4953,6 @@ msgstr "Farbe des Servernamens"
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'"
@ -4957,6 +5087,30 @@ msgstr "%s DCC: kann die 'nonblock'-Option für den Socket nicht festlegen\n"
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"
@ -5109,10 +5263,6 @@ msgstr "%s fehlende Argumente für die \"--dir\"-Option\n"
#~ msgid "-MORE-"
#~ 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"

249
po/es.po
View File

@ -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 ""
@ -4619,10 +4761,6 @@ msgstr "limpiar hotlist"
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 ""
@ -4805,14 +4946,6 @@ msgstr ""
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"
@ -4821,10 +4954,6 @@ msgstr "color para el nombre del servidor"
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\""
@ -4962,6 +5091,30 @@ msgstr "%s no es posible crear el servidor\n"
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"
@ -5110,10 +5263,6 @@ msgstr "%s falta un argumento para la opción --dir\n"
#~ msgid "-MORE-"
#~ 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"

251
po/fr.po
View File

@ -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"

249
po/hu.po
View File

@ -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 ""
@ -4645,10 +4787,6 @@ msgstr "hotlist törlése"
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 ""
@ -4831,14 +4972,6 @@ msgstr ""
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"
@ -4847,10 +4980,6 @@ msgstr "szerver nevének színe"
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"
@ -4980,6 +5109,30 @@ msgstr "%s DCC: nem sikerült 'nonblock' opciót beállítani a csatornán\n"
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"
@ -5135,10 +5288,6 @@ msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n"
#~ msgid "-MORE-"
#~ 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"

249
po/ru.po
View File

@ -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 ""
@ -4632,10 +4774,6 @@ msgstr "очистить хотлист"
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 ""
@ -4811,14 +4952,6 @@ msgstr ""
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 "цвет названия сервера"
@ -4827,10 +4960,6 @@ msgstr "цвет названия сервера"
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"
@ -4962,6 +5091,30 @@ msgstr "%s DCC: не могу установить неблокирующий р
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-серверу"
@ -5117,10 +5270,6 @@ msgstr "%s нет аргумента для параметра \"%s\"\n"
#~ msgid "-MORE-"
#~ 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"

View File

@ -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

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 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 ""

View File

@ -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);
}

View File

@ -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 */

View File

@ -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);

View File

@ -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)

View File

@ -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)

View File

@ -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);
}

View File

@ -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)

View File

@ -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)

View File

@ -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");
}
}

View File

@ -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 */

View File

@ -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);
}
}

View File

@ -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 */

View File

@ -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);
}

View File

@ -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 */

View File

@ -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);
}

View File

@ -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 */

View File

@ -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);
}

View File

@ -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 */

View File

@ -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 ();
}

View File

@ -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 */

View File

@ -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;
}

View File

@ -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 */

144
src/plugins/relay/relay.c Normal file
View File

@ -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;
}

28
src/plugins/relay/relay.h Normal file
View File

@ -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 */

View File

@ -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) \

View File

@ -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++;
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);