diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-11-26 22:18:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-11-26 23:41:49 +0800 |
commit | 3cd87037bc025819567e28b3da1013414a1b93d7 (patch) | |
tree | fddb6b58e3b37a1e5973b6006953c163e2792c94 | |
parent | 8ad95dd7d9772190adff105f9c39d65a02f258b2 (diff) | |
download | gsoc2013-evolution-3cd87037bc025819567e28b3da1013414a1b93d7.tar gsoc2013-evolution-3cd87037bc025819567e28b3da1013414a1b93d7.tar.gz gsoc2013-evolution-3cd87037bc025819567e28b3da1013414a1b93d7.tar.bz2 gsoc2013-evolution-3cd87037bc025819567e28b3da1013414a1b93d7.tar.lz gsoc2013-evolution-3cd87037bc025819567e28b3da1013414a1b93d7.tar.xz gsoc2013-evolution-3cd87037bc025819567e28b3da1013414a1b93d7.tar.zst gsoc2013-evolution-3cd87037bc025819567e28b3da1013414a1b93d7.zip |
Add e_mail_session_get_junk_filter_by_name().
Looks up an EMailJunkFilter extension by its filter name, as specified
in its class structure.
-rw-r--r-- | doc/reference/evolution-mail-engine/evolution-mail-engine-sections.txt | 1 | ||||
-rw-r--r-- | libemail-engine/e-mail-session.c | 21 | ||||
-rw-r--r-- | libemail-engine/e-mail-session.h | 5 |
3 files changed, 26 insertions, 1 deletions
diff --git a/doc/reference/evolution-mail-engine/evolution-mail-engine-sections.txt b/doc/reference/evolution-mail-engine/evolution-mail-engine-sections.txt index eb36ce761a..4eae9c7012 100644 --- a/doc/reference/evolution-mail-engine/evolution-mail-engine-sections.txt +++ b/doc/reference/evolution-mail-engine/evolution-mail-engine-sections.txt @@ -85,6 +85,7 @@ EMailLocalFolder e_mail_session_get_local_folder e_mail_session_get_local_folder_uri e_mail_session_get_available_junk_filters +e_mail_session_get_junk_filter_by_name e_mail_session_get_inbox_sync e_mail_session_get_inbox e_mail_session_get_inbox_finish diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c index 0c594ac476..7cffcc514f 100644 --- a/libemail-engine/e-mail-session.c +++ b/libemail-engine/e-mail-session.c @@ -53,7 +53,6 @@ #include "camel-sasl-xoauth2.h" #include "e-mail-authenticator.h" -#include "e-mail-junk-filter.h" #include "e-mail-session.h" #include "e-mail-folder-utils.h" #include "e-mail-utils.h" @@ -2149,6 +2148,26 @@ e_mail_session_get_available_junk_filters (EMailSession *session) return g_list_sort (list, (GCompareFunc) e_mail_junk_filter_compare); } +/** + * e_mail_session_get_junk_filter_by_name: + * @session: an #EMailSession + * @filter_name: a junk filter name + * + * Looks up an #EMailJunkFilter extension by its filter name, as specified + * in its class structure. If no match is found, the function returns %NULL. + * + * Returns: an #EMailJunkFilter, or %NULL + **/ +EMailJunkFilter * +e_mail_session_get_junk_filter_by_name (EMailSession *session, + const gchar *filter_name) +{ + g_return_val_if_fail (E_IS_MAIL_SESSION (session), NULL); + g_return_val_if_fail (filter_name != NULL, NULL); + + return g_hash_table_lookup (session->priv->junk_filters, filter_name); +} + static void mail_session_get_inbox_thread (GSimpleAsyncResult *simple, EMailSession *session, diff --git a/libemail-engine/e-mail-session.h b/libemail-engine/e-mail-session.h index 68dd125a35..d2981de28b 100644 --- a/libemail-engine/e-mail-session.h +++ b/libemail-engine/e-mail-session.h @@ -32,6 +32,7 @@ #include <camel/camel.h> #include <libedataserver/libedataserver.h> #include <libemail-engine/e-mail-engine-enums.h> +#include <libemail-engine/e-mail-junk-filter.h> #include <libemail-engine/em-vfolder-context.h> #include <libemail-engine/mail-folder-cache.h> @@ -100,6 +101,10 @@ const gchar * e_mail_session_get_local_folder_uri EMailLocalFolder type); GList * e_mail_session_get_available_junk_filters (EMailSession *session); +EMailJunkFilter * + e_mail_session_get_junk_filter_by_name + (EMailSession *session, + const gchar *filter_name); CamelFolder * e_mail_session_get_inbox_sync (EMailSession *session, const gchar *service_uid, GCancellable *cancellable, |