diff libpurple/protocols/mxit/protocol.c @ 30718:c2b3bfb2fe35

When setting an Avatar image via the Gallery bot, the MXit server pushes a Get Extended Profile response to inform the client. The MXitId field in that packet happens to be set to the user's MXitid and not empty so the libpurple plugin assumes it was a request for a buddies profile information so a profile popup is displayed. We now check if the MXitId field is empty or if it matches the user's MxitId (returned in the Login reponse).
author andrew.victor@mxit.com
date Mon, 19 Jul 2010 08:56:03 +0000
parents 08d9cdac2b3c
children d9e94339ca3b
line wrap: on
line diff
--- a/libpurple/protocols/mxit/protocol.c	Mon Jul 19 08:39:45 2010 +0000
+++ b/libpurple/protocols/mxit/protocol.c	Mon Jul 19 08:56:03 2010 +0000
@@ -1592,8 +1592,8 @@
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_parse_cmd_extprofile: profile for '%s'\n", mxitId );
 
-	if ( records[0]->fields[0]->len == 0 ) {
-		/* no MXitId provided, so this must be our own profile information */
+	if ( ( records[0]->fields[0]->len == 0 ) || ( session->uid && ( strcmp( session->uid, records[0]->fields[0]->data ) == 0 ) ) ) {
+		/* No UserId or Our UserId provided, so this must be our own profile information */
 		if ( session->profile == NULL )
 			session->profile = g_new0( struct MXitProfile, 1 );
 		profile = session->profile;