diff options
author | Milan Crha <mcrha@redhat.com> | 2011-03-10 00:41:47 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:44 +0800 |
commit | 45c0f292624ea40f8b0debf7b5a5f60053c419ef (patch) | |
tree | 9ba01c91fbe1dff3d3990b36257da996f80e3d36 /em-format/em-stripsig-filter.c | |
parent | b100e5d4ae046b7620139aa9437401cb5395aec4 (diff) | |
download | gsoc2013-evolution-45c0f292624ea40f8b0debf7b5a5f60053c419ef.tar gsoc2013-evolution-45c0f292624ea40f8b0debf7b5a5f60053c419ef.tar.gz gsoc2013-evolution-45c0f292624ea40f8b0debf7b5a5f60053c419ef.tar.bz2 gsoc2013-evolution-45c0f292624ea40f8b0debf7b5a5f60053c419ef.tar.lz gsoc2013-evolution-45c0f292624ea40f8b0debf7b5a5f60053c419ef.tar.xz gsoc2013-evolution-45c0f292624ea40f8b0debf7b5a5f60053c419ef.tar.zst gsoc2013-evolution-45c0f292624ea40f8b0debf7b5a5f60053c419ef.zip |
Bug #586461 - Remove signature also from HTML formatted emails on reply
Diffstat (limited to 'em-format/em-stripsig-filter.c')
-rw-r--r-- | em-format/em-stripsig-filter.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/em-format/em-stripsig-filter.c b/em-format/em-stripsig-filter.c index 38b74b8f9f..bbca2f6161 100644 --- a/em-format/em-stripsig-filter.c +++ b/em-format/em-stripsig-filter.c @@ -61,6 +61,9 @@ strip_signature (CamelMimeFilter *filter, if ((inend - inptr) >= 4 && !strncmp (inptr, "-- \n", 4)) { start = inptr; inptr += 4; + } else if (!stripsig->text_plain_only && (inend - inptr) >= 7 && !g_ascii_strncasecmp (inptr, "-- <BR>", 7)) { + start = inptr; + inptr += 7; } else { while (inptr < inend && *inptr != '\n') inptr++; @@ -142,13 +145,19 @@ em_stripsig_filter_init (EMStripSigFilter *filter) /** * em_stripsig_filter_new: + * @text_plain_only: Whether should look for a text/plain signature + * delimiter "-- \n" only or also an HTML signature delimiter "-- <BR>". * * Creates a new stripsig filter. * * Returns a new stripsig filter. **/ CamelMimeFilter * -em_stripsig_filter_new (void) +em_stripsig_filter_new (gboolean text_plain_only) { - return g_object_new (EM_TYPE_STRIPSIG_FILTER, NULL); + EMStripSigFilter *filter = g_object_new (EM_TYPE_STRIPSIG_FILTER, NULL); + + filter->text_plain_only = text_plain_only; + + return CAMEL_MIME_FILTER (filter); } |