pidgin.mxit: 78a9bf10: Fix bug in mxit_show_split_message() (th...

andrew.victor at mxit.com andrew.victor at mxit.com
Mon Mar 21 15:55:50 EDT 2011


----------------------------------------------------------------------
Revision: 78a9bf10173186c8c8775541e984f77ee05e2f22
Parent:   32ced579624d883181409ef15d340daa0b5b084e
Author:   andrew.victor at mxit.com
Date:     03/21/11 15:40:36
Branch:   im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/78a9bf10173186c8c8775541e984f77ee05e2f22

Changelog: 

Fix bug in mxit_show_split_message() (the workaround for Pidgin's workaround
 to GtkHTML) when messages with many links were not correctly split.

Set the PURPLE_MESSAGE_RAW flag for the 2nd, 3rd, etc piece of the mesage so
 that it looks like one message.  We can now remove the prepended
 "continuing..." text.


Changes against parent 32ced579624d883181409ef15d340daa0b5b084e

  patched  libpurple/protocols/mxit/markup.c

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/markup.c	fdb0cf48e93b506c8cc1a6c013e72f6c71829f7c
+++ libpurple/protocols/mxit/markup.c	1494d9bde0b5ad7028b8171d08352176b740967e
@@ -235,7 +235,6 @@ static void mxit_show_split_message( str
  */
 static void mxit_show_split_message( struct RXMsgData* mx )
 {
-	const char*		cont	= "<font color=\"#999999\">continuing...</font>\n";
 	GString*		msg		= NULL;
 	char*			ch		= NULL;
 	int				pos		= 0;
@@ -245,7 +244,6 @@ static void mxit_show_split_message( str
 	int				l_gt	= 0;
 	int				stop	= 0;
 	int				tags	= 0;
-	int				segs	= 0;
 	gboolean		intag	= FALSE;
 
 	/*
@@ -319,21 +317,20 @@ static void mxit_show_split_message( str
 				stop--;
 			}
 
-			/* build the string */
-			if ( segs )
-				g_string_prepend( msg, cont );
-
 			/* push message to pidgin */
 			serv_got_im( mx->session->con, mx->from, msg->str, mx->flags, mx->timestamp );
 			g_string_free( msg, TRUE );
 			msg = NULL;
 
+			/* next part need this flag set */
+			mx->flags |= PURPLE_MESSAGE_RAW;
+
 			tags = 0;
-			segs++;
 			start = stop + 1;
+			pos = start;
 		}
-
-		pos++;
+		else
+			pos++;
 	}
 
 	if ( start != pos ) {
@@ -343,8 +340,6 @@ static void mxit_show_split_message( str
 		ch[pos] = '\0';
 		msg = g_string_new( &ch[start] );
 		ch[pos] = '\n';
-		if ( segs )
-			g_string_prepend( msg, cont );
 
 		/* push message to pidgin */
 		serv_got_im( mx->session->con, mx->from, msg->str, mx->flags, mx->timestamp );


More information about the Commits mailing list