diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-04-03 17:14:16 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-04-03 17:14:16 +0800 |
commit | 1e8c2df476794bcb93962ec65ccbe5e1e8e33f66 (patch) | |
tree | 03e885101854c1ce0d98aa9b005c856cce421c4c /mail/mail-session.c | |
parent | 8a5e6ecc960889f624419b0e88dbb231a4b667cc (diff) | |
download | gsoc2013-evolution-1e8c2df476794bcb93962ec65ccbe5e1e8e33f66.tar.gz gsoc2013-evolution-1e8c2df476794bcb93962ec65ccbe5e1e8e33f66.tar.zst gsoc2013-evolution-1e8c2df476794bcb93962ec65ccbe5e1e8e33f66.zip |
Add pluggable junk filter code and move SA options to the plugins.
svn path=/trunk/; revision=33367
Diffstat (limited to 'mail/mail-session.c')
-rw-r--r-- | mail/mail-session.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mail/mail-session.c b/mail/mail-session.c index ee5febe99d..174df09224 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -68,6 +68,7 @@ typedef struct _MailSession { gboolean interactive; FILE *filter_logfile; + GList *junk_plugins; MailAsyncEvent *async; } MailSession; @@ -92,6 +93,7 @@ static void init (MailSession *session) { session->async = mail_async_event_new(); + session->junk_plugins = NULL; } static void @@ -712,3 +714,31 @@ mail_session_flush_filter_log (void) if (ms->filter_logfile) fflush (ms->filter_logfile); } + +void +mail_session_add_junk_plugin (const char *plugin_name, CamelJunkPlugin *junk_plugin) +{ + MailSession *ms = (MailSession *) session; + GConfClient *gconf; + char *def_plugin; + + gconf = mail_config_get_gconf_client (); + def_plugin = gconf_client_get_string (gconf, "/apps/evolution/mail/junk/default_plugin", NULL); + + ms->junk_plugins = g_list_append(ms->junk_plugins, junk_plugin); + if (def_plugin && plugin_name) { + if (!strcmp(def_plugin, plugin_name)) { + printf("Loading %s as the default junk plugin\n"); + session->junk_plugin = junk_plugin; + } + } + + g_free (def_plugin); +} + +const GList * +mail_session_get_junk_plugins () +{ + MailSession *ms = (MailSession *) session; + return ms->junk_plugins; +} |