changeset 21753:e9760c22bab5

merge of '8ae0d2f36bb2689e7de9fcb3245c1e9484bd3fe6' and 'c93ff822e1d2ed0916468029ebfbbea0ed0f28fa'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 03 Dec 2007 22:57:49 +0000
parents 5ff16647c50d (diff) 9c2230fe2217 (current diff)
children 61725f2eb4a6 8922d61c738a
files
diffstat 1 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntconv.c	Mon Dec 03 22:35:26 2007 +0000
+++ b/finch/gntconv.c	Mon Dec 03 22:57:49 2007 +0000
@@ -772,26 +772,25 @@
 			!(flags & PURPLE_MESSAGE_NOTIFY))
 	{
 		char * name = NULL;
+		GntTextFormatFlags msgflags = GNT_TEXT_FLAG_NORMAL;
+		gboolean me = FALSE;
 
 		if (purple_message_meify((char*)message, -1)) {
 			name = g_strdup_printf("*** %s", who);
-			gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv),
-				name, gnt_color_pair(color_message_action));
+			msgflags = gnt_color_pair(color_message_action);
+			me = TRUE;
 		} else {
 			name =  g_strdup_printf("%s", who);
 			if (flags & PURPLE_MESSAGE_SEND)
-				gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv),
-					name, gnt_color_pair(color_message_send));
+				msgflags = gnt_color_pair(color_message_send);
+			else if (flags & PURPLE_MESSAGE_NICK)
+				msgflags = gnt_color_pair(color_message_highlight);
 			else
-				if (flags & PURPLE_MESSAGE_NICK) {
-					gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv),
-						name, gnt_color_pair(color_message_highlight));
-				} else {
-					gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv),
-						name, gnt_color_pair(color_message_receive));
-				}
+				msgflags = gnt_color_pair(color_message_receive);
 		}
-		gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), ": ", GNT_TEXT_FLAG_NORMAL);
+		gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv),
+				name, msgflags);
+		gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), me ? " " : ": ", GNT_TEXT_FLAG_NORMAL);
 		g_free(name);
 	} else
 		fl = GNT_TEXT_FLAG_DIM;