aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-11-07 20:33:01 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-11-07 20:33:01 +0800
commit25dcc0b87ac3ab29a4cc35ded91386558b4bc637 (patch)
tree302285e291ac4037ecf507720f46b0bd08716a00 /mail/mail-tools.c
parentc70c4c35f3788bb210b6f01205e0bc71b4414c4f (diff)
downloadgsoc2013-evolution-25dcc0b87ac3ab29a4cc35ded91386558b4bc637.tar
gsoc2013-evolution-25dcc0b87ac3ab29a4cc35ded91386558b4bc637.tar.gz
gsoc2013-evolution-25dcc0b87ac3ab29a4cc35ded91386558b4bc637.tar.bz2
gsoc2013-evolution-25dcc0b87ac3ab29a4cc35ded91386558b4bc637.tar.lz
gsoc2013-evolution-25dcc0b87ac3ab29a4cc35ded91386558b4bc637.tar.xz
gsoc2013-evolution-25dcc0b87ac3ab29a4cc35ded91386558b4bc637.tar.zst
gsoc2013-evolution-25dcc0b87ac3ab29a4cc35ded91386558b4bc637.zip
God, I sure wish people would listen when i'm saying i'm changing and API.
2000-11-07 Not Zed <NotZed@HelixCode.com> * mail-display.c (on_object_requested): God, I sure wish people would listen when i'm saying i'm changing and API. I mean I even mailed everyone and everything. Can't see any changelog either. 2000-11-06 Not Zed <NotZed@HelixCode.com> * mail-autofilter.c (rule_from_message): Updates for api changes. * mail-tools.c (mail_tool_generate_forward_subject): Fixed for api changes. Sigh, whoever wrote the multithread code of the mailer, had little idea. You can't just lock for getting a const value, until you are finished with it, cause the owner still owns it. Fixed this too. Yuck, what a horrid forwarding format, can we change this, or make it configurable? The mail headers show who forwarded it, we dont need to duplicate it in that UGLY subject. * mail-format.c (write_field_to_stream): Removed some jeffness. dont g_strdup stuff we dont need to, and remove the value_is_encoded thing since we can get the unencoded address now. (write_address): New function to write an address field. (write_headers): Uses write_address to write addresses, cleaner, fixed the god-awful unreadable indenting too. (handle_text_plain): Use a 'smarter' printf format, so we dont need to allocate and copy substrings unecessarily (esp since they're about to be allocated any copied another few times anyway *sigh*). (write_field_to_stream): Commented out the isprint check, which afaik serves no purpose. (list_add_addresses): New function to build a list of display-ready addresses. Although I think the composer then uses these as internet-ready addresses. It should probably take a list of CamelAddress's if thats what it wants. (mail_generate_reply): Cleaned up the address list creation stuff a heap, and fixes for camel api changes. Also fixed a small memory leak as a side effect (fulladdr wasn't freed if it was the same as the sender). * mail-display.c (on_object_requested): Changed for interface changes to the from address. I think passing the encoded (internet version) of the address is right here. svn path=/trunk/; revision=6475
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 0ab7862200..25b353016e 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -345,25 +345,29 @@ mail_tool_set_uid_flags (CamelFolder *folder, const char *uid, guint32 mask, gui
mail_tool_camel_lock_down ();
}
-gchar *
+char *
mail_tool_generate_forward_subject (CamelMimeMessage *msg)
{
- const gchar *from;
- const gchar *subject;
- gchar *fwd_subj;
+ const char *subject;
+ char *fwd_subj, *fromstr;
+ const CamelInternetAddress *from;
+ /* we need to lock around the whole function, as we are
+ only getting references to the message's data */
mail_tool_camel_lock_up();
- from = camel_mime_message_get_from (msg);
- subject = camel_mime_message_get_subject (msg);
- mail_tool_camel_lock_down();
+
+ from = camel_mime_message_get_from(msg);
+ subject = camel_mime_message_get_subject(msg);
if (from) {
+ fromstr = camel_address_format((CamelAddress *)from);
if (subject && *subject) {
- fwd_subj = g_strdup_printf ("[%s] %s", from, subject);
+ fwd_subj = g_strdup_printf ("[%s] %s", fromstr, subject);
} else {
fwd_subj = g_strdup_printf (_("[%s] (forwarded message)"),
- from);
+ fromstr);
}
+ g_free(fromstr);
} else {
if (subject && *subject) {
if (strncmp (subject, "Fwd: ", 5) == 0)
@@ -373,6 +377,8 @@ mail_tool_generate_forward_subject (CamelMimeMessage *msg)
fwd_subj = g_strdup (_("Fwd: (no subject)"));
}
+ mail_tool_camel_lock_down();
+
return fwd_subj;
}