pidgin.mxit: f6e1d957: * show a contact's status message when ...

pieter.loubser at mxit.com pieter.loubser at mxit.com
Thu May 5 03:41:54 EDT 2011


----------------------------------------------------------------------
Revision: f6e1d9574fc2a18944c8b9977aa15586a06728e8
Parent:   8b579559174d8853ab2218dac2e81e3ba5baead2
Author:   pieter.loubser at mxit.com
Date:     05/05/11 03:34:24
Branch:   im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/f6e1d9574fc2a18944c8b9977aa15586a06728e8

Changelog: 

 * show a contact's status message when his offline (with get-info)


Changes against parent 8b579559174d8853ab2218dac2e81e3ba5baead2

  patched  libpurple/protocols/mxit/protocol.c
  patched  libpurple/protocols/mxit/roster.c

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/protocol.c	347af3cd9a06f1cf0397e595d7a31b21701559fb
+++ libpurple/protocols/mxit/protocol.c	d3f7d30a82413ff8ea5e2eb02bcb1b6896f0f3aa
@@ -1907,6 +1907,23 @@ static void mxit_parse_cmd_extprofile( s
 			/* 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 @@ static void mxit_parse_cmd_media( struct
 					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 {
============================================================
--- libpurple/protocols/mxit/roster.c	b712ffe3f7907a08f0c85b1d1009d283b4fdaee8
+++ libpurple/protocols/mxit/roster.c	6baf6cd6d3e027c9a0c78650f14ee2a23309cdad
@@ -474,7 +474,7 @@ void mxit_update_buddy_presence( struct 
 	contact->capabilities = flags;
 
 	/* validate mood */
-	if (( contact->mood < MXIT_MOOD_NONE ) || ( contact->mood > MXIT_MOOD_STRESSED ))
+	if ( ( contact->mood < MXIT_MOOD_NONE ) || ( contact->mood > MXIT_MOOD_STRESSED ) )
 		contact->mood = MXIT_MOOD_NONE;
 
 	g_strlcpy( contact->customMood, customMood, sizeof( contact->customMood ) );
@@ -485,7 +485,7 @@ void mxit_update_buddy_presence( struct 
 		g_free( contact->statusMsg );
 		contact->statusMsg = NULL;
 	}
-	if ( statusMsg[0] != '\0' )
+	if ( ( statusMsg ) && ( statusMsg[0] != '\0' ) )
 		contact->statusMsg = g_markup_escape_text( statusMsg, -1 );
 
 	/* update the buddy's status (reference: "libpurple/prpl.h") */


More information about the Commits mailing list