diff libpurple/protocols/mxit/protocol.c @ 32081:36a569ed9cdb

* show a contact's status message when his offline (with get-info)
author pieter.loubser@mxit.com
date Thu, 05 May 2011 07:34:24 +0000
parents c5bdf87770df
children 45d3df336659
line wrap: on
line diff
--- a/libpurple/protocols/mxit/protocol.c	Tue May 03 20:29:59 2011 +0000
+++ b/libpurple/protocols/mxit/protocol.c	Thu May 05 07:34:24 2011 +0000
@@ -1907,6 +1907,23 @@
 			/* this is a contact */
 			if ( avatarId )
 				mxit_update_buddy_avatar( session, mxitId, avatarId );
+
+			if ( ( statusMsg ) && ( strlen( statusMsg ) > 0 ) ) {
+				/* update the status message */
+				PurpleBuddy*		buddy	= NULL;
+
+				buddy = purple_find_buddy( session->acc, mxitId );
+				if ( buddy ) {
+					contact = purple_buddy_get_protocol_data( buddy );
+					if ( contact ) {
+						if ( contact->statusMsg )
+							g_free( contact->statusMsg );
+						contact->statusMsg = strdup( statusMsg );
+					}
+				}
+			}
+
+			/* show the profile */
 			mxit_show_profile( session, mxitId, profile );
 			g_free( profile );
 		}
@@ -2099,6 +2116,7 @@
 					if ( contact ) {
 						/* this is an invite (add image to the internal image store) */
 						contact->imgid = purple_imgstore_add_with_id( chunk.data, chunk.length, NULL );
+						/* show the profile */
 						mxit_show_profile( session, chunk.mxitid, contact->profile );
 					}
 					else {