Mercurial > pidgin.yaz
comparison console/gntconv.c @ 14011:735c4e927eb8
[gaim-migrate @ 16603]
wabz says: "gaim_strdup_withhtml in util.c is purely for converting
linebreaks to <br> - some protocols use it for various reasons, but not msn
- not sure where it's done for that (might not be? gtkconv doesnt use
gaim_markup_strip_html). i reckon since you're using
gaim_markup_strip_html, you may as well play it safe and just use
gaim_strdup_withhtml before the strip?"
So let's do it until GntTextView can parse html. (after all, that's 20% of
the users ;) )
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 31 Jul 2006 23:56:35 +0000 |
parents | 7573bd40a190 |
children | 7109e6397a31 |
comparison
equal
deleted
inserted
replaced
14010:7573bd40a190 | 14011:735c4e927eb8 |
---|---|
214 static void | 214 static void |
215 gg_write_common(GaimConversation *conv, const char *who, const char *message, | 215 gg_write_common(GaimConversation *conv, const char *who, const char *message, |
216 GaimMessageFlags flags, time_t mtime) | 216 GaimMessageFlags flags, time_t mtime) |
217 { | 217 { |
218 GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); /* XXX: ggconv = conv->ui_data; should do */ | 218 GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); /* XXX: ggconv = conv->ui_data; should do */ |
219 char *strip; | 219 char *strip, *newline; |
220 GntTextFormatFlags fl = 0; | 220 GntTextFormatFlags fl = 0; |
221 | 221 |
222 g_return_if_fail(ggconv != NULL); | 222 g_return_if_fail(ggconv != NULL); |
223 | 223 |
224 if (who && *who && (flags & (GAIM_MESSAGE_SEND | GAIM_MESSAGE_RECV))) | 224 if (who && *who && (flags & (GAIM_MESSAGE_SEND | GAIM_MESSAGE_RECV))) |
234 if (flags & GAIM_MESSAGE_ERROR) | 234 if (flags & GAIM_MESSAGE_ERROR) |
235 fl |= GNT_TEXT_FLAG_BOLD; | 235 fl |= GNT_TEXT_FLAG_BOLD; |
236 if (flags & GAIM_MESSAGE_NICK) | 236 if (flags & GAIM_MESSAGE_NICK) |
237 fl |= GNT_TEXT_FLAG_UNDERLINE; | 237 fl |= GNT_TEXT_FLAG_UNDERLINE; |
238 | 238 |
239 strip = gaim_markup_strip_html(message); | 239 /* XXX: Remove this workaround when textview can parse messages. */ |
240 newline = gaim_strdup_withhtml(message); | |
241 strip = gaim_markup_strip_html(newline); | |
240 gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), | 242 gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), |
241 strip, fl); | 243 strip, fl); |
242 gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); | 244 gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); |
243 gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); | 245 gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); |
244 | 246 |
247 g_free(newline); | |
245 g_free(strip); | 248 g_free(strip); |
246 | 249 |
247 if (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_NICK | GAIM_MESSAGE_ERROR)) | 250 if (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_NICK | GAIM_MESSAGE_ERROR)) |
248 gnt_widget_set_urgent(ggconv->tv); | 251 gnt_widget_set_urgent(ggconv->tv); |
249 } | 252 } |