From 2c0ce47a992b68ccfe06d6b3da22da3aec07e872 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Thu, 24 Jan 2008 03:03:46 +0000 Subject: ** Fix for bug #510779 2008-01-24 Srinivasa Ragavan ** Fix for bug #510779 * em-mailer-prefs.c: (jh_tree_refill), (jh_add_cb), (jh_remove_cb), (init_junk_tree), (custom_junk_button_toggled), (em_mailer_prefs_construct): Added UI for the new junk preferences. * em-mailer-prefs.h: * evolution-mail.schemas.in: Add schema for junk header and address lookup. * mail-config.c: (gconf_jh_check_changed), (gconf_lookup_book_changed), (gconf_jh_headers_changed), (mail_config_init), (mail_config_reload_junk_headers), (mail_config_get_lookup_book): * mail-config.glade: * mail-config.h: * mail-session.c: (class_init), (lookup_addressbook), (mail_session_init), (mail_session_set_junk_headers): * mail-session.h: 2008-01-22 Srinivasa Ragavan ** Fix for bug #405777 * em-folder-view.c: (emfv_setup_view_instance), (emfv_setting_notify): Don't break abstraction. Call the right derived class. svn path=/trunk/; revision=34873 --- mail/mail-session.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 9ff70224ca..793796f330 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -86,6 +86,7 @@ static char *get_password(CamelSession *session, CamelService *service, const ch static void forget_password(CamelSession *session, CamelService *service, const char *domain, const char *item, CamelException *ex); static gboolean alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel); static CamelFilterDriver *get_filter_driver(CamelSession *session, const char *type, CamelException *ex); +static gboolean lookup_addressbook(CamelSession *session, const char *name); static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc); static void *ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size); @@ -117,7 +118,7 @@ class_init (MailSessionClass *mail_session_class) camel_session_class->forget_password = forget_password; camel_session_class->alert_user = alert_user; camel_session_class->get_filter_driver = get_filter_driver; - + camel_session_class->lookup_addressbook = lookup_addressbook; camel_session_class->thread_msg_new = ms_thread_msg_new; camel_session_class->thread_msg_free = ms_thread_msg_free; camel_session_class->thread_status = ms_thread_status; @@ -376,6 +377,23 @@ static MailMsgInfo user_message_info = { (MailMsgFreeFunc) user_message_free }; +static gboolean +lookup_addressbook(CamelSession *session, const char *name) +{ + CamelInternetAddress *addr; + gboolean ret; + + if (!mail_config_get_lookup_book ()) + return FALSE; + + addr = camel_internet_address_new (); + camel_address_decode ((CamelAddress *)addr, name); + ret = em_utils_in_addressbook(addr); + camel_object_unref (addr); + + return ret; +} + static gboolean alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel) { @@ -679,7 +697,7 @@ mail_session_init (const char *base_directory) /* The shell will tell us to go online. */ camel_session_set_online ((CamelSession *) session, FALSE); - + mail_config_reload_junk_headers (); g_free (camel_dir); } @@ -760,3 +778,12 @@ mail_session_get_junk_plugins (void) MailSession *ms = (MailSession *) session; return ms->junk_plugins; } + +void +mail_session_set_junk_headers (const char **name, const char **value, int len) +{ + if (!session) + return; + + camel_session_set_junk_headers (session, name, value, len); +} -- cgit v1.2.3