Revision 3222
| libsylph/filter.c (revision 3222) | ||
|---|---|---|
| 1586 | 1586 |
debug_print("filter_junk_rule_create: junk folder: %s\n",
|
| 1587 | 1587 |
junk_id); |
| 1588 | 1588 |
|
| 1589 |
if (prefs_common.nofilter_junk_sender_in_book) {
|
|
| 1590 |
cond = filter_cond_new(FLT_COND_HEADER, FLT_IN_ADDRESSBOOK, |
|
| 1591 |
FLT_NOT_MATCH, "From", NULL); |
|
| 1592 |
cond_list = g_slist_append(cond_list, cond); |
|
| 1593 |
} |
|
| 1594 |
|
|
| 1589 | 1595 |
cond = filter_cond_new(FLT_COND_CMD_TEST, 0, 0, NULL, |
| 1590 | 1596 |
prefs_common.junk_classify_cmd); |
| 1591 |
cond_list = g_slist_append(NULL, cond); |
|
| 1597 |
cond_list = g_slist_append(cond_list, cond); |
|
| 1598 |
|
|
| 1592 | 1599 |
if (prefs_common.delete_junk_on_recv && !is_manual) {
|
| 1593 | 1600 |
action = filter_action_new(FLT_ACTION_COPY, junk_id); |
| 1594 | 1601 |
action_list = g_slist_append(NULL, action); |
| ... | ... | |
| 1605 | 1612 |
} |
| 1606 | 1613 |
|
| 1607 | 1614 |
if (is_manual) |
| 1608 |
rule = filter_rule_new(_("Junk mail filter (manual)"), FLT_OR,
|
|
| 1615 |
rule = filter_rule_new(_("Junk mail filter (manual)"), FLT_AND,
|
|
| 1609 | 1616 |
cond_list, action_list); |
| 1610 | 1617 |
else |
| 1611 |
rule = filter_rule_new(_("Junk mail filter"), FLT_OR,
|
|
| 1618 |
rule = filter_rule_new(_("Junk mail filter"), FLT_AND,
|
|
| 1612 | 1619 |
cond_list, action_list); |
| 1613 | 1620 |
|
| 1614 | 1621 |
g_free(junk_id); |
| libsylph/prefs_common.c (revision 3222) | ||
|---|---|---|
| 393 | 393 |
P_BOOL}, |
| 394 | 394 |
{"delete_junk_on_receive", "TRUE", &prefs_common.delete_junk_on_recv,
|
| 395 | 395 |
P_BOOL}, |
| 396 |
{"nofilter_junk_sender_in_book", "TRUE",
|
|
| 397 |
&prefs_common.nofilter_junk_sender_in_book, P_BOOL}, |
|
| 396 | 398 |
{"mark_junk_as_read", "FALSE", &prefs_common.mark_junk_as_read, P_BOOL},
|
| 397 | 399 |
|
| 398 | 400 |
/* Privacy */ |
| libsylph/prefs_common.h (revision 3222) | ||
|---|---|---|
| 343 | 343 |
gint attach_toolbutton_pos; /* Message - Attachment */ |
| 344 | 344 |
|
| 345 | 345 |
gboolean enable_newmsg_notify_window; /* Receive */ |
| 346 |
|
|
| 347 |
gboolean nofilter_junk_sender_in_book; /* Junk Mail */ |
|
| 346 | 348 |
}; |
| 347 | 349 |
|
| 348 | 350 |
extern PrefsCommon prefs_common; |
| src/prefs_common_dialog.c (revision 3222) | ||
|---|---|---|
| 194 | 194 |
GtkWidget *chkbtn_filter_on_recv; |
| 195 | 195 |
GtkWidget *chkbtn_filter_before; |
| 196 | 196 |
GtkWidget *chkbtn_delete_on_recv; |
| 197 |
GtkWidget *chkbtn_nofilter_in_book; |
|
| 197 | 198 |
GtkWidget *chkbtn_mark_as_read; |
| 198 | 199 |
} junk; |
| 199 | 200 |
|
| ... | ... | |
| 515 | 516 |
prefs_set_data_from_toggle, prefs_set_toggle}, |
| 516 | 517 |
{"delete_junk_on_receive", &junk.chkbtn_delete_on_recv,
|
| 517 | 518 |
prefs_set_data_from_toggle, prefs_set_toggle}, |
| 519 |
{"nofilter_junk_sender_in_book", &junk.chkbtn_nofilter_in_book,
|
|
| 520 |
prefs_set_data_from_toggle, prefs_set_toggle}, |
|
| 518 | 521 |
{"mark_junk_as_read", &junk.chkbtn_mark_as_read,
|
| 519 | 522 |
prefs_set_data_from_toggle, prefs_set_toggle}, |
| 520 | 523 |
|
| ... | ... | |
| 2246 | 2249 |
GtkWidget *chkbtn_filter_on_recv; |
| 2247 | 2250 |
GtkWidget *chkbtn_filter_before; |
| 2248 | 2251 |
GtkWidget *chkbtn_delete_on_recv; |
| 2252 |
GtkWidget *chkbtn_nofilter_in_book; |
|
| 2249 | 2253 |
GtkWidget *chkbtn_mark_as_read; |
| 2250 | 2254 |
|
| 2251 | 2255 |
vbox1 = gtk_vbox_new (FALSE, VSPACING); |
| ... | ... | |
| 2379 | 2383 |
SET_TOGGLE_SENSITIVITY (chkbtn_filter_on_recv, chkbtn_filter_before); |
| 2380 | 2384 |
SET_TOGGLE_SENSITIVITY (chkbtn_filter_on_recv, chkbtn_delete_on_recv); |
| 2381 | 2385 |
|
| 2386 |
PACK_CHECK_BUTTON |
|
| 2387 |
(vbox3, chkbtn_nofilter_in_book, |
|
| 2388 |
_("Do not classify message as junk if sender is in the address book"));
|
|
| 2382 | 2389 |
PACK_CHECK_BUTTON (vbox3, chkbtn_mark_as_read, |
| 2383 | 2390 |
_("Mark filtered junk mails as read"));
|
| 2384 | 2391 |
|
| 2385 |
junk.chkbtn_enable_junk = chkbtn_enable_junk; |
|
| 2386 |
junk.entry_junk_learncmd = entry_junk_learncmd; |
|
| 2387 |
junk.entry_nojunk_learncmd = entry_nojunk_learncmd; |
|
| 2388 |
junk.entry_classify_cmd = entry_classify_cmd; |
|
| 2389 |
junk.entry_junkfolder = entry_junkfolder; |
|
| 2390 |
junk.chkbtn_filter_on_recv = chkbtn_filter_on_recv; |
|
| 2391 |
junk.chkbtn_filter_before = chkbtn_filter_before; |
|
| 2392 |
junk.chkbtn_delete_on_recv = chkbtn_delete_on_recv; |
|
| 2393 |
junk.chkbtn_mark_as_read = chkbtn_mark_as_read; |
|
| 2392 |
junk.chkbtn_enable_junk = chkbtn_enable_junk; |
|
| 2393 |
junk.entry_junk_learncmd = entry_junk_learncmd; |
|
| 2394 |
junk.entry_nojunk_learncmd = entry_nojunk_learncmd; |
|
| 2395 |
junk.entry_classify_cmd = entry_classify_cmd; |
|
| 2396 |
junk.entry_junkfolder = entry_junkfolder; |
|
| 2397 |
junk.chkbtn_filter_on_recv = chkbtn_filter_on_recv; |
|
| 2398 |
junk.chkbtn_filter_before = chkbtn_filter_before; |
|
| 2399 |
junk.chkbtn_delete_on_recv = chkbtn_delete_on_recv; |
|
| 2400 |
junk.chkbtn_nofilter_in_book = chkbtn_nofilter_in_book; |
|
| 2401 |
junk.chkbtn_mark_as_read = chkbtn_mark_as_read; |
|
| 2394 | 2402 |
} |
| 2395 | 2403 |
|
| 2396 | 2404 |
#if USE_GPGME |
| ChangeLog (revision 3222) | ||
|---|---|---|
| 1 | 1 |
2013-02-14 |
| 2 | 2 |
|
| 3 |
* libsylph/filter.c |
|
| 4 |
libsylph/prefs_common.[ch] |
|
| 5 |
src/prefs_common_dialog.c: added an option: "Do not classify message |
|
| 6 |
as junk if sender is in the address book" (#77). |
|
| 7 |
|
|
| 8 |
2013-02-14 |
|
| 9 |
|
|
| 3 | 10 |
* src/notificationwindow.c: adjusted paddings again. |
| 4 | 11 |
plugin/test/test.c: modified notification test. |
| 5 | 12 |
|
Also available in: Unified diff