Mercurial > pidgin
comparison src/conversation.c @ 636:072200640327
[gaim-migrate @ 646]
tra la la
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 07 Aug 2000 22:31:25 +0000 |
parents | ce8d8608d05b |
children | b3900e312d8e |
comparison
equal
deleted
inserted
replaced
635:2ad1a8234ef1 | 636:072200640327 |
---|---|
1102 /* this is going to be interesting since the conversation could either be a | 1102 /* this is going to be interesting since the conversation could either be a |
1103 * normal IM conversation or a chat window. but hopefully it won't matter */ | 1103 * normal IM conversation or a chat window. but hopefully it won't matter */ |
1104 void write_to_conv(struct conversation *c, char *what, int flags, char *who) | 1104 void write_to_conv(struct conversation *c, char *what, int flags, char *who) |
1105 { | 1105 { |
1106 char *buf = g_malloc(BUF_LONG); | 1106 char *buf = g_malloc(BUF_LONG); |
1107 char buf2[1024]; | |
1107 char *str; | 1108 char *str; |
1108 FILE *fd; | 1109 FILE *fd; |
1109 char colour[10]; | 1110 char colour[10]; |
1111 int colorv = -1; | |
1112 char *clr; | |
1110 char *smiley = g_malloc(7); | 1113 char *smiley = g_malloc(7); |
1111 | 1114 |
1112 if (!who) { | 1115 if (!who) { |
1113 if (flags & WFLAG_SEND) | 1116 if (flags & WFLAG_SEND) |
1114 who = current_user->username; | 1117 who = current_user->username; |
1139 g_free(t1); | 1142 g_free(t1); |
1140 } | 1143 } |
1141 } | 1144 } |
1142 | 1145 |
1143 } else { | 1146 } else { |
1147 if ((clr = strstr(what, "<BODY BGCOLOR=\"#")) != NULL) { | |
1148 sscanf(clr + strlen("<BODY BGCOLOR=\"#"), "%x", &colorv); | |
1149 } | |
1144 | 1150 |
1145 if (flags & WFLAG_WHISPER) { | 1151 if (flags & WFLAG_WHISPER) { |
1146 /* if we're whispering, it's not an autoresponse */ | 1152 /* if we're whispering, it's not an autoresponse */ |
1147 if (meify(what)) { | 1153 if (meify(what)) { |
1148 str = g_malloc(64); | 1154 str = g_malloc(64); |
1181 | 1187 |
1182 g_free(str); | 1188 g_free(str); |
1183 | 1189 |
1184 gtk_html_freeze(GTK_HTML(c->text)); | 1190 gtk_html_freeze(GTK_HTML(c->text)); |
1185 | 1191 |
1192 if (colorv != -1) { | |
1193 sprintf(buf2, "<BODY BGCOLOR=\"#%x\">", colorv); | |
1194 gtk_html_append_text(GTK_HTML(c->text), buf2, 0); | |
1195 } | |
1196 | |
1186 gtk_html_append_text(GTK_HTML(c->text), buf, 0); | 1197 gtk_html_append_text(GTK_HTML(c->text), buf, 0); |
1187 | 1198 |
1188 if (display_options & OPT_DISP_SHOW_SMILEY) | 1199 if (display_options & OPT_DISP_SHOW_SMILEY) |
1189 { | 1200 { |
1190 write_html_with_smileys(c->window, c->text, what); | 1201 write_html_with_smileys(c->window, c->text, what); |
1192 else | 1203 else |
1193 { | 1204 { |
1194 gtk_html_append_text(GTK_HTML(c->text), what, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); | 1205 gtk_html_append_text(GTK_HTML(c->text), what, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); |
1195 } | 1206 } |
1196 | 1207 |
1208 if (colorv != -1) { | |
1209 gtk_html_append_text(GTK_HTML(c->text), "</BODY>", 0); | |
1210 } | |
1197 gtk_html_append_text(GTK_HTML(c->text), "<BR>", 0); | 1211 gtk_html_append_text(GTK_HTML(c->text), "<BR>", 0); |
1198 | 1212 |
1199 | 1213 |
1200 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { | 1214 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { |
1201 char *t1, *t2; | 1215 char *t1, *t2; |