diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-02-09 10:51:22 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-02-09 10:51:22 +0800 |
commit | 210c0386a9d86c229c6283b349fb92d13b08baed (patch) | |
tree | 8ef50847b82d75733eca418a4efe2b431fbe07c4 /mail/mail-format.c | |
parent | ffaad625fc8d2c14e41d4bb70352ee4a57ddf52e (diff) | |
download | gsoc2013-evolution-210c0386a9d86c229c6283b349fb92d13b08baed.tar.gz gsoc2013-evolution-210c0386a9d86c229c6283b349fb92d13b08baed.tar.zst gsoc2013-evolution-210c0386a9d86c229c6283b349fb92d13b08baed.zip |
New location for this function.
2001-02-08 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (mail_generate_reply): New location for this
function.
* mail-format.c: Removed mail_generate_reply as it's ONLY ever
used in mail-callbacks.c.
* mail-ops.c (fetch_mail_fetch): Reworked some keep-mail-on-server
logic so that we ALWAYS look for a cached array of UIDs that we
may have downloaded previously so as not to download them again
even if we will be deleting them off the server. This fixes bug
#1344.
svn path=/trunk/; revision=8137
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r-- | mail/mail-format.c | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c index 8200fc5d8c..a580796e4d 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -1769,131 +1769,3 @@ mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean *is return text; } - -static void -free_recipients (GList *list) -{ - GList *l; - - for (l = list; l; l = l->next) - g_free (l->data); - g_list_free (list); -} - -static GList * -list_add_addresses(GList *list, const CamelInternetAddress *cia, const char *notme) -{ - int i; - const char *name, *addr; - char *full; - - for (i=0;camel_internet_address_get(cia, i, &name, &addr);i++) { - /* now, we format this, as if for display, but does the composer - then use it as a real address? If so, very broken. */ - /* we should probably pass around CamelAddresse's if thats what - we mean */ - full = camel_internet_address_format_address(name, addr); - - /* Here I'll check to see if the cc:'d address is the address - of the sender, and if so, don't add it to the cc: list; this - is to fix Bugzilla bug #455. */ - - if (notme && strcmp(addr, notme) == 0) - g_free(full); - else - list = g_list_append(list, full); - } - - return list; -} - -EMsgComposer * -mail_generate_reply (CamelMimeMessage *message, gboolean to_all) -{ - char *text, *subject, *date_str; - EMsgComposer *composer; - const char *message_id, *references; - const char *name = NULL, *address = NULL; - GList *to = NULL, *cc = NULL; - const MailConfigIdentity *id; - gchar *sig_file = NULL; - const CamelInternetAddress *reply_to, *sender; - time_t date; - int offset; - - id = mail_config_get_default_identity (); - if (id) - sig_file = id->signature; - - composer = e_msg_composer_new_with_sig_file (sig_file, mail_config_get_send_html ()); - if (!composer) - return NULL; - - /* FIXME: should probably use a shorter date string */ - sender = camel_mime_message_get_from (message); - 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); - 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 */ - reply_to = camel_mime_message_get_reply_to(message); - if (!reply_to) - reply_to = camel_mime_message_get_from(message); - if (reply_to) - to = g_list_append(to, camel_address_format((CamelAddress *)reply_to)); - - if (to_all) { - cc = list_add_addresses(cc, - camel_mime_message_get_recipients(message, CAMEL_RECIPIENT_TYPE_TO), - id->address); - cc = list_add_addresses(cc, - camel_mime_message_get_recipients(message, CAMEL_RECIPIENT_TYPE_CC), - id->address); - } - - /* Set the subject of the new message. */ - subject = (char *)camel_mime_message_get_subject (message); - if (!subject) - subject = g_strdup (""); - else { - if (!g_strncasecmp (subject, "Re: ", 4)) - subject = g_strdup (subject); - else - subject = g_strdup_printf ("Re: %s", subject); - } - - e_msg_composer_set_headers (composer, to, cc, NULL, subject); - free_recipients (to); - free_recipients (cc); - g_free (subject); - - /* Add In-Reply-To and References. */ - message_id = camel_medium_get_header (CAMEL_MEDIUM (message), - "Message-Id"); - references = camel_medium_get_header (CAMEL_MEDIUM (message), - "References"); - if (message_id) { - e_msg_composer_add_header (composer, "In-Reply-To", - message_id); - if (references) { - char *reply_refs; - reply_refs = g_strdup_printf ("%s %s", references, - message_id); - e_msg_composer_add_header (composer, "References", - reply_refs); - g_free (reply_refs); - } - } else if (references) { - e_msg_composer_add_header (composer, "References", references); - } - - return composer; -} |