diff options
author | Milan Crha <mcrha@redhat.com> | 2013-01-18 03:07:03 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-01-18 03:07:03 +0800 |
commit | 37699de983b6085e5be6a92eafbee07bdcc70854 (patch) | |
tree | b1fe19e92719c0916176cdb9e8e44d0c8ac383d7 /em-format/e-mail-part-utils.c | |
parent | af24ac867a7a92f7c091185c8332655965fe662a (diff) | |
download | gsoc2013-evolution-37699de983b6085e5be6a92eafbee07bdcc70854.tar gsoc2013-evolution-37699de983b6085e5be6a92eafbee07bdcc70854.tar.gz gsoc2013-evolution-37699de983b6085e5be6a92eafbee07bdcc70854.tar.bz2 gsoc2013-evolution-37699de983b6085e5be6a92eafbee07bdcc70854.tar.lz gsoc2013-evolution-37699de983b6085e5be6a92eafbee07bdcc70854.tar.xz gsoc2013-evolution-37699de983b6085e5be6a92eafbee07bdcc70854.tar.zst gsoc2013-evolution-37699de983b6085e5be6a92eafbee07bdcc70854.zip |
Bug #691732 - multipart/related hides attachments
Diffstat (limited to 'em-format/e-mail-part-utils.c')
-rw-r--r-- | em-format/e-mail-part-utils.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c index 2e2b5f66f2..4fa7a854a0 100644 --- a/em-format/e-mail-part-utils.c +++ b/em-format/e-mail-part-utils.c @@ -552,3 +552,31 @@ e_mail_part_is_inline (CamelMimePart *mime_part, /* Otherwise, use the default for this handler type. */ return (class->flags & E_MAIL_PARSER_EXTENSION_INLINE) != 0; } + +/** + * e_mail_part_utils_body_refers: + * @body: text body to search for references in; can be %NULL, then returns %FALSE + * @cid: a Content-ID to search for; if found in body, it should be of form "cid:xxxxx"; can be %NULL + * + * Returns whether @body contains a reference to @cid enclosed in quotes; + * returns %FALSE if any of the arguments is %NULL. + **/ +gboolean +e_mail_part_utils_body_refers (const gchar *body, + const gchar *cid) +{ + const gchar *ptr; + + if (!body || !cid || !*cid) + return FALSE; + + ptr = body; + while (ptr = strstr (ptr, cid), ptr != NULL) { + if (ptr - body > 1 && ptr[-1] == '\"' && ptr[strlen (cid)] == '\"') + return TRUE; + + ptr++; + } + + return FALSE; +} |