From 602c9681d04c4d749e3113b526a163c3b6ceb227 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 15 Sep 2009 14:42:24 +0200 Subject: [PATCH] Add options for CTCP, to block/customize CTCP reply (task #9693), add missing CTCP: clientinfo, finger, source, time, userinfo (task #7270) --- ChangeLog | 4 +- doc/docgen.pl | 2 + doc/en/autogen/plugin_api/infos.txt | 4 + doc/en/weechat_user.en.txt | 70 ++ doc/fr/autogen/plugin_api/infos.txt | 4 + doc/fr/weechat_user.fr.txt | 71 +++ po/POTFILES.in | 2 + po/cs.po | 109 ++-- po/de.po | 108 ++-- po/es.po | 108 ++-- po/fr.po | 110 ++-- po/hu.po | 113 ++-- po/pl.po | 112 ++-- po/ru.po | 113 ++-- po/srcfiles.cmake | 2 + po/weechat.pot | 92 +-- src/core/weechat.h | 5 +- src/plugins/irc/CMakeLists.txt | 1 + src/plugins/irc/Makefile.am | 2 + src/plugins/irc/irc-command.c | 66 +- src/plugins/irc/irc-config.c | 96 +++ src/plugins/irc/irc-config.h | 1 + src/plugins/irc/irc-ctcp.c | 951 ++++++++++++++++++++++++++++ src/plugins/irc/irc-ctcp.h | 42 ++ src/plugins/irc/irc-protocol.c | 850 +------------------------ src/plugins/plugin-api.c | 12 + 26 files changed, 1882 insertions(+), 1168 deletions(-) create mode 100644 src/plugins/irc/irc-ctcp.c create mode 100644 src/plugins/irc/irc-ctcp.h diff --git a/ChangeLog b/ChangeLog index aa76fdc5a..48d697268 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,14 @@ WeeChat ChangeLog ================= FlashCode -v0.3.1-dev, 2009-09-11 +v0.3.1-dev, 2009-09-15 Version 0.3.1 (under dev!) -------------------------- +* irc: add options for CTCP, to block/customize CTCP reply (task #9693) +* irc: add missing CTCP: clientinfo, finger, source, time, userinfo (task #7270) * api: fix function weechat_bar_set for python/lua/ruby (patch #6912) Version 0.3.0 (2009-09-06) diff --git a/doc/docgen.pl b/doc/docgen.pl index d8d1323b8..8f1e047d5 100644 --- a/doc/docgen.pl +++ b/doc/docgen.pl @@ -75,6 +75,8 @@ my %plugin_list = ("weechat" => "co", "alias" => "", my @ignore_options = ("aspell\\.dict\\..*", "charset\\.decode\\..*", "charset\\.encode\\..*", + "irc\\.ctcp\\..*", + "irc\\.ignore\\..*", "irc\\.server\\..*", "jabber\\.server\\..*", "logger\\.level\\..*", diff --git a/doc/en/autogen/plugin_api/infos.txt b/doc/en/autogen/plugin_api/infos.txt index 47f6bbbf6..ade4a3521 100644 --- a/doc/en/autogen/plugin_api/infos.txt +++ b/doc/en/autogen/plugin_api/infos.txt @@ -33,4 +33,8 @@ | weechat | weechat_sharedir | WeeChat "share" directory +| weechat | weechat_site | WeeChat site + +| weechat | weechat_site_download | WeeChat site, download page + |======================================== diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt index 4999de3c0..a8159c0ed 100644 --- a/doc/en/weechat_user.en.txt +++ b/doc/en/weechat_user.en.txt @@ -1009,6 +1009,76 @@ Commands include::autogen/user/irc_commands.txt[] +[[ctcp_replies]] +CTCP replies +^^^^^^^^^^^^ + +It is possible to customize CTCP replies, or block some CTCP queries (do not +reply). + +For example, to customize reply to CTCP "VERSION", use following command: + +---------------------------------------- +/set irc.ctcp.version "I'm running WeeChat $version, it rocks!" +---------------------------------------- + +If you want to block CTCP "VERSION" (do not reply to a query), then set empty +string: + +---------------------------------------- +/set irc.ctcp.version "" +---------------------------------------- + +Even unknown CTCP can be customized, for example you can reply to +CTCP "BLABLA": + +---------------------------------------- +/set irc.ctcp.blabla "This is my answer to CTCP BLABLA" +---------------------------------------- + +It is possible to customize CTCP for one server only, using its internal name +before CTCP name: + +---------------------------------------- +/set irc.ctcp.freenode.version "WeeChat $version (for freenode)" +---------------------------------------- + +If you want to restore standard CTCP reply, then remove option: + +---------------------------------------- +/unset irc.ctcp.version +---------------------------------------- + +Following codes can be used in strings and are automatically expanded by WeeChat +when replying to CTCP: + +[width="100%",cols="^2,4,8",options="header"] +|======================================== +| Code | Description | Value/example +| `$clientinfo` | list of supported CTCP | `ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION` +| `$version` | WeeChat version | `0.3.0` +| `$compilation` | WeeChat compilation date | `Sep 13 2009` +| `$osinfo` | info about OS | `Linux 2.6.31 / i686` +| `$site` | WeeChat site | `http://www.weechat.org` +| `$download` | WeeChat site, download page | `http://www.weechat.org/download` +| `$time` | current date/time | `Sun Sep 13 15:48:31 2009` +| `$username` | username on IRC server | `nick` +| `$realname` | realname on IRC server | `My name` +|======================================== + +If CTCP options are not defined (by default), CTCP replies are: + +[width="100%",cols="^2,4,8",options="header"] +|======================================== +| CTCP | Reply format | Example +| CLIENTINFO | `$clientinfo` | `ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION` +| FINGER | `WeeChat $version` | `WeeChat 0.3.0` +| SOURCE | `$download` | `http://www.weechat.org/download` +| TIME | `$time` | `Sun Sep 13 15:48:31 2009` +| USERINFO | `$username ($realname)` | `nick (My name)` +| VERSION | `WeeChat $version ($compilation)` | `WeeChat 0.3.0 (Sep 13 2009)` +|======================================== + [[logger_plugin]] Logger plugin ~~~~~~~~~~~~~ diff --git a/doc/fr/autogen/plugin_api/infos.txt b/doc/fr/autogen/plugin_api/infos.txt index 4dc289836..2a772782a 100644 --- a/doc/fr/autogen/plugin_api/infos.txt +++ b/doc/fr/autogen/plugin_api/infos.txt @@ -33,4 +33,8 @@ | weechat | weechat_sharedir | répertoire "share" de WeeChat +| weechat | weechat_site | Site WeeChat + +| weechat | weechat_site_download | Site WeeChat, page de téléchargement + |======================================== diff --git a/doc/fr/weechat_user.fr.txt b/doc/fr/weechat_user.fr.txt index 375507b40..c0779c7aa 100644 --- a/doc/fr/weechat_user.fr.txt +++ b/doc/fr/weechat_user.fr.txt @@ -1044,6 +1044,77 @@ Commandes include::autogen/user/irc_commands.txt[] +[[ctcp_replies]] +Réponses CTCP +^^^^^^^^^^^^^ + +Il est possible de personnaliser les réponses CTCP, ou de bloquer certaines +demandes CTCP (ne pas y répondre). + +Par exemple, pour personnaliser la réponse au CTCP "VERSION", utilisez la +commande suivante : + +---------------------------------------- +/set irc.ctcp.version "Je suis sous WeeChat $version, ça déchire !" +---------------------------------------- + +Si vous voulez bloquer le CTCP "VERSION" (ne pas répondre à une demande), alors +affectez une chaîne vide : + +---------------------------------------- +/set irc.ctcp.version "" +---------------------------------------- + +Même un CTCP inconnu peut être personnalisé, par exemple vous pouvez répondre +au CTCP "BLABLA" : + +---------------------------------------- +/set irc.ctcp.blabla "C'est ma réponse au CTCP BLABLA" +---------------------------------------- + +Il est possible de personnaliser le CTCP pour un seul serveur, en utilisant son +nom interne avant le nom du CTCP : + +---------------------------------------- +/set irc.ctcp.freenode.version "WeeChat $version (pour freenode)" +---------------------------------------- + +Si vous voulez restaurer la réponse CTCP standard, alors supprimez l'option : + +---------------------------------------- +/unset irc.ctcp.version +---------------------------------------- + +Les codes suivants peuvent être utilisés dans les chaînes et sont +automatiquement remplacées par WeeChat lors de la réponse au CTCP : + +[width="100%",cols="^2,4,8",options="header"] +|======================================== +| Code | Description | Valeur / exemple +| `$clientinfo` | liste des CTCP supportés | `ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION` +| `$version` | version de WeeChat | `0.3.0` +| `$compilation` | date de compi lation WeeChat | `Sep 13 2009` +| `$osinfo` | information sur l'OS | `Linux 2.6.31 / i686` +| `$site` | site WeeChat | `http://www.weechat.org` +| `$download` | site WeeChat, page téléchargement | `http://www.weechat.org/download` +| `$time` | date/heure courante | `Sun Sep 13 15:48:31 2009` +| `$username` | nom d'utilisateur sur le serveur | `pseudo` +| `$realname` | nom réel sur le serveur | `Mon nom` +|======================================== + +Si les options CTCP ne sont pas définies (par défaut), les réponses CTCP sont : + +[width="100%",cols="^2,4,8",options="header"] +|======================================== +| CTCP | Format de réponse | Exemple +| CLIENTINFO | `$clientinfo` | `ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION` +| FINGER | `WeeChat $version` | `WeeChat 0.3.0` +| SOURCE | `$download` | `http://www.weechat.org/download` +| TIME | `$time` | `Sun Sep 13 15:48:31 2009` +| USERINFO | `$username ($realname)` | `pseudo (Mon nom)` +| VERSION | `WeeChat $version ($compilation)` | `WeeChat 0.3.0 (Sep 13 2009)` +|======================================== + [[logger_plugin]] Extension Logger ~~~~~~~~~~~~~~~~ diff --git a/po/POTFILES.in b/po/POTFILES.in index a6c6ee601..7f715f0ec 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -116,6 +116,8 @@ ./src/plugins/irc/irc-completion.h ./src/plugins/irc/irc-config.c ./src/plugins/irc/irc-config.h +./src/plugins/irc/irc-ctcp.c +./src/plugins/irc/irc-ctcp.h ./src/plugins/irc/irc-debug.c ./src/plugins/irc/irc-debug.h ./src/plugins/irc/irc-display.c diff --git a/po/cs.po b/po/cs.po index a731b5ded..ae95b3233 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-09-04 10:38+0200\n" +"POT-Creation-Date: 2009-09-15 14:36+0200\n" "PO-Revision-Date: 2009-09-14 10:56+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -2735,6 +2735,10 @@ msgstr "%s: server %s%s%s vytvořen (dočasný server, NEUKLÁDA SE!)" msgid "%s%s: unable to create server \"%s\"" msgstr "%s%s: nemohu vytvořit server \"%s\"" +#, fuzzy, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sServer: %s%s %s[%s%s%s]%s%s" + #, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: \"%s\" příkaz nemůže být spuštěn v bufferu serveru" @@ -3766,6 +3770,18 @@ msgstr "" "%s%s: varování: server \"%s\" nenalezen v konfiguračním souboru, nesmazáno z " "paměti, protože se stále používá" +msgid "" +"format for CTCP reply or empty string for blocking CTCP (no reply), " +"following variables are replaced: $version (WeeChat version), $compilation " +"(compilation date), $osinfo (info about OS), $site (WeeChat site), $download " +"(WeeChat site, download page), $time (current date and time as text), " +"$username (username on server), $realname (realname on server)" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: error creating CTCP \"%s\" => \"%s\"" +msgstr "%s%s: chyba vytváření aliasu \"%s\" => \"%s\"" + msgid "list of hostname/port or IP/port for server (separated by comma)" msgstr "" "seznam jmen hostů nebo IP adres (s porty) pro servery (oddělený čárkami)" @@ -3990,6 +4006,38 @@ msgstr "" msgid "send unknown commands to server" msgstr "posílat neznámé příkazy na server" +#, fuzzy, c-format +msgid "%sCTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%s%sByl jste zabit uživatelem %s%s %s(%s%s%s)" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s %ld.%ld %s" +msgstr "%sCTCP %sPING%s odpověď od %s%s%s: %ld.%ld %s" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP %sPING%s odpověď od %s%s%s: %ld.%ld %s" + +#, fuzzy, c-format +msgid "%sCTCP reply to %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP %sPING%s odpověď od %s%s%s: %ld.%ld %s" + +#, c-format +msgid "%s%s: not enough memory for \"%s\" command" +msgstr "%s%s: nedostatek paměti pro příkaz \"%s\"" + +#, c-format +msgid "%s%s: cannot parse \"%s\" command" +msgstr "%s%s: nemohu rozpársovat příkaz \"%s\"" + +#, c-format +msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" +msgstr "%s%s: neznámý DCC CHAT typ obdržen od %s%s%s: \"%s\"" + +#, fuzzy, c-format +msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%sNeznámý CTCP %s%s%s obdržen od %s%s%s: %s" + #, c-format msgid "%sServer: %s%s %s[%s%s%s]%s%s" msgstr "%sServer: %s%s %s[%s%s%s]%s%s" @@ -4095,14 +4143,6 @@ msgstr "%sNyní známý jako %s%s" msgid "%s%s%s%s is now known as %s%s" msgstr "%s%s%s%s je nyní známý jako %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s odpověď od %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sPING%s reply from %s%s%s: %ld.%ld %s" -msgstr "%sCTCP %sPING%s odpověď od %s%s%s: %ld.%ld %s" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has left %s%s %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s opustil %s%s %s(%s%s%s)" @@ -4111,22 +4151,6 @@ msgstr "%s%s%s %s(%s%s%s)%s opustil %s%s %s(%s%s%s)" msgid "%s%s%s %s(%s%s%s)%s has left %s%s" msgstr "%s%s%s %s(%s%s%s)%s opustil %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s obdržen od %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s" -msgstr "%sCTCP %sVERSION%s obdržen od %s%s" - -#, c-format -msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" -msgstr "%sObdržen CTCP %sZVUK%s \"%s\" od %s%s" - -#, c-format -msgid "%sCTCP %sPING%s received from %s%s" -msgstr "%sCTCP %sPING%s obdržen od %s%s" - #, c-format msgid "%sUnknown CTCP %s%s%s received from %s%s%s: %s" msgstr "%sNeznámý CTCP %s%s%s obdržen od %s%s%s: %s" @@ -4135,18 +4159,6 @@ msgstr "%sNeznámý CTCP %s%s%s obdržen od %s%s%s: %s" msgid "%sUnknown CTCP %s%s%s received from %s%s" msgstr "%sNeznámý CTCP %s%s%s obdržen od %s%s" -#, c-format -msgid "%s%s: cannot parse \"%s\" command" -msgstr "%s%s: nemohu rozpársovat příkaz \"%s\"" - -#, c-format -msgid "%s%s: not enough memory for \"%s\" command" -msgstr "%s%s: nedostatek paměti pro příkaz \"%s\"" - -#, c-format -msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" -msgstr "%s%s: neznámý DCC CHAT typ obdržen od %s%s%s: \"%s\"" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has quit %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s skončil %s(%s%s%s)" @@ -4740,6 +4752,14 @@ msgstr "\"share\" adresář WeeChat" msgid "WeeChat \"locale\" directory" msgstr "\"locale\" adresář WeeChat" +#, fuzzy +msgid "WeeChat site" +msgstr "verze WeeChat" + +#, fuzzy +msgid "WeeChat site, download page" +msgstr "interní znaková sada WeeChat" + msgid "terminal charset" msgstr "znaková sada terminálu" @@ -5600,3 +5620,18 @@ msgstr "%s%s: nemohu nastavit \"neblokovaci\" volbu na soket" #, c-format msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s%s: vypršel časový limit \"%s\" pro %s" + +#~ msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" +#~ msgstr "%sCTCP %sVERSION%s odpověď od %s%s%s: %s" + +#~ msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" +#~ msgstr "%sCTCP %sVERSION%s obdržen od %s%s%s: %s" + +#~ msgid "%sCTCP %sVERSION%s received from %s%s" +#~ msgstr "%sCTCP %sVERSION%s obdržen od %s%s" + +#~ msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" +#~ msgstr "%sObdržen CTCP %sZVUK%s \"%s\" od %s%s" + +#~ msgid "%sCTCP %sPING%s received from %s%s" +#~ msgstr "%sCTCP %sPING%s obdržen od %s%s" diff --git a/po/de.po b/po/de.po index 663e7b953..1d127afd6 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-09-04 10:38+0200\n" +"POT-Creation-Date: 2009-09-15 14:36+0200\n" "PO-Revision-Date: 2009-09-06 21:25+0200\n" "Last-Translator: Thomas Schuetz \n" "Language-Team: weechat-dev \n" @@ -2587,6 +2587,10 @@ msgstr "%s: Server %s%s%s angelegt (Vorübergehender Server, NICHT GESICHERT!)" msgid "%s%s: unable to create server \"%s\"" msgstr "%s%s: kann den Server \"%s\" nicht anlegen" +#, fuzzy, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sServer: %s%s %s[%s%s%s]%s%s" + #, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: der Befehl \"%s\" kann nicht in Serverfenstern ausgeführt werden" @@ -3594,6 +3598,18 @@ msgid "" "memory because it's currently used" msgstr "" +msgid "" +"format for CTCP reply or empty string for blocking CTCP (no reply), " +"following variables are replaced: $version (WeeChat version), $compilation " +"(compilation date), $osinfo (info about OS), $site (WeeChat site), $download " +"(WeeChat site, download page), $time (current date and time as text), " +"$username (username on server), $realname (realname on server)" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: error creating CTCP \"%s\" => \"%s\"" +msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n" + msgid "list of hostname/port or IP/port for server (separated by comma)" msgstr "" "Liste der Hostnamen/Ports oder IP/Ports des Servers (durch Komma getrennt)" @@ -3821,6 +3837,38 @@ msgstr "" msgid "send unknown commands to server" msgstr "sende unbekannte Befehle an den Server" +#, fuzzy, c-format +msgid "%sCTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%s%sDu wurdest durch %s%s %s(%s%s%s) gekillt" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s %ld.%ld %s" +msgstr "%sCTCP %sPING%s Antwort von %s%s%s: %ld.%ld %s" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP %sPING%s Antwort von %s%s%s: %ld.%ld %s" + +#, fuzzy, c-format +msgid "%sCTCP reply to %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP %sPING%s Antwort von %s%s%s: %ld.%ld %s" + +#, c-format +msgid "%s%s: not enough memory for \"%s\" command" +msgstr "%s%s: nicht genug Speicher für den Befehl \"%s\"" + +#, c-format +msgid "%s%s: cannot parse \"%s\" command" +msgstr "%s%s: kann den Befehl \"%s\" nicht parsen" + +#, c-format +msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" +msgstr "%s%s: unbekannter DCC CHAT-Typ emfpangen von %s%s%s: \"%s\"" + +#, fuzzy, c-format +msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%sUnbekannter CTCP %s%s%s empfangen von %s%s%s : %s" + #, c-format msgid "%sServer: %s%s %s[%s%s%s]%s%s" msgstr "%sServer: %s%s %s[%s%s%s]%s%s" @@ -3926,14 +3974,6 @@ msgstr "%sSie sind nun als %s%s bekannt" msgid "%s%s%s%s is now known as %s%s" msgstr "%s%s%s%s ist nun als %s%s bekannt" -#, c-format -msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s Antwort von %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sPING%s reply from %s%s%s: %ld.%ld %s" -msgstr "%sCTCP %sPING%s Antwort von %s%s%s: %ld.%ld %s" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has left %s%s %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s verlässt %s%s %s(%s%s%s)" @@ -3942,22 +3982,6 @@ msgstr "%s%s%s %s(%s%s%s)%s verlässt %s%s %s(%s%s%s)" msgid "%s%s%s %s(%s%s%s)%s has left %s%s" msgstr "%s%s%s %s(%s%s%s)%s verlässt %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s empfangen von %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s" -msgstr "%sCTCP %sVERSION%s von %s%s empfangen" - -#, c-format -msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" -msgstr "%sEin CTCP %sSOUND%s \"%s\" wurde von %s%s empfangen" - -#, c-format -msgid "%sCTCP %sPING%s received from %s%s" -msgstr "%sCTCP %sPING%s wurde von %s%s empfangen" - #, c-format msgid "%sUnknown CTCP %s%s%s received from %s%s%s: %s" msgstr "%sUnbekannter CTCP %s%s%s empfangen von %s%s%s : %s" @@ -3966,18 +3990,6 @@ msgstr "%sUnbekannter CTCP %s%s%s empfangen von %s%s%s : %s" msgid "%sUnknown CTCP %s%s%s received from %s%s" msgstr "%sUnbekannter CTCP %s%s%s von %s%s empfangen" -#, c-format -msgid "%s%s: cannot parse \"%s\" command" -msgstr "%s%s: kann den Befehl \"%s\" nicht parsen" - -#, c-format -msgid "%s%s: not enough memory for \"%s\" command" -msgstr "%s%s: nicht genug Speicher für den Befehl \"%s\"" - -#, c-format -msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" -msgstr "%s%s: unbekannter DCC CHAT-Typ emfpangen von %s%s%s: \"%s\"" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has quit %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s hat das IRC verlassen %s(%s%s%s)" @@ -4523,6 +4535,13 @@ msgstr "WeeChat-Fehler:" msgid "WeeChat \"locale\" directory" msgstr "" +#, fuzzy +msgid "WeeChat site" +msgstr "WeeChat-Slogan" + +msgid "WeeChat site, download page" +msgstr "" + #, fuzzy msgid "terminal charset" msgstr "Puffer verwalten" @@ -5426,6 +5445,21 @@ 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" +#~ msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" +#~ msgstr "%sCTCP %sVERSION%s Antwort von %s%s%s: %s" + +#~ msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" +#~ msgstr "%sCTCP %sVERSION%s empfangen von %s%s%s: %s" + +#~ msgid "%sCTCP %sVERSION%s received from %s%s" +#~ msgstr "%sCTCP %sVERSION%s von %s%s empfangen" + +#~ msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" +#~ msgstr "%sEin CTCP %sSOUND%s \"%s\" wurde von %s%s empfangen" + +#~ msgid "%sCTCP %sPING%s received from %s%s" +#~ msgstr "%sCTCP %sPING%s wurde von %s%s empfangen" + #, fuzzy #~ msgid "text color for nick name in input line" #~ msgstr "Farbe von Nicknames" diff --git a/po/es.po b/po/es.po index 3119ce210..aa6c5b1b6 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-09-04 10:38+0200\n" +"POT-Creation-Date: 2009-09-15 14:36+0200\n" "PO-Revision-Date: 2009-09-06 21:25+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -2543,6 +2543,10 @@ msgstr "%s: servidor %s%s%s creado (temporalmente, ¡SIN GUARDAR!)" msgid "%s%s: unable to create server \"%s\"" msgstr "%s%s: no es posible crear el servidor \"%s\"" +#, fuzzy, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sServidor: %s%s %s[%s%s%s]%s%s" + #, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: el comando \"%s\" no puede ejecutarse en el buffer del servidor" @@ -3582,6 +3586,18 @@ msgstr "" "%s%s: atención: servidor \"%s\" no encontrado en el archivo de " "configuración, no es borrado de la memoria porque aún está en uso" +msgid "" +"format for CTCP reply or empty string for blocking CTCP (no reply), " +"following variables are replaced: $version (WeeChat version), $compilation " +"(compilation date), $osinfo (info about OS), $site (WeeChat site), $download " +"(WeeChat site, download page), $time (current date and time as text), " +"$username (username on server), $realname (realname on server)" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: error creating CTCP \"%s\" => \"%s\"" +msgstr "No hay suficiente memoria para el mensaje de la barra de información\n" + msgid "list of hostname/port or IP/port for server (separated by comma)" msgstr "lista de dirección/puerto para el servidor (separados por comas)" @@ -3817,6 +3833,38 @@ msgstr "" msgid "send unknown commands to server" msgstr "envía comandos desconocidos al servidor" +#, fuzzy, c-format +msgid "%sCTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%s%sFuiste expulsado por %s%s %s(%s%s%s)" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s %ld.%ld %s" +msgstr "%sCTCP %sPING%s respuesta de %s%s%s: %ld.%ld %s" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP %sPING%s respuesta de %s%s%s: %ld.%ld %s" + +#, fuzzy, c-format +msgid "%sCTCP reply to %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP %sPING%s respuesta de %s%s%s: %ld.%ld %s" + +#, c-format +msgid "%s%s: not enough memory for \"%s\" command" +msgstr "%s%s: no hay memoria suficiente para el comando \"%s\"" + +#, c-format +msgid "%s%s: cannot parse \"%s\" command" +msgstr "%s%s: no es posible analizar el comando \"%s\"" + +#, c-format +msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" +msgstr "%s%s: tipo de DCC CHAT desconocido recibido de %s%s%s: \"%s\"" + +#, fuzzy, c-format +msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP desconocido %s%s%s recibido de %s%s%s: %s" + #, c-format msgid "%sServer: %s%s %s[%s%s%s]%s%s" msgstr "%sServidor: %s%s %s[%s%s%s]%s%s" @@ -3921,14 +3969,6 @@ msgstr "%sEres conocido ahora como %s%s" msgid "%s%s%s%s is now known as %s%s" msgstr "%s%s%s%s es conocido ahora como %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s respuesta de %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sPING%s reply from %s%s%s: %ld.%ld %s" -msgstr "%sCTCP %sPING%s respuesta de %s%s%s: %ld.%ld %s" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has left %s%s %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s ha abandonado %s%s %s(%s%s%s)" @@ -3937,22 +3977,6 @@ msgstr "%s%s%s %s(%s%s%s)%s ha abandonado %s%s %s(%s%s%s)" msgid "%s%s%s %s(%s%s%s)%s has left %s%s" msgstr "%s%s%s %s(%s%s%s)%s ha abandonado %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s recibido de %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s" -msgstr "%sCTCP %sVERSION%s recibido de %s%s" - -#, c-format -msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" -msgstr "%sRecibido a CTCP %sSOUND%s \"%s\" de %s%s" - -#, c-format -msgid "%sCTCP %sPING%s received from %s%s" -msgstr "%sCTCP %sPING%s recibido de %s%s" - #, c-format msgid "%sUnknown CTCP %s%s%s received from %s%s%s: %s" msgstr "%sCTCP desconocido %s%s%s recibido de %s%s%s: %s" @@ -3961,18 +3985,6 @@ msgstr "%sCTCP desconocido %s%s%s recibido de %s%s%s: %s" msgid "%sUnknown CTCP %s%s%s received from %s%s" msgstr "%sCTCP desconocido %s%s%s recibido de %s%s" -#, c-format -msgid "%s%s: cannot parse \"%s\" command" -msgstr "%s%s: no es posible analizar el comando \"%s\"" - -#, c-format -msgid "%s%s: not enough memory for \"%s\" command" -msgstr "%s%s: no hay memoria suficiente para el comando \"%s\"" - -#, c-format -msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" -msgstr "%s%s: tipo de DCC CHAT desconocido recibido de %s%s%s: \"%s\"" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has quit %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s ha salido %s(%s%s%s)" @@ -4541,6 +4553,13 @@ msgstr "Error WeeChat:" msgid "WeeChat \"locale\" directory" msgstr "" +#, fuzzy +msgid "WeeChat site" +msgstr "eslógan de WeeChat" + +msgid "WeeChat site, download page" +msgstr "" + #, fuzzy msgid "terminal charset" msgstr "gestionar los búfers" @@ -5457,6 +5476,21 @@ 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" +#~ msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" +#~ msgstr "%sCTCP %sVERSION%s respuesta de %s%s%s: %s" + +#~ msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" +#~ msgstr "%sCTCP %sVERSION%s recibido de %s%s%s: %s" + +#~ msgid "%sCTCP %sVERSION%s received from %s%s" +#~ msgstr "%sCTCP %sVERSION%s recibido de %s%s" + +#~ msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" +#~ msgstr "%sRecibido a CTCP %sSOUND%s \"%s\" de %s%s" + +#~ msgid "%sCTCP %sPING%s received from %s%s" +#~ msgstr "%sCTCP %sPING%s recibido de %s%s" + #, fuzzy #~ msgid "text color for nick name in input line" #~ msgstr "color para los nombres de usuario" diff --git a/po/fr.po b/po/fr.po index 73bcf34ac..2d47eb2b0 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-09-04 10:38+0200\n" -"PO-Revision-Date: 2009-09-06 21:25+0200\n" +"POT-Creation-Date: 2009-09-15 14:36+0200\n" +"PO-Revision-Date: 2009-09-15 14:36+0200\n" "Last-Translator: FlashCode \n" "Language-Team: weechat-dev \n" "MIME-Version: 1.0\n" @@ -2801,6 +2801,10 @@ msgstr "%s: serveur %s%s%s créé (serveur temporaire, NON SAUVE !)" msgid "%s%s: unable to create server \"%s\"" msgstr "%s%s: impossible de créer le serveur \"%s\"" +#, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sDemande CTCP vers %s%s%s: %s%s%s%s%s" + #, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "" @@ -3843,6 +3847,25 @@ msgstr "" "%s%s: attention: le serveur \"%s\" n'a pas été trouvé dans le fichier de " "configuration, non supprimé en mémoire car il est en cours d'utilisation" +msgid "" +"format for CTCP reply or empty string for blocking CTCP (no reply), " +"following variables are replaced: $version (WeeChat version), $compilation " +"(compilation date), $osinfo (info about OS), $site (WeeChat site), $download " +"(WeeChat site, download page), $time (current date and time as text), " +"$username (username on server), $realname (realname on server)" +msgstr "" +"format de réponse CTCP ou une chaîne vide pour bloquer le CTCP (pas de " +"réponse), les variables suivantes sont remplacées: $version (version " +"WeeChat), $compilation (date de compilation), $osinfo (information sur " +"l'OS), $site (site WeeChat), $download (site WeeChat, page de " +"téléchargement), $time (date et heure courante sous forme de texte), " +"$username (nom d'utilisateur sur le serveur), $realname (nom réel sur le " +"serveur)" + +#, c-format +msgid "%s%s: error creating CTCP \"%s\" => \"%s\"" +msgstr "%s%s: erreur en création du CTCP \"%s\" => \"%s\"" + msgid "list of hostname/port or IP/port for server (separated by comma)" msgstr "" "liste de nom/port ou IP/port pour le serveur (séparés par des virgules)" @@ -4077,6 +4100,38 @@ msgstr "" msgid "send unknown commands to server" msgstr "envoie les commandes inconnues au serveur" +#, c-format +msgid "%sCTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP demandé par %s%s%s: %s%s%s%s%s" + +#, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s %ld.%ld %s" +msgstr "%sRéponse CTCP de %s%s%s: %s%s%s %ld.%ld %s" + +#, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" +msgstr "%sRéponse CTCP de %s%s%s: %s%s%s%s%s" + +#, c-format +msgid "%sCTCP reply to %s%s%s: %s%s%s%s%s" +msgstr "%sRéponse CTCP vers %s%s%s: %s%s%s%s%s" + +#, c-format +msgid "%s%s: not enough memory for \"%s\" command" +msgstr "%s%s: pas assez de mémoire pour la commande \"%s\"" + +#, c-format +msgid "%s%s: cannot parse \"%s\" command" +msgstr "%s%s: impossible d'analyser la commande \"%s\"" + +#, c-format +msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" +msgstr "%s%s: type de DCC CHAT inconnu reçu de %s%s%s: \"%s\"" + +#, c-format +msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP inconnu demandé par %s%s%s: %s%s%s%s%s" + #, c-format msgid "%sServer: %s%s %s[%s%s%s]%s%s" msgstr "%sServeur: %s%s %s[%s%s%s]%s%s" @@ -4181,14 +4236,6 @@ msgstr "%sVous êtes maintenant connu sous le nom %s%s" msgid "%s%s%s%s is now known as %s%s" msgstr "%s%s%s%s est maintenant connu sous le nom %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s réponse de %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sPING%s reply from %s%s%s: %ld.%ld %s" -msgstr "%sCTCP %sPING%s réponse de %s%s%s: %ld.%ld %s" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has left %s%s %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s a quitté %s%s %s(%s%s%s)" @@ -4197,22 +4244,6 @@ msgstr "%s%s%s %s(%s%s%s)%s a quitté %s%s %s(%s%s%s)" msgid "%s%s%s %s(%s%s%s)%s has left %s%s" msgstr "%s%s%s %s(%s%s%s)%s a quitté %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s reçu de %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s" -msgstr "%sCTCP %sVERSION%s reçu de %s%s" - -#, c-format -msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" -msgstr "%sCTCP %sSOUND%s \"%s\" reçu de %s%s" - -#, c-format -msgid "%sCTCP %sPING%s received from %s%s" -msgstr "%sCTCP %sPING%s reçu de %s%s" - #, c-format msgid "%sUnknown CTCP %s%s%s received from %s%s%s: %s" msgstr "%sCTCP inconnu %s%s%s reçu de %s%s%s: %s" @@ -4221,18 +4252,6 @@ msgstr "%sCTCP inconnu %s%s%s reçu de %s%s%s: %s" msgid "%sUnknown CTCP %s%s%s received from %s%s" msgstr "%sCTCP inconnu %s%s%s reçu de %s%s" -#, c-format -msgid "%s%s: cannot parse \"%s\" command" -msgstr "%s%s: impossible d'analyser la commande \"%s\"" - -#, c-format -msgid "%s%s: not enough memory for \"%s\" command" -msgstr "%s%s: pas assez de mémoire pour la commande \"%s\"" - -#, c-format -msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" -msgstr "%s%s: type de DCC CHAT inconnu reçu de %s%s%s: \"%s\"" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has quit %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s a quitté %s(%s%s%s)" @@ -4834,6 +4853,12 @@ msgstr "répertoire \"share\" de WeeChat" msgid "WeeChat \"locale\" directory" msgstr "répertoire \"locale\" de WeeChat" +msgid "WeeChat site" +msgstr "Site WeeChat" + +msgid "WeeChat site, download page" +msgstr "Site WeeChat, page de téléchargement" + msgid "terminal charset" msgstr "charset du terminal" @@ -5719,12 +5744,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 "display '+' if buffer name is truncated" -#~ msgstr "afficher '+' si le nom du tampon est tronqué" - -#~ msgid "text color for nick name in input line" -#~ msgstr "couleur du texte pour le pseudo dans la ligne de saisie" - -#~ msgid "text color for nicklist separator" -#~ msgstr "couleur du texte pour le séparateur de la liste des pseudos" diff --git a/po/hu.po b/po/hu.po index e6a9bafed..2f78fdf9e 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-09-04 10:38+0200\n" +"POT-Creation-Date: 2009-09-15 14:36+0200\n" "PO-Revision-Date: 2009-09-06 21:25+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -2660,6 +2660,10 @@ msgstr "A %s%s%s szerver létrehozva\n" msgid "%s%s: unable to create server \"%s\"" msgstr "%s nem sikerült a szervert létrehozni\n" +#, fuzzy, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%s Szerver: %s%s %s[%s%s%s]\n" + #, fuzzy, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s \"%s\" parancs nem futtatható a szerverablakban\n" @@ -3707,6 +3711,18 @@ msgid "" "memory because it's currently used" msgstr "" +msgid "" +"format for CTCP reply or empty string for blocking CTCP (no reply), " +"following variables are replaced: $version (WeeChat version), $compilation " +"(compilation date), $osinfo (info about OS), $site (WeeChat site), $download " +"(WeeChat site, download page), $time (current date and time as text), " +"$username (username on server), $realname (realname on server)" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: error creating CTCP \"%s\" => \"%s\"" +msgstr "%s nincs elég memória az információs pult üzenethez\n" + #, fuzzy msgid "list of hostname/port or IP/port for server (separated by comma)" msgstr "felhasználónév az IRC szerveren" @@ -3938,6 +3954,38 @@ msgstr "" msgid "send unknown commands to server" msgstr "ismeretlen parancsok küldése az IRC szervernek" +#, fuzzy, c-format +msgid "%sCTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%s%s%s eltávolította %s%s%s-t a szerverről" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s %ld.%ld %s" +msgstr "CTCP %sPING%s válasz %s%s%s felhasználótól: %ld.%ld másodperc\n" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" +msgstr "CTCP %sPING%s válasz %s%s%s felhasználótól: %ld.%ld másodperc\n" + +#, fuzzy, c-format +msgid "%sCTCP reply to %s%s%s: %s%s%s%s%s" +msgstr "CTCP %sPING%s válasz %s%s%s felhasználótól: %ld.%ld másodperc\n" + +#, fuzzy, c-format +msgid "%s%s: not enough memory for \"%s\" command" +msgstr "%s nincs elegendő memória új DCC számára\n" + +#, fuzzy, c-format +msgid "%s%s: cannot parse \"%s\" command" +msgstr "%s nem sikerült végrehajtani a \"%s\" parancsot\n" + +#, fuzzy, c-format +msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" +msgstr "%s usmeretlen DCC CHAT típus érkezett a következőtől:" + +#, fuzzy, c-format +msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "Ismeretlen CTCP %s%s%s érkezett innen: %s%s" + #, fuzzy, c-format msgid "%sServer: %s%s %s[%s%s%s]%s%s" msgstr "%s Szerver: %s%s %s[%s%s%s]\n" @@ -4050,14 +4098,6 @@ msgstr "Az új neved: %s%s\n" msgid "%s%s%s%s is now known as %s%s" msgstr "%s%s%s mostantól: %s%s\n" -#, fuzzy, c-format -msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" -msgstr "CTCP %sVERSION%s válasz %s%s%s felhasználótól: %s\n" - -#, fuzzy, c-format -msgid "%sCTCP %sPING%s reply from %s%s%s: %ld.%ld %s" -msgstr "CTCP %sPING%s válasz %s%s%s felhasználótól: %ld.%ld másodperc\n" - #, fuzzy, c-format msgid "%s%s%s %s(%s%s%s)%s has left %s%s %s(%s%s%s)" msgstr "%s%s %s(%s%s%s)%s elhagyta a(z) %s%s szobát" @@ -4066,22 +4106,6 @@ msgstr "%s%s %s(%s%s%s)%s elhagyta a(z) %s%s szobát" msgid "%s%s%s %s(%s%s%s)%s has left %s%s" msgstr "%s%s %s(%s%s%s)%s elhagyta a(z) %s%s szobát" -#, fuzzy, c-format -msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" -msgstr "CTCP %sVERSION%s válasz innen: %s%s" - -#, fuzzy, c-format -msgid "%sCTCP %sVERSION%s received from %s%s" -msgstr "CTCP %sVERSION%s válasz innen: %s%s" - -#, fuzzy, c-format -msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" -msgstr "CTCP %sSOUND%s (\"%s\") érkezett innen: %s%s\n" - -#, fuzzy, c-format -msgid "%sCTCP %sPING%s received from %s%s" -msgstr "CTCP %sPING%s érkezett innen: %s%s\n" - #, fuzzy, c-format msgid "%sUnknown CTCP %s%s%s received from %s%s%s: %s" msgstr "Ismeretlen CTCP %s%s%s érkezett innen: %s%s" @@ -4090,18 +4114,6 @@ msgstr "Ismeretlen CTCP %s%s%s érkezett innen: %s%s" msgid "%sUnknown CTCP %s%s%s received from %s%s" msgstr "Ismeretlen CTCP %s%s%s érkezett innen: %s%s" -#, fuzzy, c-format -msgid "%s%s: cannot parse \"%s\" command" -msgstr "%s nem sikerült végrehajtani a \"%s\" parancsot\n" - -#, fuzzy, c-format -msgid "%s%s: not enough memory for \"%s\" command" -msgstr "%s nincs elegendő memória új DCC számára\n" - -#, fuzzy, c-format -msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" -msgstr "%s usmeretlen DCC CHAT típus érkezett a következőtől:" - #, fuzzy, c-format msgid "%s%s%s %s(%s%s%s)%s has quit %s(%s%s%s)" msgstr "%s%s %s(%s%s%s)%s kilépett" @@ -4648,6 +4660,13 @@ msgstr "WeeChat Hiba:" msgid "WeeChat \"locale\" directory" msgstr "" +#, fuzzy +msgid "WeeChat site" +msgstr "WeeChat szlogen" + +msgid "WeeChat site, download page" +msgstr "" + #, fuzzy msgid "terminal charset" msgstr "pufferek kezelése" @@ -5545,6 +5564,26 @@ 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 "%sCTCP %sVERSION%s reply from %s%s%s: %s" +#~ msgstr "CTCP %sVERSION%s válasz %s%s%s felhasználótól: %s\n" + +#, fuzzy +#~ msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" +#~ msgstr "CTCP %sVERSION%s válasz innen: %s%s" + +#, fuzzy +#~ msgid "%sCTCP %sVERSION%s received from %s%s" +#~ msgstr "CTCP %sVERSION%s válasz innen: %s%s" + +#, fuzzy +#~ msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" +#~ msgstr "CTCP %sSOUND%s (\"%s\") érkezett innen: %s%s\n" + +#, fuzzy +#~ msgid "%sCTCP %sPING%s received from %s%s" +#~ msgstr "CTCP %sPING%s érkezett innen: %s%s\n" + #, fuzzy #~ msgid "text color for nick name in input line" #~ msgstr "nevek színe" diff --git a/po/pl.po b/po/pl.po index 92f0ed46b..7c9740d21 100644 --- a/po/pl.po +++ b/po/pl.po @@ -9,14 +9,15 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-09-04 10:38+0200\n" +"POT-Creation-Date: 2009-09-15 14:36+0200\n" "PO-Revision-Date: 2009-09-06 21:25+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: Polish\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" #, c-format msgid "" @@ -2770,6 +2771,10 @@ msgstr "%s: utworzono serwer %s%s%s (tymczasowy serwer, NIE ZAPISANO!)" msgid "%s%s: unable to create server \"%s\"" msgstr "%s%s: nie można utworzyć serwera \"%s\"" +#, fuzzy, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sSerwer: %s%s %s[%s%s%s]%s%s" + #, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: komenda \"%s\" nie moża być wykonana w buforze serwera" @@ -3802,6 +3807,18 @@ msgstr "" "%s%s: ostrzeżenie: serwer \"%s\" nie znaleziony w pliku konfiguracyjnym, nie " "usunięty z pamięci, ponieważ jest obecnie uzywany" +msgid "" +"format for CTCP reply or empty string for blocking CTCP (no reply), " +"following variables are replaced: $version (WeeChat version), $compilation " +"(compilation date), $osinfo (info about OS), $site (WeeChat site), $download " +"(WeeChat site, download page), $time (current date and time as text), " +"$username (username on server), $realname (realname on server)" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: error creating CTCP \"%s\" => \"%s\"" +msgstr "%s%s: błąd podczas tworzenia aliasu \"%s\" => \"%s\"" + msgid "list of hostname/port or IP/port for server (separated by comma)" msgstr "lista host/port lub adres IP/port dla serwera (oddzielone przecinkiem)" @@ -4032,6 +4049,38 @@ msgstr "" msgid "send unknown commands to server" msgstr "wysyłaj nieznane komendy do serwera" +#, fuzzy, c-format +msgid "%sCTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%s%sZostałeś zabity przez %s%s %s(%s%s%s)" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s %ld.%ld %s" +msgstr "%sCTCP %sPING%s odpowiedź od %s%s%s: %ld.%ld %s" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP %sPING%s odpowiedź od %s%s%s: %ld.%ld %s" + +#, fuzzy, c-format +msgid "%sCTCP reply to %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP %sPING%s odpowiedź od %s%s%s: %ld.%ld %s" + +#, c-format +msgid "%s%s: not enough memory for \"%s\" command" +msgstr "%s%s: za mało pamięci dla komendy \"%s\"" + +#, c-format +msgid "%s%s: cannot parse \"%s\" command" +msgstr "%s%s: nie można przetworzyć komendy \"%s\"" + +#, c-format +msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" +msgstr "%s%s: nieznany typ DCC CHAT otrzymano od %s%s%s: \"%s\"" + +#, fuzzy, c-format +msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%sNieznane CTCP %s%s%s otrzymano od %s%s%s: %s" + #, c-format msgid "%sServer: %s%s %s[%s%s%s]%s%s" msgstr "%sSerwer: %s%s %s[%s%s%s]%s%s" @@ -4137,14 +4186,6 @@ msgstr "%sJesteś od teraz %s%s" msgid "%s%s%s%s is now known as %s%s" msgstr "%s%s%s%s zmienił nick na %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s odpowiedź od %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sPING%s reply from %s%s%s: %ld.%ld %s" -msgstr "%sCTCP %sPING%s odpowiedź od %s%s%s: %ld.%ld %s" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has left %s%s %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s opuścił %s%s %s(%s%s%s)" @@ -4153,22 +4194,6 @@ msgstr "%s%s%s %s(%s%s%s)%s opuścił %s%s %s(%s%s%s)" msgid "%s%s%s %s(%s%s%s)%s has left %s%s" msgstr "%s%s%s %s(%s%s%s)%s opuścił %s%s" -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" -msgstr "%sCTCP %sVERSION%s otrzymano od %s%s%s: %s" - -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s" -msgstr "%sCTCP %sVERSION%s otrzymano od %s%s" - -#, c-format -msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" -msgstr "%sOtrzymano CTCP %sSOUND%s \"%s\" od %s%s" - -#, c-format -msgid "%sCTCP %sPING%s received from %s%s" -msgstr "%sCTCP %sPING%s otrzymane od %s%s" - #, c-format msgid "%sUnknown CTCP %s%s%s received from %s%s%s: %s" msgstr "%sNieznane CTCP %s%s%s otrzymano od %s%s%s: %s" @@ -4177,18 +4202,6 @@ msgstr "%sNieznane CTCP %s%s%s otrzymano od %s%s%s: %s" msgid "%sUnknown CTCP %s%s%s received from %s%s" msgstr "%sNieznane CTCP %s%s%s otrzymano od %s%s" -#, c-format -msgid "%s%s: cannot parse \"%s\" command" -msgstr "%s%s: nie można przetworzyć komendy \"%s\"" - -#, c-format -msgid "%s%s: not enough memory for \"%s\" command" -msgstr "%s%s: za mało pamięci dla komendy \"%s\"" - -#, c-format -msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" -msgstr "%s%s: nieznany typ DCC CHAT otrzymano od %s%s%s: \"%s\"" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has quit %s(%s%s%s)" msgstr "%s%s%s %s(%s%s%s)%s wyszedł z IRC %s(%s%s%s)" @@ -4781,6 +4794,14 @@ msgstr "katalog \"schare\" WeeChata" msgid "WeeChat \"locale\" directory" msgstr "katalog \"locale\" WeeChata" +#, fuzzy +msgid "WeeChat site" +msgstr "wersja WeeChat" + +#, fuzzy +msgid "WeeChat site, download page" +msgstr "wewnętrzne kodowanie WeeChat" + msgid "terminal charset" msgstr "kodowanie terminala" @@ -5645,6 +5666,21 @@ msgstr "%s%s: nie można ustawić opcji \"nonblock\" dla gniazda" msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s%s: przekroczono czas na \"%s\" z %s" +#~ msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" +#~ msgstr "%sCTCP %sVERSION%s odpowiedź od %s%s%s: %s" + +#~ msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" +#~ msgstr "%sCTCP %sVERSION%s otrzymano od %s%s%s: %s" + +#~ msgid "%sCTCP %sVERSION%s received from %s%s" +#~ msgstr "%sCTCP %sVERSION%s otrzymano od %s%s" + +#~ msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" +#~ msgstr "%sOtrzymano CTCP %sSOUND%s \"%s\" od %s%s" + +#~ msgid "%sCTCP %sPING%s received from %s%s" +#~ msgstr "%sCTCP %sPING%s otrzymane od %s%s" + #~ msgid "text color for nick name in input line" #~ msgstr "kolor nicku w wprowadzonej lini" diff --git a/po/ru.po b/po/ru.po index c1450cfb5..27c2f01b0 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-09-04 10:38+0200\n" +"POT-Creation-Date: 2009-09-15 14:36+0200\n" "PO-Revision-Date: 2009-09-06 21:25+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -2663,6 +2663,10 @@ msgstr "Сервер %s%s%s создан\n" msgid "%s%s: unable to create server \"%s\"" msgstr "%s не могу создать сервер \"%s\"\n" +#, fuzzy, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sСервер: %s%s %s[%s%s%s]\n" + #, fuzzy, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s \"%s\" команда может быть выполнена только в буфере сервера\n" @@ -3699,6 +3703,18 @@ msgid "" "memory because it's currently used" msgstr "" +msgid "" +"format for CTCP reply or empty string for blocking CTCP (no reply), " +"following variables are replaced: $version (WeeChat version), $compilation " +"(compilation date), $osinfo (info about OS), $site (WeeChat site), $download " +"(WeeChat site, download page), $time (current date and time as text), " +"$username (username on server), $realname (realname on server)" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: error creating CTCP \"%s\" => \"%s\"" +msgstr "%s недостаточно памяти для сообщения в строке информации\n" + #, fuzzy msgid "list of hostname/port or IP/port for server (separated by comma)" msgstr "ник, используемый на IRC сервере" @@ -3930,6 +3946,38 @@ msgstr "" msgid "send unknown commands to server" msgstr "отсылать неизвестные команды IRC серверу" +#, fuzzy, c-format +msgid "%sCTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "%s%s%s убил %s%s%s" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s %ld.%ld %s" +msgstr "Ответ на %sPING%s от %s%s%s: %ld.%ld секунд\n" + +#, fuzzy, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" +msgstr "Ответ на %sPING%s от %s%s%s: %ld.%ld секунд\n" + +#, fuzzy, c-format +msgid "%sCTCP reply to %s%s%s: %s%s%s%s%s" +msgstr "Ответ на %sPING%s от %s%s%s: %ld.%ld секунд\n" + +#, fuzzy, c-format +msgid "%s%s: not enough memory for \"%s\" command" +msgstr "%s недостаточно памяти для нового DCC\n" + +#, fuzzy, c-format +msgid "%s%s: cannot parse \"%s\" command" +msgstr "%s не могу проанализировать команду \"%s\"\n" + +#, fuzzy, c-format +msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" +msgstr "%s неизвестный режим DCC CHAT получен от " + +#, fuzzy, c-format +msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "Получен неизвестный CTCP %s%s%s от %s%s" + #, fuzzy, c-format msgid "%sServer: %s%s %s[%s%s%s]%s%s" msgstr "%sСервер: %s%s %s[%s%s%s]\n" @@ -4042,14 +4090,6 @@ msgstr "Теперь вы известны как %s%s\n" msgid "%s%s%s%s is now known as %s%s" msgstr "%s%s%s теперь известен как %s%s\n" -#, fuzzy, c-format -msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" -msgstr "Ответ на CTCP %sVERSION%s от %s%s%s: %s\n" - -#, fuzzy, c-format -msgid "%sCTCP %sPING%s reply from %s%s%s: %ld.%ld %s" -msgstr "Ответ на %sPING%s от %s%s%s: %ld.%ld секунд\n" - #, fuzzy, c-format msgid "%s%s%s %s(%s%s%s)%s has left %s%s %s(%s%s%s)" msgstr "%s%s %s(%s%s%s)%s покинул %s%s" @@ -4058,22 +4098,6 @@ msgstr "%s%s %s(%s%s%s)%s покинул %s%s" msgid "%s%s%s %s(%s%s%s)%s has left %s%s" msgstr "%s%s %s(%s%s%s)%s покинул %s%s" -#, fuzzy, c-format -msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" -msgstr "Получен CTCP %sVERSION%s от %s%s" - -#, fuzzy, c-format -msgid "%sCTCP %sVERSION%s received from %s%s" -msgstr "Получен CTCP %sVERSION%s от %s%s" - -#, fuzzy, c-format -msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" -msgstr "Получен CTCP %sSOUND%s \"%s\" от %s%s\n" - -#, fuzzy, c-format -msgid "%sCTCP %sPING%s received from %s%s" -msgstr "Получен CTCP %sPING%s от %s%s\n" - #, fuzzy, c-format msgid "%sUnknown CTCP %s%s%s received from %s%s%s: %s" msgstr "Получен неизвестный CTCP %s%s%s от %s%s" @@ -4082,18 +4106,6 @@ msgstr "Получен неизвестный CTCP %s%s%s от %s%s" msgid "%sUnknown CTCP %s%s%s received from %s%s" msgstr "Получен неизвестный CTCP %s%s%s от %s%s" -#, fuzzy, c-format -msgid "%s%s: cannot parse \"%s\" command" -msgstr "%s не могу проанализировать команду \"%s\"\n" - -#, fuzzy, c-format -msgid "%s%s: not enough memory for \"%s\" command" -msgstr "%s недостаточно памяти для нового DCC\n" - -#, fuzzy, c-format -msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" -msgstr "%s неизвестный режим DCC CHAT получен от " - #, fuzzy, c-format msgid "%s%s%s %s(%s%s%s)%s has quit %s(%s%s%s)" msgstr "%s%s %s(%s%s%s)%s вышел" @@ -4633,6 +4645,13 @@ msgstr "Ошибка WeeChat:" msgid "WeeChat \"locale\" directory" msgstr "" +#, fuzzy +msgid "WeeChat site" +msgstr "слоган WeeChat" + +msgid "WeeChat site, download page" +msgstr "" + #, fuzzy msgid "terminal charset" msgstr "управление буферами" @@ -5524,6 +5543,26 @@ msgstr "%s DCC: не могу установить неблокирующий р msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s нет аргумента для параметра \"%s\"\n" +#, fuzzy +#~ msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" +#~ msgstr "Ответ на CTCP %sVERSION%s от %s%s%s: %s\n" + +#, fuzzy +#~ msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" +#~ msgstr "Получен CTCP %sVERSION%s от %s%s" + +#, fuzzy +#~ msgid "%sCTCP %sVERSION%s received from %s%s" +#~ msgstr "Получен CTCP %sVERSION%s от %s%s" + +#, fuzzy +#~ msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" +#~ msgstr "Получен CTCP %sSOUND%s \"%s\" от %s%s\n" + +#, fuzzy +#~ msgid "%sCTCP %sPING%s received from %s%s" +#~ msgstr "Получен CTCP %sPING%s от %s%s\n" + #, fuzzy #~ msgid "text color for nick name in input line" #~ msgstr "цвет ников" diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index d516c4ffc..7a4d7fe44 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -117,6 +117,8 @@ SET(WEECHAT_SOURCES ./src/plugins/irc/irc-completion.h ./src/plugins/irc/irc-config.c ./src/plugins/irc/irc-config.h +./src/plugins/irc/irc-ctcp.c +./src/plugins/irc/irc-ctcp.h ./src/plugins/irc/irc-debug.c ./src/plugins/irc/irc-debug.h ./src/plugins/irc/irc-display.c diff --git a/po/weechat.pot b/po/weechat.pot index 6425912e0..31b636d0d 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-09-04 10:38+0200\n" +"POT-Creation-Date: 2009-09-15 14:36+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2305,6 +2305,10 @@ msgstr "" msgid "%s%s: unable to create server \"%s\"" msgstr "" +#, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "" + #, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "" @@ -3154,6 +3158,18 @@ msgid "" "memory because it's currently used" msgstr "" +msgid "" +"format for CTCP reply or empty string for blocking CTCP (no reply), " +"following variables are replaced: $version (WeeChat version), $compilation " +"(compilation date), $osinfo (info about OS), $site (WeeChat site), $download " +"(WeeChat site, download page), $time (current date and time as text), " +"$username (username on server), $realname (realname on server)" +msgstr "" + +#, c-format +msgid "%s%s: error creating CTCP \"%s\" => \"%s\"" +msgstr "" + msgid "list of hostname/port or IP/port for server (separated by comma)" msgstr "" @@ -3344,6 +3360,38 @@ msgstr "" msgid "send unknown commands to server" msgstr "" +#, c-format +msgid "%sCTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "" + +#, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s %ld.%ld %s" +msgstr "" + +#, c-format +msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" +msgstr "" + +#, c-format +msgid "%sCTCP reply to %s%s%s: %s%s%s%s%s" +msgstr "" + +#, c-format +msgid "%s%s: not enough memory for \"%s\" command" +msgstr "" + +#, c-format +msgid "%s%s: cannot parse \"%s\" command" +msgstr "" + +#, c-format +msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" +msgstr "" + +#, c-format +msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" +msgstr "" + #, c-format msgid "%sServer: %s%s %s[%s%s%s]%s%s" msgstr "" @@ -3448,14 +3496,6 @@ msgstr "" msgid "%s%s%s%s is now known as %s%s" msgstr "" -#, c-format -msgid "%sCTCP %sVERSION%s reply from %s%s%s: %s" -msgstr "" - -#, c-format -msgid "%sCTCP %sPING%s reply from %s%s%s: %ld.%ld %s" -msgstr "" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has left %s%s %s(%s%s%s)" msgstr "" @@ -3464,22 +3504,6 @@ msgstr "" msgid "%s%s%s %s(%s%s%s)%s has left %s%s" msgstr "" -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s%s: %s" -msgstr "" - -#, c-format -msgid "%sCTCP %sVERSION%s received from %s%s" -msgstr "" - -#, c-format -msgid "%sReceived a CTCP %sSOUND%s \"%s\" from %s%s" -msgstr "" - -#, c-format -msgid "%sCTCP %sPING%s received from %s%s" -msgstr "" - #, c-format msgid "%sUnknown CTCP %s%s%s received from %s%s%s: %s" msgstr "" @@ -3488,18 +3512,6 @@ msgstr "" msgid "%sUnknown CTCP %s%s%s received from %s%s" msgstr "" -#, c-format -msgid "%s%s: cannot parse \"%s\" command" -msgstr "" - -#, c-format -msgid "%s%s: not enough memory for \"%s\" command" -msgstr "" - -#, c-format -msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" -msgstr "" - #, c-format msgid "%s%s%s %s(%s%s%s)%s has quit %s(%s%s%s)" msgstr "" @@ -4018,6 +4030,12 @@ msgstr "" msgid "WeeChat \"locale\" directory" msgstr "" +msgid "WeeChat site" +msgstr "" + +msgid "WeeChat site, download page" +msgstr "" + msgid "terminal charset" msgstr "" diff --git a/src/core/weechat.h b/src/core/weechat.h index 91b91fa93..6d626c685 100644 --- a/src/core/weechat.h +++ b/src/core/weechat.h @@ -50,8 +50,9 @@ #endif -#define WEECHAT_COPYRIGHT_DATE "(c) 2003-2009" -#define WEECHAT_WEBSITE "http://www.weechat.org/" +#define WEECHAT_COPYRIGHT_DATE "(c) 2003-2009" +#define WEECHAT_WEBSITE "http://www.weechat.org/" +#define WEECHAT_WEBSITE_DOWNLOAD "http://www.weechat.org/download" /* log file */ diff --git a/src/plugins/irc/CMakeLists.txt b/src/plugins/irc/CMakeLists.txt index a56c5e815..ace1da002 100644 --- a/src/plugins/irc/CMakeLists.txt +++ b/src/plugins/irc/CMakeLists.txt @@ -23,6 +23,7 @@ irc-color.c irc-color.h irc-command.c irc-command.h irc-completion.c irc-completion.h irc-config.c irc-config.h +irc-ctcp.c irc-ctcp.h irc-debug.c irc-debug.h irc-display.c irc-display.h irc-ignore.c irc-ignore.h diff --git a/src/plugins/irc/Makefile.am b/src/plugins/irc/Makefile.am index 4b7864cab..09f1b5adc 100644 --- a/src/plugins/irc/Makefile.am +++ b/src/plugins/irc/Makefile.am @@ -36,6 +36,8 @@ irc_la_SOURCES = irc.c \ irc-completion.h \ irc-config.c \ irc-config.h \ + irc-ctcp.c \ + irc-ctcp.h \ irc-debug.c \ irc-debug.h \ irc-display.c \ diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 1463a1fd8..f570e1164 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -663,7 +663,7 @@ int irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { - char *pos, *irc_cmd; + char *pos, *irc_cmd, str_time[512]; struct timeval tv; IRC_GET_SERVER(buffer); @@ -688,52 +688,40 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, if ((weechat_strcasecmp (argv[2], "ping") == 0) && !argv_eol[3]) { gettimeofday (&tv, NULL); - irc_server_sendf (ptr_server, 1, "PRIVMSG %s :\01PING %d %d\01", - argv[1], tv.tv_sec, tv.tv_usec); + snprintf (str_time, sizeof (str_time), "%ld %ld", + tv.tv_sec, tv.tv_usec); + irc_server_sendf (ptr_server, 1, "PRIVMSG %s :\01PING %s\01", + argv[1], str_time); weechat_printf (ptr_server->buffer, - "CTCP%s(%s%s%s)%s: %s%s %s%d %d", - IRC_COLOR_CHAT_DELIMITERS, + _("%sCTCP query to %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), IRC_COLOR_CHAT_NICK, argv[1], - IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT, IRC_COLOR_CHAT_CHANNEL, irc_cmd, IRC_COLOR_CHAT, - tv.tv_sec, tv.tv_usec); + " ", + str_time); } else { - if (argv_eol[3]) - { - irc_server_sendf (ptr_server, 1, "PRIVMSG %s :\01%s %s\01", - argv[1], irc_cmd, argv_eol[3]); - weechat_printf (ptr_server->buffer, - "CTCP%s(%s%s%s)%s: %s%s %s%s", - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, - argv[1], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_CHANNEL, - irc_cmd, - IRC_COLOR_CHAT, - argv_eol[3]); - } - else - { - irc_server_sendf (ptr_server, 1, "PRIVMSG %s :\01%s\01", - argv[1], irc_cmd); - weechat_printf (ptr_server->buffer, - "CTCP%s(%s%s%s)%s: %s%s", - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_NICK, - argv[1], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_CHANNEL, - irc_cmd); - } + irc_server_sendf (ptr_server, 1, "PRIVMSG %s :\01%s%s%s\01", + argv[1], + irc_cmd, + (argv_eol[3]) ? " " : "", + (argv_eol[3]) ? argv_eol[3] : ""); + weechat_printf (ptr_server->buffer, + _("%sCTCP query to %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK, + argv[1], + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + irc_cmd, + IRC_COLOR_CHAT, + (argv_eol[3]) ? " " : "", + (argv_eol[3]) ? argv_eol[3] : ""); } free (irc_cmd); @@ -3730,7 +3718,9 @@ irc_command_init () " type: CTCP type (examples: \"version\", " "\"ping\", ..)\n" "arguments: arguments for CTCP"), - "%(irc_channel)|%(nicks) action|ping|version", + "%(irc_channel)|%(nicks) " + "action|clientinfo|finger|ping|source|time|userinfo|" + "version", &irc_command_ctcp, NULL); weechat_hook_command ("cycle", N_("leave and rejoin a channel"), diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index dc871a54b..37b2a8edc 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -29,6 +29,7 @@ #include "../weechat-plugin.h" #include "irc.h" #include "irc-config.h" +#include "irc-ctcp.h" #include "irc-buffer.h" #include "irc-ignore.h" #include "irc-nick.h" @@ -37,6 +38,7 @@ struct t_config_file *irc_config_file = NULL; +struct t_config_section *irc_config_section_ctcp = NULL; struct t_config_section *irc_config_section_server_default = NULL; struct t_config_section *irc_config_section_server = NULL; @@ -551,6 +553,85 @@ irc_config_reload (void *data, struct t_config_file *config_file) return rc; } +/* + * irc_config_ctcp_create_option: set a ctcp reply format + */ + +int +irc_config_ctcp_create_option (void *data, struct t_config_file *config_file, + struct t_config_section *section, + const char *option_name, const char *value) +{ + struct t_config_option *ptr_option; + int rc; + const char *default_value; + static char empty_value[1] = { '\0' }; + const char *pos_name; + + /* make C compiler happy */ + (void) data; + + rc = WEECHAT_CONFIG_OPTION_SET_ERROR; + + if (option_name) + { + ptr_option = weechat_config_search_option (config_file, section, + option_name); + if (ptr_option) + { + if (value) + rc = weechat_config_option_set (ptr_option, value, 1); + else + { + weechat_config_option_free (ptr_option); + rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; + } + } + else + { + if (value) + { + pos_name = strchr (option_name, '.'); + pos_name = (pos_name) ? pos_name + 1 : option_name; + + default_value = irc_ctcp_get_default_reply (pos_name); + if (!default_value) + default_value = empty_value; + + ptr_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + _("format for CTCP reply or empty string for blocking " + "CTCP (no reply), following variables are replaced: " + "$version (WeeChat version), " + "$compilation (compilation date), " + "$osinfo (info about OS), " + "$site (WeeChat site), " + "$download (WeeChat site, download page), " + "$time (current date and time as text), " + "$username (username on server), " + "$realname (realname on server)"), + NULL, 0, 0, default_value, value, 0, + NULL, NULL, NULL, NULL, NULL, NULL); + rc = (ptr_option) ? + WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; + } + else + rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; + } + } + + if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR) + { + weechat_printf (NULL, + _("%s%s: error creating CTCP \"%s\" => \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + option_name, value); + } + + return rc; +} + /* * irc_config_ignore_read: read ignore option from configuration file * return 1 if ok, 0 if error @@ -1351,6 +1432,21 @@ irc_config_init () NULL, 0, 0, "off", NULL, 0, NULL, NULL, &irc_config_change_network_send_unknown_commands, NULL, NULL, NULL); + /* CTCP */ + ptr_section = weechat_config_new_section (irc_config_file, "ctcp", + 1, 1, + NULL, NULL, NULL, NULL, + NULL, NULL, + &irc_config_ctcp_create_option, NULL, + NULL, NULL); + if (!ptr_section) + { + weechat_config_free (irc_config_file); + return 0; + } + + irc_config_section_ctcp = ptr_section; + /* ignore */ ptr_section = weechat_config_new_section (irc_config_file, "ignore", 0, 0, diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 004734310..47cc1696f 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -57,6 +57,7 @@ enum t_irc_config_display_away }; extern struct t_config_file *irc_config_file; +extern struct t_config_section *irc_config_section_ctcp; extern struct t_config_section *irc_config_section_server_default; extern struct t_config_section *irc_config_section_server; diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c new file mode 100644 index 000000000..d3af58e03 --- /dev/null +++ b/src/plugins/irc/irc-ctcp.c @@ -0,0 +1,951 @@ +/* + * Copyright (c) 2003-2009 by FlashCode + * 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 . + */ + +/* irc-ctcp.c: IRC CTCP protocol */ + + +#include +#include +#include +#include +#include +#include + +#include "../weechat-plugin.h" +#include "irc.h" +#include "irc-ctcp.h" +#include "irc-channel.h" +#include "irc-color.h" +#include "irc-config.h" +#include "irc-nick.h" +#include "irc-protocol.h" +#include "irc-server.h" + + +struct t_irc_ctcp_reply irc_ctcp_default_reply[] = +{ { "clientinfo", "$clientinfo" }, + { "finger", "WeeChat $version" }, + { "source", "$download" }, + { "time", "$time" }, + { "userinfo", "$username ($realname)" }, + { "version", "WeeChat $version ($compilation)" }, + { NULL, NULL }, +}; + + +/* + * irc_ctcp_get_default_reply: get default reply for a CTCP query + * return NULL if CTCP is unknown + */ + +const char * +irc_ctcp_get_default_reply (const char *ctcp) +{ + int i; + + for (i = 0; irc_ctcp_default_reply[i].name; i++) + { + if (weechat_strcasecmp (irc_ctcp_default_reply[i].name, ctcp) == 0) + return irc_ctcp_default_reply[i].reply; + } + + /* unknown CTCP */ + return NULL; +} + +/* + * irc_ctcp_get_reply: get reply for a CTCP query + */ + +const char * +irc_ctcp_get_reply (struct t_irc_server *server, const char *ctcp) +{ + struct t_config_option *ptr_option; + char option_name[512]; + + snprintf (option_name, sizeof (option_name), "%s.%s", server->name, ctcp); + + /* search for CTCP in config file, for server */ + ptr_option = weechat_config_search_option (irc_config_file, + irc_config_section_ctcp, + option_name); + if (ptr_option) + return weechat_config_string (ptr_option); + + /* search for CTCP in config file */ + ptr_option = weechat_config_search_option (irc_config_file, + irc_config_section_ctcp, + ctcp); + if (ptr_option) + return weechat_config_string (ptr_option); + + /* no CTCP reply found in config, then return default reply, or NULL + for unknown CTCP */ + return irc_ctcp_get_default_reply (ctcp); +} + +/* + * irc_ctcp_display_request: display CTCP requested by a nick + */ + +void +irc_ctcp_display_request (struct t_irc_server *server, + const char *command, + struct t_irc_channel *channel, + const char *nick, const char *ctcp, + const char *arguments) +{ + weechat_printf_tags ((channel) ? channel->buffer : server->buffer, + irc_protocol_tags (command, "irc_ctcp"), + _("%sCTCP requested by %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + ctcp, + IRC_COLOR_CHAT, + (arguments) ? " " : "", + (arguments) ? arguments : ""); +} + +/* + * irc_ctcp_display_reply_from_nick: display reply from a nick to a CTCP query + */ + +void +irc_ctcp_display_reply_from_nick (struct t_irc_server *server, + const char *command, const char *nick, + char *arguments) +{ + char *pos_end, *pos_space, *pos_args, *pos_usec; + struct timeval tv; + long sec1, usec1, sec2, usec2, difftime; + + while (arguments && arguments[0]) + { + pos_end = strchr (arguments + 1, '\01'); + if (pos_end) + pos_end[0] = '\0'; + + pos_space = strchr (arguments + 1, ' '); + if (pos_space) + { + pos_space[0] = '\0'; + pos_args = pos_space + 1; + while (pos_args[0] == ' ') + { + pos_args++; + } + if (strcmp (arguments + 1, "PING") == 0) + { + pos_usec = strchr (pos_args, ' '); + if (pos_usec) + { + pos_usec[0] = '\0'; + + gettimeofday (&tv, NULL); + sec1 = atol (pos_args); + usec1 = atol (pos_usec + 1); + sec2 = tv.tv_sec; + usec2 = tv.tv_usec; + + difftime = ((sec2 * 1000000) + usec2) - + ((sec1 * 1000000) + usec1); + + weechat_printf_tags (server->buffer, + irc_protocol_tags (command, "irc_ctcp"), + _("%sCTCP reply from %s%s%s: %s%s%s " + "%ld.%ld %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + arguments + 1, + IRC_COLOR_CHAT, + difftime / 1000000, + (difftime % 1000000) / 1000, + (NG_("second", "seconds", + (difftime / 1000000)))); + + pos_usec[0] = ' '; + } + } + else + { + weechat_printf_tags (server->buffer, + irc_protocol_tags (command, "irc_ctcp"), + _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + arguments + 1, + IRC_COLOR_CHAT, + " ", + pos_args); + } + pos_space[0] = ' '; + } + else + { + weechat_printf_tags (server->buffer, + irc_protocol_tags (command, NULL), + _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + arguments + 1, + "", + "", + ""); + } + + if (pos_end) + pos_end[0] = '\01'; + + arguments = (pos_end) ? pos_end + 1 : NULL; + } +} + +/* + * irc_ctcp_reply_to_nick: display CTCP replied to a nick + */ + +void +irc_ctcp_reply_to_nick (struct t_irc_server *server, + const char *command, + struct t_irc_channel *channel, + const char *nick, const char *ctcp, + const char *arguments) +{ + irc_server_sendf (server, 0, + "NOTICE %s :\01%s%s%s\01", + nick, ctcp, + (arguments) ? " " : "", + (arguments) ? arguments : ""); + + weechat_printf_tags ((channel) ? channel->buffer : server->buffer, + irc_protocol_tags (command, "irc_ctcp,irc_ctcp_reply"), + _("%sCTCP reply to %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + ctcp, + IRC_COLOR_CHAT, + (arguments) ? " " : "", + (arguments) ? arguments : ""); +} + +/* + * irc_ctcp_replace_variables: replace variables in CTCP format + */ + +char * +irc_ctcp_replace_variables (struct t_irc_server *server, const char *format) +{ + char *res, *temp; + const char *info; + time_t now; + char buf[1024]; + struct utsname *buf_uname; + + /* clientinfo */ + temp = weechat_string_replace (format, "$clientinfo", + "ACTION DCC CLIENTINFO FINGER PING SOURCE " + "TIME USERINFO VERSION"); + if (!temp) + return NULL; + res = temp; + + /* version */ + info = weechat_info_get ("version", ""); + temp = weechat_string_replace (res, "$version", info); + free (res); + if (!temp) + return NULL; + res = temp; + + /* compilation date */ + info = weechat_info_get ("date", ""); + temp = weechat_string_replace (res, "$compilation", info); + free (res); + if (!temp) + return NULL; + res = temp; + + /* info about OS */ + buf_uname = (struct utsname *)malloc (sizeof (struct utsname)); + if (buf_uname && (uname (buf_uname) >= 0)) + { + snprintf (buf, sizeof (buf), "%s %s / %s", + buf_uname->sysname, buf_uname->release, + buf_uname->machine); + free (buf_uname); + temp = weechat_string_replace (res, "$osinfo", buf); + free (res); + if (!temp) + return NULL; + res = temp; + } + + /* site */ + info = weechat_info_get ("weechat_site", ""); + temp = weechat_string_replace (res, "$site", info); + free (res); + if (!temp) + return NULL; + res = temp; + + /* site (download page) */ + info = weechat_info_get ("weechat_site_download", ""); + temp = weechat_string_replace (res, "$download", info); + free (res); + if (!temp) + return NULL; + res = temp; + + /* time */ + now = time (NULL); + snprintf (buf, sizeof (buf), "%s", + ctime (&now)); + buf[strlen (buf) - 1] = '\0'; + temp = weechat_string_replace (res, "$time", buf); + free (res); + if (!temp) + return NULL; + res = temp; + + /* username */ + temp = weechat_string_replace (res, "$username", + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_USERNAME)); + free (res); + if (!temp) + return NULL; + res = temp; + + /* realname */ + temp = weechat_string_replace (res, "$realname", + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_REALNAME)); + free (res); + if (!temp) + return NULL; + res = temp; + + /* return result */ + return res; +} + +/* + * irc_ctcp_recv_dcc: parse CTCP DCC + */ + +void +irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, + const char *arguments, char *message) +{ + char *dcc_args, *pos, *pos_file, *pos_addr, *pos_port, *pos_size, *pos_start_resume; + struct t_infolist *infolist; + struct t_infolist_item *item; + char plugin_id[128]; + + if (strncmp (arguments, "SEND ", 5) == 0) + { + arguments += 5; + while (arguments[0] == ' ') + { + arguments++; + } + dcc_args = strdup (arguments); + + if (!dcc_args) + { + weechat_printf (server->buffer, + _("%s%s: not enough memory for \"%s\" " + "command"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, "privmsg"); + return; + } + + /* DCC filename */ + pos_file = dcc_args; + while (pos_file[0] == ' ') + { + pos_file++; + } + + /* look for file size */ + pos_size = strrchr (pos_file, ' '); + if (!pos_size) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, "privmsg"); + free (dcc_args); + return; + } + + pos = pos_size; + pos_size++; + while (pos[0] == ' ') + { + pos--; + } + pos[1] = '\0'; + + /* look for DCC port */ + pos_port = strrchr (pos_file, ' '); + if (!pos_port) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, "privmsg"); + free (dcc_args); + return; + } + + pos = pos_port; + pos_port++; + while (pos[0] == ' ') + { + pos--; + } + pos[1] = '\0'; + + /* look for DCC IP address */ + pos_addr = strrchr (pos_file, ' '); + if (!pos_addr) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, "privmsg"); + free (dcc_args); + return; + } + + pos = pos_addr; + pos_addr++; + while (pos[0] == ' ') + { + pos--; + } + pos[1] = '\0'; + + /* add DCC file via xfer plugin */ + infolist = weechat_infolist_new (); + if (infolist) + { + item = weechat_infolist_new_item (infolist); + if (item) + { + weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name); + snprintf (plugin_id, sizeof (plugin_id), + "%lx", (long unsigned int)server); + weechat_infolist_new_var_string (item, "plugin_id", plugin_id); + weechat_infolist_new_var_string (item, "type", "file_recv"); + weechat_infolist_new_var_string (item, "protocol", "dcc"); + weechat_infolist_new_var_string (item, "remote_nick", nick); + weechat_infolist_new_var_string (item, "local_nick", server->nick); + weechat_infolist_new_var_string (item, "filename", pos_file); + weechat_infolist_new_var_string (item, "size", pos_size); + weechat_infolist_new_var_string (item, "proxy", + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY)); + weechat_infolist_new_var_string (item, "address", pos_addr); + weechat_infolist_new_var_integer (item, "port", atoi (pos_port)); + weechat_hook_signal_send ("xfer_add", + WEECHAT_HOOK_SIGNAL_POINTER, + infolist); + } + weechat_infolist_free (infolist); + } + + weechat_hook_signal_send ("irc_dcc", + WEECHAT_HOOK_SIGNAL_STRING, + message); + + free (dcc_args); + } + else if (strncmp (arguments, "RESUME ", 7) == 0) + { + arguments += 7; + while (arguments[0] == ' ') + { + arguments++; + } + dcc_args = strdup (arguments); + + if (!dcc_args) + { + weechat_printf (server->buffer, + _("%s%s: not enough memory for \"%s\" " + "command"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, "privmsg"); + return; + } + + /* DCC filename */ + pos_file = dcc_args; + while (pos_file[0] == ' ') + { + pos_file++; + } + + /* look for resume start position */ + pos_start_resume = strrchr (pos_file, ' '); + if (!pos_start_resume) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, "privmsg"); + free (dcc_args); + return; + } + pos = pos_start_resume; + pos_start_resume++; + while (pos[0] == ' ') + { + pos--; + } + pos[1] = '\0'; + + /* look for DCC port */ + pos_port = strrchr (pos_file, ' '); + if (!pos_port) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, "privmsg"); + free (dcc_args); + return; + } + pos = pos_port; + pos_port++; + while (pos[0] == ' ') + { + pos--; + } + pos[1] = '\0'; + + /* accept resume via xfer plugin */ + infolist = weechat_infolist_new (); + if (infolist) + { + item = weechat_infolist_new_item (infolist); + if (item) + { + weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name); + snprintf (plugin_id, sizeof (plugin_id), + "%lx", (long unsigned int)server); + weechat_infolist_new_var_string (item, "plugin_id", plugin_id); + weechat_infolist_new_var_string (item, "type", "file_recv"); + weechat_infolist_new_var_string (item, "filename", pos_file); + weechat_infolist_new_var_integer (item, "port", atoi (pos_port)); + weechat_infolist_new_var_string (item, "start_resume", pos_start_resume); + weechat_hook_signal_send ("xfer_accept_resume", + WEECHAT_HOOK_SIGNAL_POINTER, + infolist); + } + weechat_infolist_free (infolist); + } + + weechat_hook_signal_send ("irc_dcc", + WEECHAT_HOOK_SIGNAL_STRING, + message); + + free (dcc_args); + } + else if (strncmp (arguments, "ACCEPT ", 7) == 0) + { + arguments += 7; + while (arguments[0] == ' ') + { + arguments++; + } + dcc_args = strdup (arguments); + + if (!dcc_args) + { + weechat_printf (server->buffer, + _("%s%s: not enough memory for \"%s\" " + "command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "privmsg"); + return; + } + + /* DCC filename */ + pos_file = dcc_args; + while (pos_file[0] == ' ') + { + pos_file++; + } + + /* look for resume start position */ + pos_start_resume = strrchr (pos_file, ' '); + if (!pos_start_resume) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "privmsg"); + free (dcc_args); + return; + } + pos = pos_start_resume; + pos_start_resume++; + while (pos[0] == ' ') + { + pos--; + } + pos[1] = '\0'; + + /* look for DCC port */ + pos_port = strrchr (pos_file, ' '); + if (!pos_port) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "privmsg"); + free (dcc_args); + return; + } + pos = pos_port; + pos_port++; + while (pos[0] == ' ') + { + pos--; + } + pos[1] = '\0'; + + /* resume file via xfer plugin */ + infolist = weechat_infolist_new (); + if (infolist) + { + item = weechat_infolist_new_item (infolist); + if (item) + { + weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name); + snprintf (plugin_id, sizeof (plugin_id), + "%lx", (long unsigned int)server); + weechat_infolist_new_var_string (item, "plugin_id", plugin_id); + weechat_infolist_new_var_string (item, "type", "file_recv"); + weechat_infolist_new_var_string (item, "filename", pos_file); + weechat_infolist_new_var_integer (item, "port", atoi (pos_port)); + weechat_infolist_new_var_string (item, "start_resume", pos_start_resume); + weechat_hook_signal_send ("xfer_start_resume", + WEECHAT_HOOK_SIGNAL_POINTER, + infolist); + } + weechat_infolist_free (infolist); + } + + weechat_hook_signal_send ("irc_dcc", + WEECHAT_HOOK_SIGNAL_STRING, + message); + + free (dcc_args); + } + else if (strncmp (arguments, "CHAT ", 5) == 0) + { + arguments += 5; + while (arguments[0] == ' ') + { + arguments++; + } + dcc_args = strdup (arguments); + + if (!dcc_args) + { + weechat_printf (server->buffer, + _("%s%s: not enough memory for \"%s\" " + "command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "privmsg"); + return; + } + + /* CHAT type */ + pos_file = dcc_args; + while (pos_file[0] == ' ') + { + pos_file++; + } + + /* DCC IP address */ + pos_addr = strchr (pos_file, ' '); + if (!pos_addr) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "privmsg"); + free (dcc_args); + return; + } + pos_addr[0] = '\0'; + pos_addr++; + while (pos_addr[0] == ' ') + { + pos_addr++; + } + + /* look for DCC port */ + pos_port = strchr (pos_addr, ' '); + if (!pos_port) + { + weechat_printf (server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "privmsg"); + free (dcc_args); + return; + } + pos_port[0] = '\0'; + pos_port++; + while (pos_port[0] == ' ') + { + pos_port++; + } + + if (weechat_strcasecmp (pos_file, "chat") != 0) + { + weechat_printf (server->buffer, + _("%s%s: unknown DCC CHAT type " + "received from %s%s%s: \"%s\""), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_CHAT, + pos_file); + free (dcc_args); + return; + } + + /* add DCC chat via xfer plugin */ + infolist = weechat_infolist_new (); + if (infolist) + { + item = weechat_infolist_new_item (infolist); + if (item) + { + weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name); + snprintf (plugin_id, sizeof (plugin_id), + "%lx", (long unsigned int)server); + weechat_infolist_new_var_string (item, "plugin_id", plugin_id); + weechat_infolist_new_var_string (item, "type", "chat_recv"); + weechat_infolist_new_var_string (item, "remote_nick", nick); + weechat_infolist_new_var_string (item, "local_nick", server->nick); + weechat_infolist_new_var_string (item, "proxy", + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY)); + weechat_infolist_new_var_string (item, "address", pos_addr); + weechat_infolist_new_var_integer (item, "port", atoi (pos_port)); + weechat_hook_signal_send ("xfer_add", + WEECHAT_HOOK_SIGNAL_POINTER, + infolist); + } + weechat_infolist_free (infolist); + } + + weechat_hook_signal_send ("irc_dcc", + WEECHAT_HOOK_SIGNAL_STRING, + message); + + free (dcc_args); + } +} + +/* + * irc_ctcp_recv: receive a CTCP and if needed reply to query + */ + +void +irc_ctcp_recv (struct t_irc_server *server, const char *command, + struct t_irc_channel *channel, const char *address, + const char *nick, const char *remote_nick, char *arguments, + char *message) +{ + char *pos_end, *pos_space, *pos_args; + const char *reply; + char *decoded_reply; + struct t_irc_channel *ptr_channel; + struct t_irc_nick *ptr_nick; + int nick_is_me; + + while (arguments && arguments[0]) + { + pos_end = strchr (arguments + 1, '\01'); + if (pos_end) + pos_end[0] = '\0'; + + pos_args = NULL; + pos_space = strchr (arguments + 1, ' '); + if (pos_space) + { + pos_space[0] = '\0'; + pos_args = pos_space + 1; + while (pos_args[0] == ' ') + { + pos_args++; + } + } + + /* CTCP ACTION */ + if (strcmp (arguments + 1, "ACTION") == 0) + { + if (channel) + { + ptr_nick = irc_nick_search (channel, nick); + + irc_channel_nick_speaking_add (channel, + nick, + weechat_string_has_highlight (pos_args, + server->nick)); + irc_channel_nick_speaking_time_remove_old (channel); + irc_channel_nick_speaking_time_add (channel, nick, + time (NULL)); + + weechat_printf_tags (channel->buffer, + irc_protocol_tags (command, + "irc_action,notify_message"), + "%s%s%s %s%s", + weechat_prefix ("action"), + (ptr_nick) ? ptr_nick->color : IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_CHAT, + pos_args); + } + else + { + nick_is_me = (strcmp (server->nick, nick) == 0); + ptr_channel = irc_channel_search (server, remote_nick); + if (!ptr_channel) + { + ptr_channel = irc_channel_new (server, + IRC_CHANNEL_TYPE_PRIVATE, + remote_nick, 0, 0); + if (!ptr_channel) + { + weechat_printf (server->buffer, + _("%s%s: cannot create new " + "private buffer \"%s\""), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, remote_nick); + } + } + if (ptr_channel) + { + if (!ptr_channel->topic) + irc_channel_set_topic (ptr_channel, address); + + weechat_printf_tags (ptr_channel->buffer, + irc_protocol_tags (command, + (nick_is_me) ? + "irc_action,notify_private,no_highlight" : + "irc_action,notify_private"), + "%s%s%s %s%s", + weechat_prefix ("action"), + (nick_is_me) ? + IRC_COLOR_CHAT_NICK_SELF : IRC_COLOR_CHAT_NICK_OTHER, + nick, + IRC_COLOR_CHAT, + pos_args); + weechat_hook_signal_send ("irc_pv", + WEECHAT_HOOK_SIGNAL_STRING, + message); + } + } + } + /* CTCP PING */ + else if (strcmp (arguments + 1, "PING") == 0) + { + irc_ctcp_display_request (server, command, channel, nick, + arguments + 1, pos_args); + irc_ctcp_reply_to_nick (server, command, channel, nick, + arguments + 1, pos_args); + } + /* CTCP DCC */ + else if (strcmp (arguments + 1, "DCC") == 0) + { + irc_ctcp_recv_dcc (server, nick, pos_args, message); + } + /* other CTCP */ + else + { + reply = irc_ctcp_get_reply (server, arguments + 1); + if (reply) + { + irc_ctcp_display_request (server, command, channel, nick, + arguments + 1, pos_args); + + if (reply[0]) + { + decoded_reply = irc_ctcp_replace_variables (server, reply); + if (decoded_reply) + { + irc_ctcp_reply_to_nick (server, command, channel, nick, + arguments + 1, decoded_reply); + free (decoded_reply); + } + } + } + else + { + weechat_printf_tags ((channel) ? channel->buffer : server->buffer, + irc_protocol_tags (command, "irc_ctcp"), + _("%sUnknown CTCP requested by %s%s%s: " + "%s%s%s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + arguments + 1, + IRC_COLOR_CHAT, + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); + } + } + + weechat_hook_signal_send ("irc_ctcp", + WEECHAT_HOOK_SIGNAL_STRING, + message); + + if (pos_space) + pos_space[0] = ' '; + + if (pos_end) + pos_end[0] = '\01'; + + arguments = (pos_end) ? pos_end + 1 : NULL; + } +} diff --git a/src/plugins/irc/irc-ctcp.h b/src/plugins/irc/irc-ctcp.h new file mode 100644 index 000000000..2708b3565 --- /dev/null +++ b/src/plugins/irc/irc-ctcp.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2003-2009 by FlashCode + * 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 . + */ + + +#ifndef __WEECHAT_IRC_CTCP_H +#define __WEECHAT_IRC_CTCP_H 1 + +struct t_irc_server; +struct t_irc_channel; + +struct t_irc_ctcp_reply +{ + char *name; /* CTCP name */ + char *reply; /* CTCP reply format */ +}; + +extern const char *irc_ctcp_get_default_reply (const char *ctcp); +extern void irc_ctcp_display_reply_from_nick (struct t_irc_server *server, + const char *command, + const char *nick, + char *arguments); +extern void irc_ctcp_recv (struct t_irc_server *server, const char *command, + struct t_irc_channel *channel, const char *address, + const char *nick, const char *remote_nick, + char *arguments, char *message); + +#endif /* irc-ctcp.h */ diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 8c697d9f7..7155366d2 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -38,6 +38,7 @@ #include "irc-color.h" #include "irc-command.h" #include "irc-config.h" +#include "irc-ctcp.h" #include "irc-server.h" #include "irc-channel.h" #include "irc-nick.h" @@ -732,9 +733,7 @@ int irc_protocol_cmd_notice (struct t_irc_server *server, const char *command, int argc, char **argv, char **argv_eol) { - char *pos_target, *pos_args, *pos_end, *pos_usec; - struct timeval tv; - long sec1, usec1, sec2, usec2, difftime; + char *pos_target, *pos_args; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; int notify_private; @@ -761,70 +760,11 @@ irc_protocol_cmd_notice (struct t_irc_server *server, const char *command, if (nick && irc_ignore_check (server, NULL, nick, host)) return WEECHAT_RC_OK; - - if (nick && strncmp (pos_args, "\01VERSION", 8) == 0) + + if (nick && (pos_args[0] == '\01') + && (pos_args[strlen (pos_args) - 1] == '\01')) { - pos_args += 9; - pos_end = strrchr (pos_args, '\01'); - if (pos_end) - pos_end[0] = '\0'; - weechat_printf_tags (server->buffer, - irc_protocol_tags (command, NULL), - _("%sCTCP %sVERSION%s reply from %s%s%s: %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_NICK, - nick, - IRC_COLOR_CHAT, - pos_args); - if (pos_end) - pos_end[0] = '\01'; - } - else if (nick && strncmp (pos_args, "\01PING", 5) == 0) - { - pos_args += 5; - while (pos_args[0] == ' ') - { - pos_args++; - } - pos_usec = strchr (pos_args, ' '); - if (pos_usec) - { - pos_usec[0] = '\0'; - pos_end = strrchr (pos_usec + 1, '\01'); - if (pos_end) - { - pos_end[0] = '\0'; - - gettimeofday (&tv, NULL); - sec1 = atol (pos_args); - usec1 = atol (pos_usec + 1); - sec2 = tv.tv_sec; - usec2 = tv.tv_usec; - - difftime = ((sec2 * 1000000) + usec2) - - ((sec1 * 1000000) + usec1); - - weechat_printf_tags (server->buffer, - irc_protocol_tags (command, "irc_ctcp"), - _("%sCTCP %sPING%s reply from " - "%s%s%s: %ld.%ld %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_NICK, - nick, - IRC_COLOR_CHAT, - difftime / 1000000, - (difftime % 1000000) / 1000, - (NG_("second", "seconds", - (difftime / 1000000)))); - - pos_end[0] = '\01'; - } - pos_usec[0] = ' '; - } + irc_ctcp_display_reply_from_nick (server, command, nick, pos_args); } else { @@ -1123,69 +1063,6 @@ irc_protocol_cmd_pong (struct t_irc_server *server, const char *command, return WEECHAT_RC_OK; } -/* - * irc_protocol_reply_version: send version in reply to "CTCP VERSION" request - */ - -void -irc_protocol_reply_version (struct t_irc_server *server, - struct t_irc_channel *channel, const char *nick, - const char *message, const char *str_version) -{ - char *pos; - const char *version, *date; - struct t_gui_buffer *ptr_buffer; - - ptr_buffer = (channel) ? channel->buffer : server->buffer; - - pos = strchr (str_version, ' '); - if (pos) - { - while (pos[0] == ' ') - pos++; - if (pos[0] == '\01') - pos = NULL; - else if (!pos[0]) - pos = NULL; - } - - version = weechat_info_get ("version", ""); - date = weechat_info_get ("date", ""); - if (version && date) - { - irc_server_sendf (server, 0, - "NOTICE %s :\01VERSION WeeChat %s (%s)\01", - nick, version, date); - - if (pos) - { - weechat_printf (ptr_buffer, - _("%sCTCP %sVERSION%s received from %s%s%s: " - "%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_NICK, - nick, - IRC_COLOR_CHAT, - pos); - } - else - { - weechat_printf (ptr_buffer, - _("%sCTCP %sVERSION%s received from %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_NICK, - nick); - } - } - weechat_hook_signal_send ("irc_ctcp", - WEECHAT_HOOK_SIGNAL_STRING, - (void *)message); -} - /* * irc_protocol_cmd_privmsg: 'privmsg' command received */ @@ -1195,20 +1072,18 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, const char *command, int argc, char **argv, char **argv_eol) { char *pos_args, *pos_end_01, *pos, *pos_message; - char *dcc_args, *pos_file, *pos_addr, *pos_port, *pos_size, *pos_start_resume; /* for DCC */ const char *remote_nick; int nick_is_me; - struct t_infolist *infolist; - struct t_infolist_item *item; - char plugin_id[128]; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; /* PRIVMSG message looks like: :nick!user@host PRIVMSG #channel :message for channel here :nick!user@host PRIVMSG mynick :message for private here - :nick!user@host PRIVMSG #channel :ACTION is testing action - :nick!user@host PRIVMSG mynick :ACTION is testing action + :nick!user@host PRIVMSG #channel :\01ACTION is testing action\01 + :nick!user@host PRIVMSG mynick :\01ACTION is testing action\01 + :nick!user@host PRIVMSG #channel :\01VERSION\01 + :nick!user@host PRIVMSG mynick :\01VERSION\01 :nick!user@host PRIVMSG mynick :\01DCC SEND file.txt 1488915698 50612 128\01 */ @@ -1224,176 +1099,16 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, const char *command, ptr_channel = irc_channel_search (server, argv[2]); if (ptr_channel) { - if (strncmp (pos_args, "\01ACTION ", 8) == 0) - { - if (!irc_ignore_check (server, ptr_channel, nick, host)) - { - pos_args += 8; - pos_end_01 = strrchr (pos_args, '\01'); - if (pos_end_01) - pos_end_01[0] = '\0'; - - ptr_nick = irc_nick_search (ptr_channel, nick); - - weechat_printf_tags (ptr_channel->buffer, - irc_protocol_tags (command, - "irc_action,notify_message"), - "%s%s%s %s%s", - weechat_prefix ("action"), - (ptr_nick) ? ptr_nick->color : IRC_COLOR_CHAT_NICK, - nick, - IRC_COLOR_CHAT, - pos_args); - - irc_channel_nick_speaking_add (ptr_channel, - nick, - weechat_string_has_highlight (pos_args, - server->nick)); - irc_channel_nick_speaking_time_remove_old (ptr_channel); - irc_channel_nick_speaking_time_add (ptr_channel, nick, - time (NULL)); - - if (pos_end_01) - pos_end_01[0] = '\01'; - } - - return WEECHAT_RC_OK; - } - if (strncmp (pos_args, "\01SOUND ", 7) == 0) - { - if (!irc_ignore_check (server, ptr_channel, nick, host)) - { - pos_args += 7; - pos_end_01 = strrchr (pos_args, '\01'); - if (pos_end_01) - pos_end_01[0] = '\0'; - - weechat_printf_tags (ptr_channel->buffer, - irc_protocol_tags (command, "irc_ctcp"), - _("%sReceived a CTCP %sSOUND%s \"%s\" " - "from %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - IRC_COLOR_CHAT, - pos_args, - IRC_COLOR_CHAT_NICK, - nick); - - if (pos_end_01) - pos_end_01[0] = '\01'; - } - - return WEECHAT_RC_OK; - } - if (strncmp (pos_args, "\01PING", 5) == 0) - { - if (!irc_ignore_check (server, ptr_channel, nick, host)) - { - pos_args += 5; - while (pos_args[0] == ' ') - pos_args++; - pos_end_01 = strrchr (pos_args, '\01'); - if (pos_end_01) - pos_end_01[0] = '\0'; - else - pos_args = NULL; - if (pos_args && !pos_args[0]) - pos_args = NULL; - if (pos_args) - irc_server_sendf (server, 0, - "NOTICE %s :\01PING %s\01", - nick, pos_args); - else - irc_server_sendf (server, 0, - "NOTICE %s :\01PING\01", - nick); - weechat_printf_tags (ptr_channel->buffer, - irc_protocol_tags (command, "irc_ctcp"), - _("%sCTCP %sPING%s received from %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_NICK, - nick); - if (pos_end_01) - pos_end_01[0] = '\01'; - } - - return WEECHAT_RC_OK; - } - if (strncmp (pos_args, "\01VERSION", 8) == 0) - { - if (!irc_ignore_check (server, ptr_channel, nick, host)) - { - irc_protocol_reply_version (server, ptr_channel, nick, - argv_eol[0], pos_args); - } - - return WEECHAT_RC_OK; - } - - /* unknown CTCP ? */ - pos_end_01 = strrchr (pos_args + 1, '\01'); + /* CTCP to channel */ if ((pos_args[0] == '\01') - && pos_end_01 && (pos_end_01[1] == '\0')) + && (pos_args[strlen (pos_args) - 1] == '\01')) { if (!irc_ignore_check (server, ptr_channel, nick, host)) { - pos_args++; - pos_end_01[0] = '\0'; - pos = strchr (pos_args, ' '); - if (pos) - { - pos[0] = '\0'; - pos_message = pos + 1; - while (pos_message[0] == ' ') - { - pos_message++; - } - if (!pos_message[0]) - pos_message = NULL; - } - else - pos_message = NULL; - - if (pos_message) - { - weechat_printf_tags (ptr_channel->buffer, - irc_protocol_tags (command, "irc_ctcp"), - _("%sUnknown CTCP %s%s%s " - "received from %s%s%s: %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - pos_args, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_NICK, - nick, - IRC_COLOR_CHAT, - pos_message); - } - else - { - weechat_printf_tags (ptr_channel->buffer, - irc_protocol_tags (command, "irc_ctcp"), - _("%sUnknown CTCP %s%s%s " - "received from %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - pos_args, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_NICK, - nick); - } - if (pos_end_01) - pos_end_01[0] = '\01'; - if (pos) - pos[0] = ' '; - - weechat_hook_signal_send ("irc_ctcp", - WEECHAT_HOOK_SIGNAL_STRING, - argv_eol[0]); + irc_ctcp_recv (server, command, ptr_channel, + address, nick, NULL, pos_args, + argv_eol[0]); } - return WEECHAT_RC_OK; } @@ -1432,530 +1147,25 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, const char *command, } else { - /* version asked by another user => answer with WeeChat version */ - if (strncmp (pos_args, "\01VERSION", 8) == 0) - { - if (!irc_ignore_check (server, NULL, nick, host)) - { - irc_protocol_reply_version (server, NULL, nick, argv_eol[0], - pos_args); - } - - return WEECHAT_RC_OK; - } - - /* ping request from another user => answer */ - if (strncmp (pos_args, "\01PING", 5) == 0) - { - if (!irc_ignore_check (server, NULL, nick, host)) - { - pos_args += 5; - while (pos_args[0] == ' ') - { - pos_args++; - } - pos_end_01 = strrchr (pos_args, '\01'); - if (pos_end_01) - pos_end_01[0] = '\0'; - else - pos_args = NULL; - if (pos_args && !pos_args[0]) - pos_args = NULL; - if (pos_args) - irc_server_sendf (server, 0, "NOTICE %s :\01PING %s\01", - nick, pos_args); - else - irc_server_sendf (server, 0, "NOTICE %s :\01PING\01", - nick); - weechat_printf_tags (server->buffer, - irc_protocol_tags (command, "irc_ctcp"), - _("%sCTCP %sPING%s received from %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_NICK, - nick); - weechat_hook_signal_send ("irc_ctcp", - WEECHAT_HOOK_SIGNAL_STRING, - argv_eol[0]); - if (pos_end_01) - pos_end_01[0] = '\01'; - } - - return WEECHAT_RC_OK; - } - - /* incoming DCC file */ - if (strncmp (pos_args, "\01DCC SEND", 9) == 0) - { - if (!irc_ignore_check (server, NULL, nick, host)) - { - /* check if DCC SEND is ok, i.e. with 0x01 at end */ - pos_end_01 = strrchr (pos_args + 1, '\01'); - if (!pos_end_01) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - return WEECHAT_RC_ERROR; - } - - dcc_args = weechat_strndup (pos_args + 9, - pos_end_01 - pos_args - 9); - - if (!dcc_args) - { - weechat_printf (server->buffer, - _("%s%s: not enough memory for \"%s\" " - "command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - return WEECHAT_RC_ERROR; - } - - /* DCC filename */ - pos_file = dcc_args; - while (pos_file[0] == ' ') - { - pos_file++; - } - - /* look for file size */ - pos_size = strrchr (pos_file, ' '); - if (!pos_size) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos = pos_size; - pos_size++; - while (pos[0] == ' ') - { - pos--; - } - pos[1] = '\0'; - - /* look for DCC port */ - pos_port = strrchr (pos_file, ' '); - if (!pos_port) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos = pos_port; - pos_port++; - while (pos[0] == ' ') - { - pos--; - } - pos[1] = '\0'; - - /* look for DCC IP address */ - pos_addr = strrchr (pos_file, ' '); - if (!pos_addr) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos = pos_addr; - pos_addr++; - while (pos[0] == ' ') - { - pos--; - } - pos[1] = '\0'; - - /* add DCC file via xfer plugin */ - infolist = weechat_infolist_new (); - if (infolist) - { - item = weechat_infolist_new_item (infolist); - if (item) - { - weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name); - snprintf (plugin_id, sizeof (plugin_id), - "%lx", (long unsigned int)server); - weechat_infolist_new_var_string (item, "plugin_id", plugin_id); - weechat_infolist_new_var_string (item, "type", "file_recv"); - weechat_infolist_new_var_string (item, "protocol", "dcc"); - weechat_infolist_new_var_string (item, "remote_nick", nick); - weechat_infolist_new_var_string (item, "local_nick", server->nick); - weechat_infolist_new_var_string (item, "filename", pos_file); - weechat_infolist_new_var_string (item, "size", pos_size); - weechat_infolist_new_var_string (item, "proxy", - IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY)); - weechat_infolist_new_var_string (item, "address", pos_addr); - weechat_infolist_new_var_integer (item, "port", atoi (pos_port)); - weechat_hook_signal_send ("xfer_add", - WEECHAT_HOOK_SIGNAL_POINTER, - infolist); - } - weechat_infolist_free (infolist); - } - - weechat_hook_signal_send ("irc_dcc", - WEECHAT_HOOK_SIGNAL_STRING, - argv_eol[0]); - - free (dcc_args); - } - - return WEECHAT_RC_OK; - } - - /* incoming DCC RESUME (asked by receiver) */ - if (strncmp (pos_args, "\01DCC RESUME", 11) == 0) - { - if (!irc_ignore_check (server, NULL, nick, host)) - { - /* check if DCC RESUME is ok, i.e. with 0x01 at end */ - pos_end_01 = strrchr (pos_args + 1, '\01'); - if (!pos_end_01) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - return WEECHAT_RC_ERROR; - } - - dcc_args = weechat_strndup (pos_args + 11, - pos_end_01 - pos_args - 11); - - if (!dcc_args) - { - weechat_printf (server->buffer, - _("%s%s: not enough memory for \"%s\" " - "command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - return WEECHAT_RC_ERROR; - } - - /* DCC filename */ - pos_file = dcc_args; - while (pos_file[0] == ' ') - { - pos_file++; - } - - /* look for resume start position */ - pos_start_resume = strrchr (pos_file, ' '); - if (!pos_start_resume) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos = pos_start_resume; - pos_start_resume++; - while (pos[0] == ' ') - { - pos--; - } - pos[1] = '\0'; - - /* look for DCC port */ - pos_port = strrchr (pos_file, ' '); - if (!pos_port) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos = pos_port; - pos_port++; - while (pos[0] == ' ') - { - pos--; - } - pos[1] = '\0'; - - /* accept resume via xfer plugin */ - infolist = weechat_infolist_new (); - if (infolist) - { - item = weechat_infolist_new_item (infolist); - if (item) - { - weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name); - snprintf (plugin_id, sizeof (plugin_id), - "%lx", (long unsigned int)server); - weechat_infolist_new_var_string (item, "plugin_id", plugin_id); - weechat_infolist_new_var_string (item, "type", "file_recv"); - weechat_infolist_new_var_string (item, "filename", pos_file); - weechat_infolist_new_var_integer (item, "port", atoi (pos_port)); - weechat_infolist_new_var_string (item, "start_resume", pos_start_resume); - weechat_hook_signal_send ("xfer_accept_resume", - WEECHAT_HOOK_SIGNAL_POINTER, - infolist); - } - weechat_infolist_free (infolist); - } - - weechat_hook_signal_send ("irc_dcc", - WEECHAT_HOOK_SIGNAL_STRING, - argv_eol[0]); - - free (dcc_args); - } - - return WEECHAT_RC_OK; - } - - /* incoming DCC ACCEPT (resume accepted by sender) */ - if (strncmp (pos_args, "\01DCC ACCEPT", 11) == 0) - { - if (!irc_ignore_check (server, NULL, nick, host)) - { - /* check if DCC ACCEPT is ok, i.e. with 0x01 at end */ - pos_end_01 = strrchr (pos_args + 1, '\01'); - if (!pos_end_01) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); - return WEECHAT_RC_ERROR; - } - - dcc_args = weechat_strndup (pos_args + 11, - pos_end_01 - pos_args - 11); - - if (!dcc_args) - { - weechat_printf (server->buffer, - _("%s%s: not enough memory for \"%s\" " - "command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); - return WEECHAT_RC_ERROR; - } - - /* DCC filename */ - pos_file = dcc_args; - while (pos_file[0] == ' ') - { - pos_file++; - } - - /* look for resume start position */ - pos_start_resume = strrchr (pos_file, ' '); - if (!pos_start_resume) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos = pos_start_resume; - pos_start_resume++; - while (pos[0] == ' ') - { - pos--; - } - pos[1] = '\0'; - - /* look for DCC port */ - pos_port = strrchr (pos_file, ' '); - if (!pos_port) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos = pos_port; - pos_port++; - while (pos[0] == ' ') - { - pos--; - } - pos[1] = '\0'; - - /* resume file via xfer plugin */ - infolist = weechat_infolist_new (); - if (infolist) - { - item = weechat_infolist_new_item (infolist); - if (item) - { - weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name); - snprintf (plugin_id, sizeof (plugin_id), - "%lx", (long unsigned int)server); - weechat_infolist_new_var_string (item, "plugin_id", plugin_id); - weechat_infolist_new_var_string (item, "type", "file_recv"); - weechat_infolist_new_var_string (item, "filename", pos_file); - weechat_infolist_new_var_integer (item, "port", atoi (pos_port)); - weechat_infolist_new_var_string (item, "start_resume", pos_start_resume); - weechat_hook_signal_send ("xfer_start_resume", - WEECHAT_HOOK_SIGNAL_POINTER, - infolist); - } - weechat_infolist_free (infolist); - } - - weechat_hook_signal_send ("irc_dcc", - WEECHAT_HOOK_SIGNAL_STRING, - argv_eol[0]); - - free (dcc_args); - } - - return WEECHAT_RC_OK; - } - - /* incoming DCC CHAT */ - if (strncmp (pos_args, "\01DCC CHAT", 9) == 0) - { - if (!irc_ignore_check (server, NULL, nick, host)) - { - /* check if DCC CHAT is ok, i.e. with 0x01 at end */ - pos_end_01 = strrchr (pos_args + 1, '\01'); - if (!pos_end_01) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); - return WEECHAT_RC_ERROR; - } - - dcc_args = weechat_strndup (pos_args + 9, - pos_end_01 - pos_args - 9); - - if (!dcc_args) - { - weechat_printf (server->buffer, - _("%s%s: not enough memory for \"%s\" " - "command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); - return WEECHAT_RC_ERROR; - } - - /* CHAT type */ - pos_file = dcc_args; - while (pos_file[0] == ' ') - { - pos_file++; - } - - /* DCC IP address */ - pos_addr = strchr (pos_file, ' '); - if (!pos_addr) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos_addr[0] = '\0'; - pos_addr++; - while (pos_addr[0] == ' ') - { - pos_addr++; - } - - /* look for DCC port */ - pos_port = strchr (pos_addr, ' '); - if (!pos_port) - { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - pos_port[0] = '\0'; - pos_port++; - while (pos_port[0] == ' ') - { - pos_port++; - } - - if (weechat_strcasecmp (pos_file, "chat") != 0) - { - weechat_printf (server->buffer, - _("%s%s: unknown DCC CHAT type " - "received from %s%s%s: \"%s\""), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_NICK, - nick, - IRC_COLOR_CHAT, - pos_file); - free (dcc_args); - return WEECHAT_RC_ERROR; - } - - /* add DCC chat via xfer plugin */ - infolist = weechat_infolist_new (); - if (infolist) - { - item = weechat_infolist_new_item (infolist); - if (item) - { - weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name); - snprintf (plugin_id, sizeof (plugin_id), - "%lx", (long unsigned int)server); - weechat_infolist_new_var_string (item, "plugin_id", plugin_id); - weechat_infolist_new_var_string (item, "type", "chat_recv"); - weechat_infolist_new_var_string (item, "remote_nick", nick); - weechat_infolist_new_var_string (item, "local_nick", server->nick); - weechat_infolist_new_var_string (item, "proxy", - IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY)); - weechat_infolist_new_var_string (item, "address", pos_addr); - weechat_infolist_new_var_integer (item, "port", atoi (pos_port)); - weechat_hook_signal_send ("xfer_add", - WEECHAT_HOOK_SIGNAL_POINTER, - infolist); - } - weechat_infolist_free (infolist); - } - - weechat_hook_signal_send ("irc_dcc", - WEECHAT_HOOK_SIGNAL_STRING, - argv_eol[0]); - - free (dcc_args); - } - - return WEECHAT_RC_OK; - } - - /* private message received => display it */ - if (strcmp (server->nick, nick) == 0) remote_nick = argv[2]; else remote_nick = nick; + + /* CTCP to user */ + if ((pos_args[0] == '\01') + && (pos_args[strlen (pos_args) - 1] == '\01')) + { + if (!irc_ignore_check (server, NULL, nick, host)) + { + irc_ctcp_recv (server, command, NULL, + address, nick, remote_nick, pos_args, + argv_eol[0]); + } + return WEECHAT_RC_OK; + } + + /* private message received => display it */ nick_is_me = (strcmp (server->nick, nick) == 0); ptr_channel = irc_channel_search (server, remote_nick); diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 8f5e6c60d..db34f20c9 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -295,6 +295,14 @@ plugin_api_info_get_internal (void *data, const char *info_name, { return LOCALEDIR; } + else if (string_strcasecmp (info_name, "weechat_site") == 0) + { + return WEECHAT_WEBSITE; + } + else if (string_strcasecmp (info_name, "weechat_site_download") == 0) + { + return WEECHAT_WEBSITE_DOWNLOAD; + } else if (string_strcasecmp (info_name, "charset_terminal") == 0) { return weechat_local_charset; @@ -924,6 +932,10 @@ plugin_api_init () &plugin_api_info_get_internal, NULL); hook_info (NULL, "weechat_localedir", N_("WeeChat \"locale\" directory"), &plugin_api_info_get_internal, NULL); + hook_info (NULL, "weechat_site", N_("WeeChat site"), + &plugin_api_info_get_internal, NULL); + hook_info (NULL, "weechat_site_download", N_("WeeChat site, download page"), + &plugin_api_info_get_internal, NULL); hook_info (NULL, "charset_terminal", N_("terminal charset"), &plugin_api_info_get_internal, NULL); hook_info (NULL, "charset_internal", N_("WeeChat internal charset"),