changeset 4896:3c649fe22e2c

[gaim-migrate @ 5228] this lets those silly MSN types put emoticons in their friendly names, and have them show up in the convo window like they used to. they're weird like that. ;-) committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 27 Mar 2003 17:07:21 +0000
parents 9e50494f63a1
children 65a0a360e8c4
files src/gtkconv.c
diffstat 1 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Wed Mar 26 06:19:44 2003 +0000
+++ b/src/gtkconv.c	Thu Mar 27 17:07:21 2003 +0000
@@ -3871,7 +3871,7 @@
 	char color[10];
 	char *str;
 	char *with_font_tag;
-	
+	char *sml_attrib = NULL;
 
 	if(length == -1)
 		length = strlen(message) + 1;
@@ -3881,6 +3881,9 @@
 
 	strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime));
 
+	if(gc)
+		sml_attrib = g_strdup_printf("sml=\"%s\"", gc->prpl->name);
+
 	gtk_font_options ^= GTK_IMHTML_NO_COMMENTS;
 
 	if (convo_options & OPT_CONVO_IGNORE_COLOUR)
@@ -4022,23 +4025,25 @@
 
 		if (convo_options & OPT_CONVO_SHOW_TIME)
 			g_snprintf(buf, BUF_LONG,
-					   "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>"
-					   "<B>%s</B></FONT> ", color, mdate, str);
+					   "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\">(%s) </FONT>"
+					   "<B>%s</B></FONT> ", color,
+					   sml_attrib ? sml_attrib : "", mdate, str);
 		else
 			g_snprintf(buf, BUF_LONG,
-					   "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", color, str);
+					   "<FONT COLOR=\"%s\" %s><B>%s</B></FONT> ", color,
+					   sml_attrib ? sml_attrib : "", str);
 
 		g_snprintf(buf2, BUF_LONG,
-				   "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>"
+				   "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--(%s) --></FONT>"
 				   "<B>%s</B></FONT> ",
-				   color, mdate, str);
+				   color, sml_attrib ? sml_attrib : "", mdate, str);
 
 		g_free(str);
 
 		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, -1, 0);
 
 		if(gc){
-			char *pre = g_strdup_printf("<font sml=\"%s\">", gc->prpl->name);
+			char *pre = g_strdup_printf("<font %s>", sml_attrib ? sml_attrib : "");
 			char *post = "</font>";
 			int pre_len = strlen(pre);
 			int post_len = strlen(post);
@@ -4128,6 +4133,8 @@
 			g_free(t2);
 		}
 
+		if(sml_attrib)
+			g_free(sml_attrib);
 		g_free(with_font_tag);
 		g_free(new_message);
 	}