Mercurial > pidgin.yaz
diff src/gtkimhtml.c @ 11485:16b0da1f376f
[gaim-migrate @ 13727]
Fix the /nick weirdness bug I introduced.
Also, patch 1283539, from Peter Lawler (two changes)
1. When in a chat where Gaim can tell which users are buddies (i.e. non-Jabber chats), only the names of buddies are bolded. I'm not sure if I'll like this, but I'm committing it so we can all try it out.
2. "remove bold, underline, and italics when we're ignoring formatting, as well"
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Fri, 09 Sep 2005 20:14:32 +0000 |
parents | 78cd70f4834c |
children | b47708f46a38 |
line wrap: on
line diff
--- a/src/gtkimhtml.c Fri Sep 09 20:06:13 2005 +0000 +++ b/src/gtkimhtml.c Fri Sep 09 20:14:32 2005 +0000 @@ -2367,60 +2367,71 @@ case 1: /* B */ case 2: /* BOLD */ case 54: /* STRONG */ - - gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); - - if ((bold == 0) && (imhtml->format_functions & GTK_IMHTML_BOLD)) - gtk_imhtml_toggle_bold(imhtml); - bold++; - ws[0] = '\0'; wpos = 0; + if (!(options & GTK_IMHTML_NO_FORMATTING)) { + gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); + + if ((bold == 0) && (imhtml->format_functions & GTK_IMHTML_BOLD)) + gtk_imhtml_toggle_bold(imhtml); + bold++; + ws[0] = '\0'; wpos = 0; + } break; case 3: /* /B */ case 4: /* /BOLD */ case 55: /* /STRONG */ - gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); - ws[0] = '\0'; wpos = 0; - - if (bold) - bold--; - if ((bold == 0) && (imhtml->format_functions & GTK_IMHTML_BOLD) && !imhtml->wbfo) - gtk_imhtml_toggle_bold(imhtml); + if (!(options & GTK_IMHTML_NO_FORMATTING)) { + gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); + ws[0] = '\0'; wpos = 0; + + if (bold) + bold--; + if ((bold == 0) && (imhtml->format_functions & GTK_IMHTML_BOLD) && !imhtml->wbfo) + gtk_imhtml_toggle_bold(imhtml); + } break; case 5: /* I */ case 6: /* ITALIC */ case 52: /* EM */ - gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); - ws[0] = '\0'; wpos = 0; - if ((italics == 0) && (imhtml->format_functions & GTK_IMHTML_ITALIC)) - gtk_imhtml_toggle_italic(imhtml); - italics++; + if (!(options & GTK_IMHTML_NO_FORMATTING)) { + gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); + ws[0] = '\0'; wpos = 0; + if ((italics == 0) && (imhtml->format_functions & GTK_IMHTML_ITALIC)) + gtk_imhtml_toggle_italic(imhtml); + italics++; + } break; case 7: /* /I */ case 8: /* /ITALIC */ case 53: /* /EM */ - gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); - ws[0] = '\0'; wpos = 0; - if (italics) - italics--; - if ((italics == 0) && (imhtml->format_functions & GTK_IMHTML_ITALIC) && !imhtml->wbfo) - gtk_imhtml_toggle_italic(imhtml); + if (!(options & GTK_IMHTML_NO_FORMATTING)) { + gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); + ws[0] = '\0'; wpos = 0; + if (italics) + italics--; + if ((italics == 0) && (imhtml->format_functions & GTK_IMHTML_ITALIC) && !imhtml->wbfo) + gtk_imhtml_toggle_italic(imhtml); + } break; case 9: /* U */ case 10: /* UNDERLINE */ - gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); - ws[0] = '\0'; wpos = 0; - if ((underline == 0) && (imhtml->format_functions & GTK_IMHTML_UNDERLINE)) - gtk_imhtml_toggle_underline(imhtml); - underline++; + if (!(options & GTK_IMHTML_NO_FORMATTING)) { + gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); + ws[0] = '\0'; wpos = 0; + if ((underline == 0) && (imhtml->format_functions & GTK_IMHTML_UNDERLINE)) + gtk_imhtml_toggle_underline(imhtml); + underline++; + } break; case 11: /* /U */ case 12: /* /UNDERLINE */ - gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); - ws[0] = '\0'; wpos = 0; - if (underline) - underline--; - if ((underline == 0) && (imhtml->format_functions & GTK_IMHTML_UNDERLINE) && !imhtml->wbfo) - gtk_imhtml_toggle_underline(imhtml); + if (!(options & GTK_IMHTML_NO_FORMATTING)) { + gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); + ws[0] = '\0'; wpos = 0; + if (underline) + underline--; + if ((underline == 0) && (imhtml->format_functions & GTK_IMHTML_UNDERLINE) && !imhtml->wbfo) + gtk_imhtml_toggle_underline(imhtml); + } break; case 13: /* S */ case 14: /* STRIKE */