diff options
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 18 | ||||
-rw-r--r-- | mail/mail-display.c | 2 | ||||
-rw-r--r-- | mail/mail-format.c | 1 | ||||
-rw-r--r-- | mail/mail-tools.c | 39 |
5 files changed, 36 insertions, 32 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index c51e5d2480..e1cde9ea06 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2001-04-25 Radek Doulik <rodo@ximian.com> + + * mail-tools.c (mail_tool_quote_message): set object data directly + in HTML source + + * mail-callbacks.c (mail_generate_reply): remove \n from citation + (mail_generate_reply): don't use e_msg_composer_mark_text_orig + 2001-04-24 Jeffrey Stedfast <fejj@ximian.com> * folder-browser.c: Added a new signal, "message_loaded" that gets diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 083c3e89ff..722d8c9a7e 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -400,20 +400,19 @@ create_msg_composer (const char *url) gchar *sig_file = NULL; EMsgComposer *composer; - account = mail_config_get_default_account (); + account = mail_config_get_default_account (); send_html = mail_config_get_send_html (); if (account->id) sig_file = account->id->signature; - if (url != NULL) { - composer = e_msg_composer_new_from_url (url); - if (composer) - e_msg_composer_set_send_html (composer, send_html); - } else - composer = e_msg_composer_new_with_sig_file (sig_file, send_html); + composer = url ? e_msg_composer_new_from_url (url) : e_msg_composer_new (); + if (composer) { + e_msg_composer_set_send_html (composer, send_html); + e_msg_composer_set_sig_file (composer, sig_file); + } - return (GtkWidget *)composer; + return GTK_WIDGET (composer); } void @@ -590,13 +589,12 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all) camel_internet_address_get (sender, 0, &name, &address); date = camel_mime_message_get_date (message, &offset); date_str = header_format_date (date, offset); - text = mail_tool_quote_message (message, _("On %s, %s wrote:\n"), date_str, name && *name ? name : address); + text = mail_tool_quote_message (message, _("On %s, %s wrote:"), date_str, name && *name ? name : address); g_free (date_str); if (text) { e_msg_composer_set_body_text (composer, text); g_free (text); - e_msg_composer_mark_text_orig (composer); } /* Set the recipients */ diff --git a/mail/mail-display.c b/mail/mail-display.c index 7c88ebcb94..a3559053a0 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1289,8 +1289,6 @@ html_button_press_event (GtkWidget *widget, GdkEventButton *event, MailDisplay * HTMLEngine *e; HTMLPoint *point; GtkWidget *popup_thing; - const gchar *email; - const gchar *name; const gchar *link; e = GTK_HTML (widget)->engine; diff --git a/mail/mail-format.c b/mail/mail-format.c index 3b09e43e8c..927751ba99 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -668,7 +668,6 @@ static void write_address(MailDisplay *md, const CamelInternetAddress *addr, const char *field_name, int flags) { const char *name, *email; - gboolean name_set, mail_set; gint i; if (addr == NULL || !camel_internet_address_get (addr, 0, NULL, NULL)) diff --git a/mail/mail-tools.c b/mail/mail-tools.c index c78182128d..97433457a0 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -310,15 +310,15 @@ mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...) } if (is_html) { - ret_text = g_strdup_printf ("<blockquote><i><font color=\"%06x\">\n%s%s%s\n" - "</font></i></blockquote>\n", - mail_config_get_citation_color (), + ret_text = g_strdup_printf ("%s<!--+GtkHTML:<DATA class=\"ClueFlow\" key=\"orig\" value=\"1\">-->" + "<blockquote><i><font color=\"%06x\">\n%s\n" + "</font></i></blockquote>" + "<!--+GtkHTML:<DATA class=\"ClueFlow\" clear=\"orig\">-->", credits ? credits : "", - credits ? "\n" : "", - text); + mail_config_get_citation_color (), text); } else { - gchar *s, *d, *quoted_text; - gint lines, len, offset = 0; + gchar *s, *d, *quoted_text, *orig_text; + gint lines, len; /* Count the number of lines in the body. If * the text ends with a \n, this will be one @@ -328,21 +328,15 @@ mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...) for (s = text, lines = 0; s; s = strchr (s + 1, '\n')) lines++; - offset = credits ? strlen (credits) : 0; - /* offset is the size of the credits, strlen (text) * covers the body, lines * 2 does the "> "s, and * the last +2 covers the final "\0", plus an extra * "\n" in case text doesn't end with one. */ - quoted_text = g_malloc (offset + strlen (text) + - lines * 2 + 2); - - if (credits) - memcpy (quoted_text, credits, offset); + quoted_text = g_malloc (strlen (text) + lines * 2 + 2); s = text; - d = quoted_text + offset; + d = quoted_text; /* Copy text to quoted_text line by line, * prepending "> ". @@ -360,14 +354,21 @@ mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...) *d = '\0'; /* Now convert that to HTML. */ - ret_text = e_text_to_html_full (quoted_text, E_TEXT_TO_HTML_PRE - | (mail_config_get_citation_highlight () - ? E_TEXT_TO_HTML_MARK_CITATION : 0), - mail_config_get_citation_color ()); + orig_text = e_text_to_html_full (quoted_text, E_TEXT_TO_HTML_PRE + | (mail_config_get_citation_highlight () + ? E_TEXT_TO_HTML_MARK_CITATION : 0), + mail_config_get_citation_color ()); g_free (quoted_text); + ret_text = g_strdup_printf ("%s<!--+GtkHTML:<DATA class=\"ClueFlow\" key=\"orig\" value=\"1\">-->" + "%s" + "<!--+GtkHTML:<DATA class=\"ClueFlow\" clear=\"orig\">-->", + credits ? credits : "", + orig_text); + g_free (orig_text); } g_free (text); + printf ("ret: %s\n", ret_text); return ret_text; } |