libpurple/protocols/mxit/profile.c

branch
mxit-2.x.y
changeset 32088
4c1b703def6f
parent 31866
5d3065054efd
child 33202
f698fa20ea34
child 33603
5bf94c596f83
--- a/libpurple/protocols/mxit/profile.c	Sat Feb 18 23:28:43 2012 +0000
+++ b/libpurple/protocols/mxit/profile.c	Tue Feb 21 21:18:50 2012 +0000
@@ -35,6 +35,40 @@
 
 
 /*------------------------------------------------------------------------
+ * Return the MXit Relationship status as a string.
+ *
+ * @param id		The Relationship status value (see profile.h)
+ * @return			The relationship status as a text string.
+ */
+const char* mxit_relationship_to_name( short id )
+{
+	switch ( id ) {
+		case MXIT_RELATIONSHIP_UNKNOWN :
+			return _( "Unknown" );
+		case MXIT_RELATIONSHIP_DONTSAY :
+			return _( "Don't want to say" );
+		case MXIT_RELATIONSHIP_SINGLE :
+			return _( "Single" );
+		case MXIT_RELATIONSHIP_INVOLVED :
+			return _( "In a relationship" );
+		case MXIT_RELATIONSHIP_ENGAGED :
+			return _( "Engaged" );
+		case MXIT_RELATIONSHIP_MARRIED :
+			return _( "Married" );
+		case MXIT_RELATIONSHIP_COMPLICATED :
+			return _( "It's complicated" );
+		case MXIT_RELATIONSHIP_WIDOWED :
+			return _( "Widowed" );
+		case MXIT_RELATIONSHIP_SEPARATED :
+			return _( "Separated" );
+		case MXIT_RELATIONSHIP_DIVORCED :
+			return _( "Divorced" );
+		default :
+			return "";
+	}
+}
+
+/*------------------------------------------------------------------------
  * Returns true if it is a valid date.
  *
  * @param bday		Date-of-Birth string (YYYY-MM-DD)
@@ -193,6 +227,8 @@
 	if ( strlen( profile->whereami ) > 0 )
 		purple_notify_user_info_add_pair( info, _( "Where I Live" ), profile->whereami );
 
+	purple_notify_user_info_add_pair_plaintext( info, _( "Relationship Status" ), mxit_relationship_to_name( profile->relationship ) );
+
 	purple_notify_user_info_add_section_break( info );
 
 	if ( contact ) {

mercurial