2 * e-mail-parser-source.c
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #include "evolution-config.h"
20 #include <glib/gi18n-lib.h>
22 #include <e-util/e-util.h>
24 #include "e-mail-parser-extension.h"
26 typedef EMailParserExtension EMailParserSource
;
27 typedef EMailParserExtensionClass EMailParserSourceClass
;
29 GType
e_mail_parser_source_get_type (void);
34 E_TYPE_MAIL_PARSER_EXTENSION
)
36 static const gchar
*parser_mime_types
[] = {
37 "application/vnd.evolution.source",
42 empe_source_parse (EMailParserExtension
*extension
,
46 GCancellable
*cancellable
,
47 GQueue
*out_mail_parts
)
53 g_string_append (part_id
, ".source");
55 mail_part
= e_mail_part_new (part
, part_id
->str
);
56 e_mail_part_set_mime_type (mail_part
, parser_mime_types
[0]);
57 g_string_truncate (part_id
, len
);
59 g_queue_push_tail (out_mail_parts
, mail_part
);
65 e_mail_parser_source_class_init (EMailParserExtensionClass
*class)
67 class->mime_types
= parser_mime_types
;
68 class->priority
= G_PRIORITY_LOW
;
69 class->parse
= empe_source_parse
;
73 e_mail_parser_source_init (EMailParserExtension
*extension
)