From 832a089d3d60c9de73dbc669aeea4c5044d5a3bf Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 26 Aug 2011 13:23:56 +0200 Subject: [PATCH] irc: add "count" in hashtable returned by "irc_message_split" --- doc/de/autogen/plugin_api/infos_hashtable.txt | 2 +- doc/en/autogen/plugin_api/infos_hashtable.txt | 2 +- doc/fr/autogen/plugin_api/infos_hashtable.txt | 2 +- doc/it/autogen/plugin_api/infos_hashtable.txt | 2 +- po/cs.po | 4 ++-- po/de.po | 4 ++-- po/es.po | 4 ++-- po/fr.po | 9 +++++---- po/hu.po | 4 ++-- po/it.po | 4 ++-- po/pl.po | 4 ++-- po/pt_BR.po | 4 ++-- po/ru.po | 4 ++-- po/weechat.pot | 4 ++-- src/plugins/irc/irc-info.c | 4 +++- src/plugins/irc/irc-message.c | 6 ++++-- 16 files changed, 34 insertions(+), 29 deletions(-) diff --git a/doc/de/autogen/plugin_api/infos_hashtable.txt b/doc/de/autogen/plugin_api/infos_hashtable.txt index 36558d19c..9f89ea41f 100644 --- a/doc/de/autogen/plugin_api/infos_hashtable.txt +++ b/doc/de/autogen/plugin_api/infos_hashtable.txt @@ -4,6 +4,6 @@ | irc | irc_message_parse | Parse eine IRC Nachricht | "message": IRC Nachricht | "nick": nick, "host": host, "command": command, "channel": channel, "arguments": arguments (beinhaltet Channel) -| irc | irc_message_split | split an IRC message (to fit in 512 bytes) | "message": IRC message, "server": server name (optional) | "msg1" ... "msgN": messages to send (without final "\r\n"), "args1" ... "argsN": arguments of messages +| irc | irc_message_split | split an IRC message (to fit in 512 bytes) | "message": IRC message, "server": server name (optional) | "msg1" ... "msgN": messages to send (without final "\r\n"), "args1" ... "argsN": arguments of messages, "count": number of messages |======================================== diff --git a/doc/en/autogen/plugin_api/infos_hashtable.txt b/doc/en/autogen/plugin_api/infos_hashtable.txt index 238ef591c..c9b45f565 100644 --- a/doc/en/autogen/plugin_api/infos_hashtable.txt +++ b/doc/en/autogen/plugin_api/infos_hashtable.txt @@ -4,6 +4,6 @@ | irc | irc_message_parse | parse an IRC message | "message": IRC message | "nick": nick, "host": host, "command": command, "channel": channel, "arguments": arguments (includes channel) -| irc | irc_message_split | split an IRC message (to fit in 512 bytes) | "message": IRC message, "server": server name (optional) | "msg1" ... "msgN": messages to send (without final "\r\n"), "args1" ... "argsN": arguments of messages +| irc | irc_message_split | split an IRC message (to fit in 512 bytes) | "message": IRC message, "server": server name (optional) | "msg1" ... "msgN": messages to send (without final "\r\n"), "args1" ... "argsN": arguments of messages, "count": number of messages |======================================== diff --git a/doc/fr/autogen/plugin_api/infos_hashtable.txt b/doc/fr/autogen/plugin_api/infos_hashtable.txt index 80eed3c36..b4d162a09 100644 --- a/doc/fr/autogen/plugin_api/infos_hashtable.txt +++ b/doc/fr/autogen/plugin_api/infos_hashtable.txt @@ -4,6 +4,6 @@ | irc | irc_message_parse | analyse un message IRC | "message": message IRC | "nick": pseudo, "host": nom d'hôte, "command": commande, "channel": canal, "arguments": paramètres (inclut le canal) -| irc | irc_message_split | découper un message IRC (pour tenir dans les 512 octets) | "message": message IRC, "server": nom du serveur (optionnel) | "msg1" ... "msgN": messages à envoyer (sans le "\r\n" final), "args1" ... "argsN": paramètres des messages +| irc | irc_message_split | découper un message IRC (pour tenir dans les 512 octets) | "message": message IRC, "server": nom du serveur (optionnel) | "msg1" ... "msgN": messages à envoyer (sans le "\r\n" final), "args1" ... "argsN": paramètres des messages, "count": nombre de messages |======================================== diff --git a/doc/it/autogen/plugin_api/infos_hashtable.txt b/doc/it/autogen/plugin_api/infos_hashtable.txt index ae7682f39..c82f2b917 100644 --- a/doc/it/autogen/plugin_api/infos_hashtable.txt +++ b/doc/it/autogen/plugin_api/infos_hashtable.txt @@ -4,6 +4,6 @@ | irc | irc_message_parse | controlla un messaggio IRC | "messaggio": messaggio IRC | "nick": nick, "host": nome host, "command": comando, "channel": canale, "arguments": argomenti (include il canale) -| irc | irc_message_split | split an IRC message (to fit in 512 bytes) | "message": IRC message, "server": server name (optional) | "msg1" ... "msgN": messages to send (without final "\r\n"), "args1" ... "argsN": arguments of messages +| irc | irc_message_split | split an IRC message (to fit in 512 bytes) | "message": IRC message, "server": server name (optional) | "msg1" ... "msgN": messages to send (without final "\r\n"), "args1" ... "argsN": arguments of messages, "count": number of messages |======================================== diff --git a/po/cs.po b/po/cs.po index 66acb3137..ec209e6cb 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: 2011-07-05 15:37+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -5752,7 +5752,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" msgid "list of IRC servers" diff --git a/po/de.po b/po/de.po index fb77aa3f5..53dedc119 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: 2011-08-15 10:10+0100\n" "Last-Translator: Nils Görs\n" "Language-Team: weechat-dev \n" @@ -6109,7 +6109,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" msgid "list of IRC servers" diff --git a/po/es.po b/po/es.po index dda5fbe87..ed791d42b 100644 --- a/po/es.po +++ b/po/es.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: 2011-07-05 15:37+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -5849,7 +5849,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" msgid "list of IRC servers" diff --git a/po/fr.po b/po/fr.po index b58494c6e..de3a205eb 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" -"PO-Revision-Date: 2011-08-26 10:08+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" +"PO-Revision-Date: 2011-08-26 13:17+0200\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -5971,10 +5971,11 @@ msgstr "\"message\": message IRC, \"server\": nom du serveur (optionnel)" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" "\"msg1\" ... \"msgN\": messages à envoyer (sans le \"\\r\\n\" final), " -"\"args1\" ... \"argsN\": paramètres des messages" +"\"args1\" ... \"argsN\": paramètres des messages, \"count\": nombre de " +"messages" msgid "list of IRC servers" msgstr "liste des serveurs IRC" diff --git a/po/hu.po b/po/hu.po index 6af39313a..5543189fa 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: 2011-05-15 10:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -5355,7 +5355,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" #, fuzzy diff --git a/po/it.po b/po/it.po index 9221b26e9..5bcb9682c 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: 2011-08-16 17:48+0200\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -5925,7 +5925,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" msgid "list of IRC servers" diff --git a/po/pl.po b/po/pl.po index 54668df64..a5ad84950 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: 2011-07-05 15:38+0200\n" "Last-Translator: Krzysztof Koroscik \n" "Language-Team: weechat-dev \n" @@ -5806,7 +5806,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" msgid "list of IRC servers" diff --git a/po/pt_BR.po b/po/pt_BR.po index afb3d37b8..d8f17af99 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: 2011-05-15 10:52+0200\n" "Last-Translator: Ivan Sichmann Freitas \n" "Language-Team: weechat-dev \n" @@ -5236,7 +5236,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" msgid "list of IRC servers" diff --git a/po/ru.po b/po/ru.po index b0e28429e..a8ec97e0d 100644 --- a/po/ru.po +++ b/po/ru.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: 2011-05-15 10:52+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -5370,7 +5370,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" #, fuzzy diff --git a/po/weechat.pot b/po/weechat.pot index ad4986d30..71359158d 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: 2011-08-26 10:17+0200\n" +"POT-Creation-Date: 2011-08-26 13:17+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -4607,7 +4607,7 @@ msgstr "" #. TRANSLATORS: please do not translate key names (enclosed by quotes) msgid "" "\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " -"\"args1\" ... \"argsN\": arguments of messages" +"\"args1\" ... \"argsN\": arguments of messages, \"count\": number of messages" msgstr "" msgid "list of IRC servers" diff --git a/src/plugins/irc/irc-info.c b/src/plugins/irc/irc-info.c index 0cad62129..262b9f3b8 100644 --- a/src/plugins/irc/irc-info.c +++ b/src/plugins/irc/irc-info.c @@ -618,7 +618,9 @@ irc_info_init () /* TRANSLATORS: please do not translate key names (enclosed by quotes) */ N_("\"msg1\" ... \"msgN\": messages to send " "(without final \"\\r\\n\"), " - "\"args1\" ... \"argsN\": arguments of messages"), + "\"args1\" ... \"argsN\": arguments of " + "messages, " + "\"count\": number of messages"), &irc_info_get_info_hashtable_cb, NULL); /* infolist hooks */ diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index cc6586ba0..4a1ba8cd3 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -347,8 +347,8 @@ void irc_message_split_add (struct t_hashtable *hashtable, int number, const char *message, const char *arguments) { - char key[32]; - + char key[32], value[32]; + if (message) { snprintf (key, sizeof (key), "msg%d", number); @@ -372,6 +372,8 @@ irc_message_split_add (struct t_hashtable *hashtable, int number, key, arguments); } } + snprintf (value, sizeof (value), "%d", number); + weechat_hashtable_set (hashtable, "count", value); } /*