pidgin.mxit.2.x.y: effc87dd: * show farewell message differently

pieter.loubser at mxit.com pieter.loubser at mxit.com
Tue Feb 21 16:55:59 EST 2012


----------------------------------------------------------------------
Revision: effc87dd11a269e8d286c039a4cd009d04e43d8d
Parent:   d25eeb2478130585b2bc301214a1683a1e81ca5e
Author:   pieter.loubser at mxit.com
Date:     02/21/12 16:51:24
Branch:   im.pidgin.pidgin.mxit.2.x.y
URL: http://d.pidgin.im/viewmtn/revision/info/effc87dd11a269e8d286c039a4cd009d04e43d8d

Changelog: 

 * show farewell message differently


Changes against parent d25eeb2478130585b2bc301214a1683a1e81ca5e

  patched  libpurple/protocols/mxit/markup.c
  patched  libpurple/protocols/mxit/protocol.h

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/markup.c	5724b2f1ab82f5d817fc38fc54a2773692bfe733
+++ libpurple/protocols/mxit/markup.c	0949b160592cb7dc4498196a4a8210fa84f7ed0a
@@ -59,8 +59,10 @@ struct tag {
 };
 
 
-#define		MXIT_VIBE_MSG_COLOR		"#9933FF"
+#define		MXIT_VIBE_MSG_COLOR			"#9933FF"
+#define		MXIT_FAREWELL_MSG_COLOR		"#949494"
 
+
 /* vibes */
 static const char*	vibes[] = {
 	/* 0 */		N_( "Cool Vibrations" ),
@@ -993,6 +995,15 @@ void mxit_parse_markup( struct RXMsgData
 					break;
 		}
 	}
+
+	if ( msgflags & CP_MSG_FAREWELL ) {
+		/* this is a farewell message */
+		GString* premsg = g_string_sized_new( 36 );
+		g_string_append_printf( premsg, "<font color=\"%s\"><i>", MXIT_FAREWELL_MSG_COLOR );
+		g_string_prepend( mx->msg, premsg->str );
+		g_string_append( mx->msg, "</i></font>" );
+		g_string_free( premsg, TRUE );
+	}
 }
 
 
============================================================
--- libpurple/protocols/mxit/protocol.h	08e87fa4e6551005858077c0d0e8cc4b2863b5a3
+++ libpurple/protocols/mxit/protocol.h	643d2a48c87dfc9a8dce484b7b35b42670b47fde
@@ -158,6 +158,7 @@
 #define		CP_MSG_ENCRYPTED		0x0010					/* message is encrypted */
 #define		CP_MSG_MARKUP			0x0200					/* message may contain markup */
 #define		CP_MSG_EMOTICON			0x0400					/* message may contain custom emoticons */
+#define		CP_MSG_FAREWELL			0x0800					/* this is a farewell message */
 
 /* redirect types */
 #define		CP_REDIRECT_PERMANENT	1						/* permanent redirect */


More information about the Commits mailing list