changeset 18435:1bb77e24cced

merge of '6521407fd5a6d9175e6532a874a2735658c113e9' and 'ba88a6b875fc14033652fe01e39b92c155521ecb'
author Ka-Hing Cheung <khc@hxbc.us>
date Thu, 05 Jul 2007 02:39:54 +0000
parents 2bf8792760fe (current diff) cbec54ecd9ab (diff)
children 3f964a7e27e2 02d93d5adca9
files ChangeLog pidgin/gtkblist.c pidgin/gtkdocklet.c
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jul 05 00:56:26 2007 +0000
+++ b/ChangeLog	Thu Jul 05 02:39:54 2007 +0000
@@ -22,6 +22,7 @@
 	* A new status area has been added to the top of conversations to
 	  provide additional detail about the buddy, including buddy icon,
 	  protocol and status message.
+	* Show idle times in the buddy list as days, hours, seconds
 
 	Finch:
 	* There's support for workspaces now (details in the manpage)
--- a/pidgin/gtkblist.c	Thu Jul 05 00:56:26 2007 +0000
+++ b/pidgin/gtkblist.c	Thu Jul 05 02:39:54 2007 +0000
@@ -3417,13 +3417,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);