aboutsummaryrefslogtreecommitdiff
path: root/src/compose.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-04-24 06:07:10 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-04-24 06:07:10 +0000
commita1d16d5c974ca414b1b6234bfd34c78ae0f97d18 (patch)
tree43a45cb0494793d76b6e5f1466d217d6aecc1530 /src/compose.c
parent8390e12e45f209a0174318ed529068595c7f70d3 (diff)
added option of excluded addresses/domains for recipients confirmation.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1985 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/compose.c')
-rw-r--r--src/compose.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/compose.c b/src/compose.c
index 8df6a948..b6b496ce 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -2972,6 +2972,7 @@ static gboolean compose_check_recipients(Compose *compose)
GtkStyle *style;
GSList *cur, *to_list = NULL;
+ gboolean check_recp = FALSE;
gint state = 0;
g_return_val_if_fail(compose->account != NULL, FALSE);
@@ -2980,6 +2981,51 @@ static gboolean compose_check_recipients(Compose *compose)
if (!prefs_common.check_recipients)
return TRUE;
+ if (prefs_common.check_recp_exclude) {
+ gchar **strv;
+ gint i;
+
+ strv = g_strsplit(prefs_common.check_recp_exclude, ",", -1);
+ for (i = 0; strv[i] != NULL; i++)
+ g_strstrip(strv[i]);
+
+ if (compose->use_to) {
+ text = gtk_entry_get_text(GTK_ENTRY(compose->to_entry));
+ to_list = address_list_append_orig(NULL, text);
+ }
+ if (compose->use_cc) {
+ text = gtk_entry_get_text(GTK_ENTRY(compose->cc_entry));
+ to_list = address_list_append_orig(to_list, text);
+ }
+ if (compose->use_bcc) {
+ text = gtk_entry_get_text(GTK_ENTRY(compose->bcc_entry));
+ to_list = address_list_append_orig(to_list, text);
+ }
+
+ for (cur = to_list; cur != NULL; cur = cur->next) {
+ for (i = 0; strv[i] != NULL; i++) {
+ if (strv[i][0] == '\0')
+ continue;
+ if (strcasestr((gchar *)cur->data, strv[i]))
+ break;
+ }
+ if (!strv[i]) {
+ /* not found in exclude list */
+ check_recp = TRUE;
+ break;
+ }
+ }
+
+ slist_free_strings(to_list);
+ g_slist_free(to_list);
+ to_list = NULL;
+ g_strfreev(strv);
+ } else
+ check_recp = TRUE;
+
+ if (!check_recp)
+ return TRUE;
+
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
gtk_window_set_title(GTK_WINDOW(window), _("Check recipients"));