X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mime%2Fmime.cpkg;h=1e976131da5e9dae9bdd9f935acccd2eac3df60f;hp=e953211edbbb1a62102757b5dd39e70b524ad35e;hb=11a177822f648694f442b3038fdc60a4e50e6edb;hpb=98533911b5d5279b6f4574c66f77fbd6c772ac6f diff --git a/lib-mime/mime.cpkg b/lib-mime/mime.cpkg index e953211..1e97613 100644 --- a/lib-mime/mime.cpkg +++ b/lib-mime/mime.cpkg @@ -52,6 +52,8 @@ const char *BodyEncodings[] = { "x-uuencoded", }; +rx_t *SpamList = NULL, *NoSpamList = NULL; + @package Mime { /* ** .pp @@ -62,6 +64,23 @@ const char *BodyEncodings[] = { ** separator. */ string_t spam_separator = m_strdup(","); + + void spam(rx_t rx, const string_t tpl) { + rx_set_template(rx, tpl); + rx_list_append(&SpamList, rx); + RETURN(); + }; + + void nospam(rx_t rx) { + if (!m_strcmp(rx->pattern, "*")) { + rx_list_wipe(&SpamList); + rx_list_wipe(&NoSpamList); + rx_delete(&rx); + } else { + rx_list_append(&NoSpamList, rx); + } + RETURN(); + }; }; /****************************************************************************/