From:
[email protected]
On Sun, Aug 15, 2004 at 11:21:51AM +0100, David Pashley wrote:
On Aug 14, 2004 at 22:25, Jan Minar praised the llamas by saying:
What English is this?:
21:06 -!- idle : 1 day*s* 1 hour*s* 1 min*s* 1 sec*s*
I wonder when people start realizing that these things are to be coded
like this:
printf("%d day%s", days, days == 1 ? "" : "s");
(Cf. the gettext manual for explanation of how to combine this and
l10n.)
Jan.
This string is returned by the ircd and is not a bug in irssi.
Wrong.
http://www.faqs.org/rfcs/rfc2812.html
This document describes the idle response format:
RFC2812> 317 RPL_WHOISIDLE
RFC2812> "<nick> <integer> :seconds idle"
Let's look at how the response looks on-the-wire:
% tcpdump -w irc.dump -s0 host irc.freenode.org &>/dev/null &
% { strings | grep version | head -n1; } < irc.tcpdump
:zelazny.freenode.net 002 rdancer_ :Your host is zelazny.freenode.net[zelazny.freenode.net/6667], running version dancer-ircd-1.0.35
% { strings | grep idle; } < irc.tcpdump
:zelazny.freenode.net 317 rdancer_ rdancer 24221 1092500500 :seconds idle, signon time
:zelazny.freenode.net 317 rdancer_ rdancer_ 28 1092579371 :seconds idle, signon time
:zelazny.freenode.net 317 rdancer_ rdancer_ 28 1092579371 :seconds idle, signon time
:zelazny.freenode.net 317 rdancer_ rdancer_ 40 1092579371 :seconds idle, signon time
:zelazny.freenode.net 317 rdancer_ rdancer_ 60 1092579371 :seconds idle, signon time
:zelazny.freenode.net 317 rdancer_ rdancer_ 66 1092579371 :seconds idle, signon time
It wasn't the easiest task I ever undertook, but here are the gullible
format strings (note that there are other occasions when the plural form
is incorrectly used, not only the idle info):
% grep secs /home/jan/chr/code/irssi-text-0.8.9/src/fe-common/irc/module-formats.c
{ "banlist_long", "$0 - {channel $1}: ban {ban $2} {comment by {nick $3}, $4 secs ago}", 5, { 1, 0, 0, 0, 1 } },
{ "ebanlist_long", "{channel $0}: ban exception {ban $1} {comment by {nick $2}, $3 secs ago}", 4, { 0, 0, 0, 1 } },
{ "channel_synced", "Join to {channel $0} was synced in {hilight $1} secs", 2, { 0, 2 } },
{ "whois_idle", "{whois idle %|$1 days $2 hours $3 mins $4 secs}", 5, { 0, 1, 1, 1, 1 } },
{ "whois_idle_signon", "{whois idle %|$1 days $2 hours $3 mins $4 secs {comment signon: $5}}", 6, { 0, 1, 1, 1, 1, 0 } },
I have no idea what language they are written in, or they would have been
fixed by now.
Cheers,
Jan.
--
"To me, clowns aren't funny. In fact, they're kind of scary. I've wondered
where this started and I think it goes back to the time I went to the circus,
and a clown killed my dad."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see
http://www.gnupg.org
iD8DBQFBH5ad+uczK20Fa5cRAhdOAJ4vY2xlqZBJSlFuG+zHL2lIDfZdBACeIG1E vb4b9tAh0tBArYr+K95VbpI=
=trlL
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: you cannot sedate... all the things you hate (1:229/2)