diff libpurple/protocols/mxit/protocol.c @ 30003:08cae68b25dc

Save the user's MXitId received in the login-response packet to the Session. Display the MXitId (read-only) in the profile information.
author andrew.victor@mxit.com
date Thu, 20 May 2010 11:21:30 +0000
parents 30d0d4756fac
children cbae3d450db8
line wrap: on
line diff
--- a/libpurple/protocols/mxit/protocol.c	Thu May 20 09:29:46 2010 +0000
+++ b/libpurple/protocols/mxit/protocol.c	Thu May 20 11:21:30 2010 +0000
@@ -1302,6 +1302,10 @@
 		session->http_sesid = atoi( records[0]->fields[0]->data );
 	}
 
+	/* extract MXitId (from protocol 5.9) */
+	if ( records[1]->fcount >= 9 )
+		session->mxitId = g_strdup( records[1]->fields[8]->data );
+
 	/* display the current splash-screen */
 	if ( splash_popup_enabled( session ) )
 		splash_display( session );
@@ -2483,6 +2487,8 @@
 	mxit_free_emoticon_cache( session );
 
 	/* free allocated memory */
+	if ( session->mxitId )
+		g_free( session->mxitId );
 	g_free( session->encpwd );
 	session->encpwd = NULL;