comparison src/conversation.c @ 829:9a123b171f46

[gaim-migrate @ 839] yay. i have a secret. but basically this should fix most outstanding libfaim issues in gaim. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 02 Sep 2000 02:41:57 +0000
parents fe2e1ad4495b
children 60284aef22f0
comparison
equal deleted inserted replaced
828:4c71c0e7f04e 829:9a123b171f46
1057 } 1057 }
1058 1058
1059 void write_html_with_smileys(GtkWidget *window, GtkWidget *html, char *what) 1059 void write_html_with_smileys(GtkWidget *window, GtkWidget *html, char *what)
1060 { 1060 {
1061 int y = 0; 1061 int y = 0;
1062 char buf2[BUF_LONG]; 1062 char *buf2 = g_strdup(what);
1063 int i; 1063 int i;
1064 GdkPixmap *face; 1064 GdkPixmap *face;
1065 1065
1066 for (i = 0; i < strlen(what); i++) 1066 for (i = 0; i < strlen(what); i++)
1067 { 1067 {
1068 int len; 1068 int len;
1069 if ((face = is_smiley(window, &what[i], &len)) != NULL) { 1069 if ((face = is_smiley(window, &what[i], &len)) != NULL) {
1070 buf2[y] = 0; 1070 buf2[y] = 0;
1071 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); 1071 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
1072 gtk_html_add_pixmap(GTK_HTML(html), face, 0, 0); 1072 gtk_html_add_pixmap(GTK_HTML(html), face, 0, 0);
1073 y = 0; 1073 y = 0;
1074 i += len - 1; 1074 i += len - 1;
1075 } else { 1075 } else {
1076 buf2[y] = what[i]; 1076 buf2[y] = what[i];
1077 y++; 1077 y++;
1078 1078
1079 } 1079 }
1080 } 1080 }
1081 1081
1082 if (y) 1082 if (y)
1083 { 1083 {
1084 buf2[y] = 0; 1084 buf2[y] = 0;
1085 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); 1085 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
1086 } 1086 }
1087 g_free(buf2);
1087 } 1088 }
1088 1089
1089 /* this is going to be interesting since the conversation could either be a 1090 /* this is going to be interesting since the conversation could either be a
1090 * normal IM conversation or a chat window. but hopefully it won't matter */ 1091 * normal IM conversation or a chat window. but hopefully it won't matter */
1091 void write_to_conv(struct conversation *c, char *what, int flags, char *who) 1092 void write_to_conv(struct conversation *c, char *what, int flags, char *who)