aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-session.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-01-24 11:03:46 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-01-24 11:03:46 +0800
commit2c0ce47a992b68ccfe06d6b3da22da3aec07e872 (patch)
tree1fab9c37a286409e8fc2a89b2be3e2157a6eeeac /mail/mail-session.c
parent06be294b09f6a3d05ad67b7d6c40f9cddd3567e7 (diff)
downloadgsoc2013-evolution-2c0ce47a992b68ccfe06d6b3da22da3aec07e872.tar
gsoc2013-evolution-2c0ce47a992b68ccfe06d6b3da22da3aec07e872.tar.gz
gsoc2013-evolution-2c0ce47a992b68ccfe06d6b3da22da3aec07e872.tar.bz2
gsoc2013-evolution-2c0ce47a992b68ccfe06d6b3da22da3aec07e872.tar.lz
gsoc2013-evolution-2c0ce47a992b68ccfe06d6b3da22da3aec07e872.tar.xz
gsoc2013-evolution-2c0ce47a992b68ccfe06d6b3da22da3aec07e872.tar.zst
gsoc2013-evolution-2c0ce47a992b68ccfe06d6b3da22da3aec07e872.zip
** Fix for bug #510779
2008-01-24 Srinivasa Ragavan <sragavan@novell.com> ** 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 <sragavan@novell.com> ** 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
Diffstat (limited to 'mail/mail-session.c')
-rw-r--r--mail/mail-session.c31
1 files changed, 29 insertions, 2 deletions
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;
@@ -377,6 +378,23 @@ static MailMsgInfo user_message_info = {
};
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)
{
MailSession *mail_session = MAIL_SESSION (session);
@@ -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);
+}