changeset 25806:7990b63b486d

Show idle time for idle resources in buddy tooltips
author Marcus Lundblad <ml@update.uu.se>
date Wed, 17 Dec 2008 19:20:50 +0000
parents 6fed1bb3b02e
children d7aa837c2130
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Wed Dec 17 18:23:36 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Wed Dec 17 19:20:50 2008 +0000
@@ -1640,10 +1640,21 @@
 							(text ? text : ""));
 
 			purple_notify_user_info_add_pair(user_info, label, value);
-
 			g_free(label);
 			g_free(value);
 			g_free(text);
+			
+			/* if the resource is idle, show that */
+			if (jbr->idle) {
+				gchar *idle_str = 
+					purple_str_seconds_to_string(time(NULL) - jbr->idle);
+				label = g_strdup_printf("%s%s",
+					_("Idle"), (res ? res : ""));
+				purple_notify_user_info_add_pair(user_info, label, idle_str);
+				g_free(idle_str);
+				g_free(label);
+			}
+			
 			g_free(res);
 		}