diff libpurple/protocols/mxit/protocol.c @ 30286:08d9cdac2b3c

A few changes to the Profile. For the user's profile we now also request the 'flags' attribute. The DoB-Locked flag indicates if the user is allowed to change their date-of-birth. If it it locked, make the DoB field read-only. For your buddies profile, request the 'lastseen' attribute. For offline contacts we now show on the profile page when last they were online.
author andrew.victor@mxit.com
date Mon, 19 Jul 2010 08:39:45 +0000
parents b6b0c80f9dde
children c2b3bfb2fe35
line wrap: on
line diff
--- a/libpurple/protocols/mxit/protocol.c	Fri Jul 16 12:15:28 2010 +0000
+++ b/libpurple/protocols/mxit/protocol.c	Mon Jul 19 08:39:45 2010 +0000
@@ -1284,7 +1284,7 @@
 	const char*		statusmsg;
 	const char*		profilelist[] = { CP_PROFILE_BIRTHDATE, CP_PROFILE_GENDER, CP_PROFILE_HIDENUMBER, CP_PROFILE_FULLNAME,
 									CP_PROFILE_TITLE, CP_PROFILE_FIRSTNAME, CP_PROFILE_LASTNAME, CP_PROFILE_EMAIL,
-									CP_PROFILE_MOBILENR };
+									CP_PROFILE_MOBILENR, CP_PROFILE_FLAGS };
 
 	purple_account_set_int( session->acc, MXIT_CONFIG_STATE, MXIT_STATE_LOGIN );
 
@@ -1670,6 +1670,14 @@
 			/* registered country */
 			g_strlcpy( profile->regcountry, fvalue, sizeof( profile->regcountry ) );
 		}
+		else if ( strcmp( CP_PROFILE_FLAGS, fname ) == 0 ) {
+			/* profile flags */
+			profile->flags = strtoll( fvalue, NULL, 10 );
+		}
+		else if ( strcmp( CP_PROFILE_LASTSEEN, fname ) == 0 ) {
+			/* last seen online */
+			profile->lastonline = strtoll( fvalue, NULL, 10 );
+		}
 		else {
 			/* invalid profile attribute */
 			purple_debug_error( MXIT_PLUGIN_ID, "Invalid profile attribute received '%s' \n", fname );