diff src/gtkconv.c @ 8722:230fee6f1e3e

[gaim-migrate @ 9477] So, I decided we should cut down on gaim_notify_* where possible and find less obtrusive ways to report errors, so I made GAIM_MESSAGE_ERROR as a flag that can be sent to gaim_conversation_write to report conversation-specific errors ("This message was not sent because %s is offline" and the sorts). I'll leave hacking the prpls to use it (without changing strings before Thursday) as an excercise. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 20 Apr 2004 05:00:27 +0000
parents 0eb5161ef333
children 8b935eddeb10
line wrap: on
line diff
--- a/src/gtkconv.c	Tue Apr 20 04:39:27 2004 +0000
+++ b/src/gtkconv.c	Tue Apr 20 05:00:27 2004 +0000
@@ -4584,6 +4584,23 @@
 		conv->history = g_string_append(conv->history, buf);
 		conv->history = g_string_append(conv->history, "<BR>\n");
 
+	} else if (flags & GAIM_MESSAGE_ERROR) {
+		if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps"))
+			g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s)</FONT> <B>%s</B>",
+				   mdate, message);
+		else
+			g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"#ff0000\"><B>%s</B></FONT>", message);
+		
+		g_snprintf(buf2, sizeof(buf2),
+			   "<FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT>",
+			   sml_attrib, mdate, message);
+		
+		gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->imhtml),
+						   buf2, 0, images);
+		
+		/* Add the message to a conversations scrollback buffer */
+		conv->history = g_string_append(conv->history, buf);
+		conv->history = g_string_append(conv->history, "<BR>\n");
 	} else if (flags & GAIM_MESSAGE_NO_LOG) {
 		g_snprintf(buf, BUF_LONG,
 			   "<B><FONT %s COLOR=\"#777777\">%s</FONT></B>",