diff console/gntblist.c @ 14065:8ef994bacf3d

[gaim-migrate @ 16686] Add preference to show idletime in the 'tooltip' for the buddylist. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 10 Aug 2006 15:44:43 +0000
parents fec4fadf30c9
children eaf7f35635bc
line wrap: on
line diff
--- a/console/gntblist.c	Wed Aug 09 18:19:12 2006 +0000
+++ b/console/gntblist.c	Thu Aug 10 15:44:43 2006 +0000
@@ -813,6 +813,18 @@
 			g_free(br);
 		}
 
+		if (gaim_prefs_get_bool("/gaim/gnt/blist/idletime"))
+		{
+			GaimPresence *pre = gaim_buddy_get_presence(buddy);
+			if (gaim_presence_is_idle(pre))
+			{
+				time_t idle = gaim_presence_get_idle_time(pre);
+				char *st = gaim_str_seconds_to_string(time(NULL) - idle);
+				g_string_append_printf(str, _("\nIdle: %s"), st);
+				g_free(st);
+			}
+		}
+
 		title = g_strdup(gaim_buddy_get_name(buddy));
 	}
 	else if (GAIM_BLIST_NODE_IS_GROUP(node))