changeset 30309:16a1a66138c6

propagate from branch 'im.pidgin.pidgin' (head 9d595f880c678cec5d1337783f6c0c2b0ac53677) to branch 'im.pidgin.pidgin.mxit' (head dff0a9294df6250976f90685b3229fb816d3f8c5)
author andrew.victor@mxit.com
date Wed, 28 Jul 2010 12:51:44 +0000
parents 65b97f3cdd01 (current diff) b803b8a45dab (diff)
children 2cd016bb8e1e
files
diffstat 9 files changed, 51 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/actions.c	Tue Jul 27 15:10:30 2010 +0000
+++ b/libpurple/protocols/mxit/actions.c	Wed Jul 28 12:51:44 2010 +0000
@@ -86,7 +86,7 @@
 	/* validate name */
 	name = purple_request_fields_get_string( fields, "name" );
 	if ( ( !name ) || ( strlen( name ) < 3 ) ) {
-		err = _( "The name you entered is invalid." );
+		err = _( "The Display Name you entered is invalid." );
 		goto out;
 	}
 
--- a/libpurple/protocols/mxit/markup.c	Tue Jul 27 15:10:30 2010 +0000
+++ b/libpurple/protocols/mxit/markup.c	Wed Jul 28 12:51:44 2010 +0000
@@ -662,7 +662,7 @@
  *  @param message			The message text
  *  @return					The length of the message to skip
  */
-static int mxit_extract_chatroom_nick( struct RXMsgData* mx, char* message, int len )
+static int mxit_extract_chatroom_nick( struct RXMsgData* mx, char* message, int len, int msgflags )
 {
 	int		i;
 
@@ -673,7 +673,6 @@
 		 * Search for it....
 		 */
 		gboolean	found	= FALSE;
-		gchar*		nickname;
 
 		for ( i = 1; i < len; i++ ) {
 			if ( ( message[i] == '\n' ) && ( message[i-1] == '>' ) ) {
@@ -685,12 +684,30 @@
 		}
 
 		if ( found ) {
+			gchar*		nickname;
+
 			/*
 			 * The message definitely had an embedded nickname - generate a marked-up
 			 * message to be displayed.
 			 */
 			nickname = g_markup_escape_text( &message[1], -1 );
 
+			/* Remove any MXit escaping from nickname ("\X" --> "X") */
+			if ( msgflags & CP_MSG_MARKUP ) {
+				int	nicklen = strlen( nickname );
+				int	j, k;
+
+				for ( j = 0, k = 0; j < nicklen; j++ ) {
+					if ( nickname[j] == '\\' )
+						j++;
+
+					nickname[k] = nickname[j];
+					k++;
+				}
+
+				nickname[k] = '\0';		/* terminate string */
+			}
+
 			/* add nickname within some BOLD markup to the new converted message */
 			g_string_append_printf( mx->msg, "<b>%s:</b> ", nickname );
 
@@ -747,7 +764,7 @@
 	if ( is_mxit_chatroom_contact( mx->session, mx->from ) ) {
 		/* chatroom message, so we need to extract and skip the sender's nickname
 		 * which is embedded inside the message */
-		i = mxit_extract_chatroom_nick( mx, message, len );
+		i = mxit_extract_chatroom_nick( mx, message, len, msgflags );
 	}
 
 	/* run through the message and check for custom emoticons and markup */
--- a/libpurple/protocols/mxit/roster.c	Tue Jul 27 15:10:30 2010 +0000
+++ b/libpurple/protocols/mxit/roster.c	Wed Jul 28 12:51:44 2010 +0000
@@ -145,6 +145,11 @@
 	{"hot",			N_("Hot"),			NULL},
 	{"sick",		N_("Sick"),			NULL},
 	{"sleepy",		N_("Sleepy"),		NULL},
+	{"bored",		N_("Bored"),		NULL},
+	{"cold",		N_("Cold"),			NULL},
+	{"confused",	N_("Confused"),		NULL},
+	{"hungry",		N_("Hungry"),		NULL},
+	{"stressed",	N_("Stressed"),		NULL},
 	/* Mark the last record. */
 	{ NULL, NULL, NULL }
 };
@@ -213,6 +218,16 @@
 				return _( "Sick" );
 		case MXIT_MOOD_SLEEPY :
 				return _( "Sleepy" );
+		case MXIT_MOOD_BORED :
+				return _( "Bored" );
+		case MXIT_MOOD_COLD :
+				return _( "Cold" );
+		case MXIT_MOOD_CONFUSED :
+				return _( "Confused" );
+		case MXIT_MOOD_HUNGRY :
+				return _( "Hungry" );
+		case MXIT_MOOD_STRESSED :
+				return _( "Stressed" );
 		case MXIT_MOOD_NONE :
 		default :
 				return "";
@@ -457,7 +472,7 @@
 	contact->mood = mood;
 
 	/* validate mood */
-	if (( contact->mood < MXIT_MOOD_NONE ) || ( contact->mood > MXIT_MOOD_SLEEPY ))
+	if (( contact->mood < MXIT_MOOD_NONE ) || ( contact->mood > MXIT_MOOD_STRESSED ))
 		contact->mood = MXIT_MOOD_NONE;
 
 	g_strlcpy( contact->customMood, customMood, sizeof( contact->customMood ) );
--- a/libpurple/protocols/mxit/roster.h	Tue Jul 27 15:10:30 2010 +0000
+++ b/libpurple/protocols/mxit/roster.h	Wed Jul 28 12:51:44 2010 +0000
@@ -66,6 +66,11 @@
 #define		MXIT_MOOD_HOT				0x08
 #define		MXIT_MOOD_SICK				0x09
 #define		MXIT_MOOD_SLEEPY			0x0A
+#define		MXIT_MOOD_BORED				0x0B
+#define		MXIT_MOOD_COLD				0x0C
+#define		MXIT_MOOD_CONFUSED			0x0D
+#define		MXIT_MOOD_HUNGRY			0x0E
+#define		MXIT_MOOD_STRESSED			0x0F
 
 
 /* MXit contact flags */
--- a/pidgin/pixmaps/emotes/default/24/Makefile.am	Tue Jul 27 15:10:30 2010 +0000
+++ b/pidgin/pixmaps/emotes/default/24/Makefile.am	Wed Jul 28 12:51:44 2010 +0000
@@ -14,6 +14,7 @@
     beer.png \
     blowkiss.png \
     bomb.png \
+    bored.png \
     bowl.png \
     boy.png \
     brb.png \
@@ -36,6 +37,7 @@
     clown.png \
     coffee.png \
     coins.png \
+    cold.png \
     computer.png \
     confused.png \
     console.png \
@@ -168,6 +170,7 @@
     star.png \
     starving.png \
     stop.png \
+    stressed.png \
     struggle.png \
     sun.png \
     hot.png \
Binary file pidgin/pixmaps/emotes/default/24/bored.png has changed
Binary file pidgin/pixmaps/emotes/default/24/cold.png has changed
--- a/pidgin/pixmaps/emotes/default/24/default.theme.in	Tue Jul 27 15:10:30 2010 +0000
+++ b/pidgin/pixmaps/emotes/default/24/default.theme.in	Wed Jul 28 12:51:44 2010 +0000
@@ -489,3 +489,9 @@
 lying.png           :L)
 glasses-nerdy.png   8-|     8|
 pirate.png          P-)
+### Added in v5.9.7
+bored.png           :-[     :[
+cold.png            :-<     :<
+confused.png        :-,     :,
+hungry.png          :-C     :C
+stressed.png        :-s     :s
Binary file pidgin/pixmaps/emotes/default/24/stressed.png has changed