cpw.malu.xmpp.idle: ccada491: Show idle time for idle resources in bud...

malu at pidgin.im malu at pidgin.im
Wed Dec 17 14:25:49 EST 2008


-----------------------------------------------------------------
Revision: ccada4912f921963836193c7e7d44cddad52cac4
Ancestor: c8e38df6f870bd5d6b82077ffd1f9723ee23b178
Author: malu at pidgin.im
Date: 2008-12-17T19:20:50
Branch: im.pidgin.cpw.malu.xmpp.idle
URL: http://d.pidgin.im/viewmtn/revision/info/ccada4912f921963836193c7e7d44cddad52cac4

Modified files:
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

Show idle time for idle resources in buddy tooltips

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	04593de09994691b7c1e832479d9288c3cbfa59c
+++ libpurple/protocols/jabber/jabber.c	2a86a1ee0565c49990fbb5c2c929b4dcf4591b23
@@ -1640,10 +1640,21 @@ void jabber_tooltip_text(PurpleBuddy *b,
 							(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);
 		}
 


More information about the Commits mailing list