comparison src/gtkimhtml.c @ 10815:65c818fb218e

[gaim-migrate @ 12470] Fix the gtkimhtml bug that caused screennames to be duplicated in AIM profiles containing pasted conversations committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Mon, 11 Apr 2005 15:00:30 +0000
parents 364a2ef907ae
children 2a5fe8e67195
comparison
equal deleted inserted replaced
10814:364a2ef907ae 10815:65c818fb218e
1963 VALID_OPT_TAG("BR"); 1963 VALID_OPT_TAG("BR");
1964 1964
1965 if (!g_ascii_strncasecmp(string, "!--", strlen ("!--"))) { 1965 if (!g_ascii_strncasecmp(string, "!--", strlen ("!--"))) {
1966 gchar *e = strstr (string + strlen("!--"), "-->"); 1966 gchar *e = strstr (string + strlen("!--"), "-->");
1967 if (e) { 1967 if (e) {
1968 /*
1969 * If we uncomment the following line then HTML comments will be
1970 * hidden. This is good because it means when a WinAIM users pastes
1971 * part of a conversation to you, the screen names won't be
1972 * duplicated (because WinAIM pastes an HTML comment containing the
1973 * screen name, for some reason).
1974 *
1975 * However, uncommenting this is bad because we use HTML comment
1976 * tags to print timestamps to conversations (at least, I think...)
1977 *
1978 * KingAnt thinks it would be best to display timestamps using
1979 * something other than comment tags.
1980 */
1981 /* *type = -1; */
1982 *len = e - string + strlen ("-->"); 1968 *len = e - string + strlen ("-->");
1983 *tag = g_strndup (string + strlen ("!--"), *len - strlen ("!---->")); 1969 *tag = g_strndup (string + strlen ("!--"), *len - strlen ("!---->"));
1984 return TRUE; 1970 return TRUE;
1985 } 1971 }
1986 } 1972 }
2803 /* NEW_BIT (NEW_TEXT_BIT); */ 2789 /* NEW_BIT (NEW_TEXT_BIT); */
2804 ws[wpos] = '\0'; 2790 ws[wpos] = '\0';
2805 2791
2806 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2792 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2807 2793
2808 if (imhtml->show_comments && !(options & GTK_IMHTML_NO_COMMENTS)) 2794 if (imhtml->show_comments && !(options & GTK_IMHTML_NO_COMMENTS)) {
2809 wpos = g_snprintf (ws, len, "%s", tag); 2795 wpos = g_snprintf (ws, len, "%s", tag);
2796 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2797 }
2798 ws[0] = '\0'; wpos = 0;
2799
2810 /* NEW_BIT (NEW_COMMENT_BIT); */ 2800 /* NEW_BIT (NEW_COMMENT_BIT); */
2811 break; 2801 break;
2812 default: 2802 default:
2813 break; 2803 break;
2814 } 2804 }