changeset 31639:5643110e51db

Since we now have a calculateAge() function we might aswell also show the buddy's age when viewing their profile information.
author andrew.victor@mxit.com
date Sun, 15 May 2011 20:37:43 +0000
parents 055a33b6bf59
children 5b51e5fb8d76
files libpurple/protocols/mxit/profile.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/profile.c	Sun May 15 20:27:51 2011 +0000
+++ b/libpurple/protocols/mxit/profile.c	Sun May 15 20:37:43 2011 +0000
@@ -166,6 +166,7 @@
 	PurpleNotifyUserInfo*	info		= purple_notify_user_info_new();
 	struct contact*			contact		= NULL;
 	PurpleBuddy*			buddy;
+	gchar*					tmp			= NULL;
 
 	buddy = purple_find_buddy( session->acc, username );
 	if ( buddy ) {
@@ -175,7 +176,11 @@
 	}
 
 	purple_notify_user_info_add_pair( info, _( "Display Name" ), profile->nickname );
-	purple_notify_user_info_add_pair( info, _( "Birthday" ), profile->birthday );
+
+	tmp = g_strdup_printf("%s (%i)", profile->birthday, calculateAge( profile->birthday ) );
+	purple_notify_user_info_add_pair( info, _( "Birthday" ), tmp );
+	g_free( tmp );
+
 	purple_notify_user_info_add_pair( info, _( "Gender" ), profile->male ? _( "Male" ) : _( "Female" ) );
 
 	/* optional information */