changeset 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 98c1375232e2
children 1bb77e24cced
files ChangeLog pidgin/gtkblist.c
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jun 23 03:08:06 2007 +0000
+++ b/ChangeLog	Thu Jul 05 02:35:50 2007 +0000
@@ -17,6 +17,7 @@
 	  directory.  The net effect of this is that trying to start Pidgin a
 	  second time will raise the buddy list.  (Gabriel Schulhof)
 	* Undo capability in the conversation window
+	* Show idle times in the buddy list as days, hours, seconds
 
 version 2.0.2 (06/14/2007):
 	Pidgin:
--- 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);