aboutsummaryrefslogtreecommitdiffstats
path: root/em-format/em-stripsig-filter.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-03-10 00:41:47 +0800
committerMilan Crha <mcrha@redhat.com>2011-03-10 00:41:47 +0800
commiteef2191a3a4fc8bb358b04a1eb0c10ba5f34e611 (patch)
tree26a41b417375f215e3618786de49d6b151a042bf /em-format/em-stripsig-filter.c
parent46a52a54c4c7b3559f135a40d3bd77e644ce73ad (diff)
downloadgsoc2013-evolution-eef2191a3a4fc8bb358b04a1eb0c10ba5f34e611.tar
gsoc2013-evolution-eef2191a3a4fc8bb358b04a1eb0c10ba5f34e611.tar.gz
gsoc2013-evolution-eef2191a3a4fc8bb358b04a1eb0c10ba5f34e611.tar.bz2
gsoc2013-evolution-eef2191a3a4fc8bb358b04a1eb0c10ba5f34e611.tar.lz
gsoc2013-evolution-eef2191a3a4fc8bb358b04a1eb0c10ba5f34e611.tar.xz
gsoc2013-evolution-eef2191a3a4fc8bb358b04a1eb0c10ba5f34e611.tar.zst
gsoc2013-evolution-eef2191a3a4fc8bb358b04a1eb0c10ba5f34e611.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.c13
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);
}