summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-08-16 11:37:43 +0200
committerSébastien Helleu <flashcode@flashtux.org>2014-08-16 11:37:43 +0200
commitab8ea0f3cbbc081cb2160e94b4129e15e2e6cd5b (patch)
tree61d70acfb468b079ffa998f1dfe93fd7fc3862be /src
parente6ed4342a2624040282e7bdb93e79124b137f0bd (diff)
downloadweechat-ab8ea0f3cbbc081cb2160e94b4129e15e2e6cd5b.zip
irc: fix translation of CTCP PING reply (closes #137)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-ctcp.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c
index 510d07633..4a2d298fb 100644
--- a/src/plugins/irc/irc-ctcp.c
+++ b/src/plugins/irc/irc-ctcp.c
@@ -155,6 +155,7 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date,
char *pos_end, *pos_space, *pos_args, *pos_usec;
struct timeval tv;
long sec1, usec1, sec2, usec2, difftime;
+ float seconds;
while (arguments && arguments[0])
{
@@ -186,30 +187,22 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date,
difftime = ((sec2 * 1000000) + usec2) -
((sec1 * 1000000) + usec1);
- weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server,
- nick,
- NULL,
- "ctcp",
- NULL),
- date,
- irc_protocol_tags (command,
- "irc_ctcp",
- NULL, NULL),
- _("%sCTCP reply from %s%s%s: %s%s%s "
- "%ld.%ld %s"),
- weechat_prefix ("network"),
- irc_nick_color_for_message (server,
- NULL,
- nick),
- nick,
- IRC_COLOR_RESET,
- IRC_COLOR_CHAT_CHANNEL,
- arguments + 1,
- IRC_COLOR_RESET,
- difftime / 1000000,
- (difftime % 1000000) / 1000,
- (NG_("second", "seconds",
- (difftime / 1000000))));
+ seconds = (float)difftime / 1000000.0;
+ weechat_printf_date_tags (
+ irc_msgbuffer_get_target_buffer (server, nick, NULL,
+ "ctcp", NULL),
+ date,
+ irc_protocol_tags (command, "irc_ctcp", NULL, NULL),
+ /* TRANSLATORS: %.3fs is a float number + "s" ("seconds") */
+ _("%sCTCP reply from %s%s%s: %s%s%s %.3fs"),
+ weechat_prefix ("network"),
+ irc_nick_color_for_message (server, NULL, nick),
+ nick,
+ IRC_COLOR_RESET,
+ IRC_COLOR_CHAT_CHANNEL,
+ arguments + 1,
+ IRC_COLOR_RESET,
+ seconds);
pos_usec[0] = ' ';
}