aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-autofilter.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-autofilter.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-autofilter.c')
-rw-r--r--mail/mail-autofilter.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index d4b537ab31..d1a1795f48 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -217,25 +217,20 @@ rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg
}
/* should parse the from address into an internet address? */
if (flags & AUTO_FROM) {
- struct _header_address *haddr, *scan;
- char *name, *namestr;
-
- haddr = header_address_decode (msg->from);
- scan = haddr;
- while (scan) {
- if (scan->type == HEADER_ADDRESS_NAME) {
- rule_add_sender (context, rule, scan->v.addr);
- if (scan->name && scan->name[0])
- name = scan->name;
- else
- name = scan->v.addr;
- namestr = g_strdup_printf (_("Mail from %s"), name);
- filter_rule_set_name (rule, namestr);
- g_free (namestr);
- }
- scan = scan->next;
+ const CamelInternetAddress *from;
+ int i;
+ const char *name, *addr;
+ char *namestr;
+
+ from = camel_mime_message_get_from(msg);
+ for (i=0;camel_internet_address_get(from, i, &name, &addr); i++) {
+ rule_add_sender(context, rule, addr);
+ if (name==NULL || name[0]==0)
+ name = addr;
+ namestr = g_strdup_printf(_("Mail from %s"), name);
+ filter_rule_set_name(rule, namestr);
+ g_free(namestr);
}
- header_address_unref (haddr);
}
if (flags & AUTO_TO) {
addr = (CamelInternetAddress *)camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_TO);