Mercurial > pidgin.yaz
diff pidgin/gtkblist.c @ 18234:cbec54ecd9ab
Show idle times in the buddy list as days, hours, seconds. Patch from
Andrew Gaul.
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Thu, 05 Jul 2007 02:35:50 +0000 |
parents | e3a4ed0febd2 |
children | 1bb77e24cced |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Sat Jun 23 03:08:06 2007 +0000 +++ b/pidgin/gtkblist.c Thu Jul 05 02:35:50 2007 +0000 @@ -3380,13 +3380,16 @@ time_t idle_secs = purple_presence_get_idle_time(presence); if (idle_secs > 0) { - int ihrs, imin; + int iday, ihrs, imin; time(&t); - ihrs = (t - idle_secs) / 3600; + iday = (t - idle_secs) / (24 * 60 * 60); + ihrs = ((t - idle_secs) / 60 / 60) % 24; imin = ((t - idle_secs) / 60) % 60; - if (ihrs) + if (iday) + idletime = g_strdup_printf(_("Idle %dd %dh %02dm"), iday, ihrs, imin); + else if (ihrs) idletime = g_strdup_printf(_("Idle %dh %02dm"), ihrs, imin); else idletime = g_strdup_printf(_("Idle %dm"), imin);