Change GMime dependency from 2.6.17 to 3.2.4

This commit squashes several non-compiling commits:

66dd6500 Change required GMime version to 3.2.4 or higher
4b9c8a38 Fix some compilations errors in test code
98aa5a2e Fix some (hopefully) last compilation errors
558360c6 Fix parser format when getting message headers
cc248ffc Fix name of stream-buffer mode
b293c66b Fix another iteration over a header-list
52fa183f Fix parsing of Gmime parameters
e078ee62 Use Unix2Dos-, Dos2Unix- and/or SmtpData-filters instead of 'FilterCRLF'
ff31b8e5 Fix setting of email headers
eb676482 Fix compilation errros due to string-uint8-char conversion problems
8558769f Fix datetime conversion
d44a28cd Remove some obsolete arguments
1ce81662 Pass charset where it's required
6013806f Pass GMime.ParserOptions to header-decode methods
986d05a0 Pass GMime.FormatOptions where it's required
e9b93187 Pass GMime.ParserOptions where it's required
640ce667 Fix compilation errors in GMime initialization
312f80bf Remove use of GMime.HeaderIter
acc73d14 Change GMime dependency from 2.6 to 3.0
54fc250a Adapt names to 'offical' gmime-2.6 bindings

The commits are part of the branch 'letorbi/gmime-3-spread', which can be
found at: https://gitlab.gnome.org/letorbi/geary/tree/letorbi/gmime-3-spread
This commit is contained in:
Torben 2019-11-30 20:09:28 +01:00
parent fced79bfd2
commit 1aac6f2284
17 changed files with 236 additions and 203 deletions

View file

@ -21,7 +21,7 @@ class Geary.ImapDB.AttachmentTest : TestCase {
public void new_from_minimal_mime_part() throws Error {
GMime.Part part = new_part(null, ATTACHMENT_BODY.data);
part.set_header("Content-Type", "");
part.set_header("Content-Type", "", Geary.RFC822.get_charset());
Attachment test = new Attachment.from_part(
1, new Geary.RFC822.Part(part)
@ -51,7 +51,8 @@ class Geary.ImapDB.AttachmentTest : TestCase {
part.set_content_id(ID);
part.set_content_description(DESC);
part.set_content_disposition(
new GMime.ContentDisposition.from_string(
GMime.ContentDisposition.parse(
Geary.RFC822.get_parser_options(),
"attachment; filename=%s".printf(NAME)
)
);
@ -74,7 +75,10 @@ class Geary.ImapDB.AttachmentTest : TestCase {
public void new_from_inline_mime_part() throws Error {
GMime.Part part = new_part(null, ATTACHMENT_BODY.data);
part.set_content_disposition(
new GMime.ContentDisposition.from_string("inline")
GMime.ContentDisposition.parse(
Geary.RFC822.get_parser_options(),
"inline"
)
);
Attachment test = new Attachment.from_part(
@ -205,7 +209,8 @@ CREATE TABLE MessageAttachmentTable (
part.set_content_id(ID);
part.set_content_description(DESCRIPTION);
part.set_content_disposition(
new GMime.ContentDisposition.from_string(
GMime.ContentDisposition.parse(
Geary.RFC822.get_parser_options(),
"inline; filename=%s;".printf(FILENAME)
));
@ -352,12 +357,15 @@ private GMime.Part new_part(string? mime_type,
GMime.ContentEncoding encoding = GMime.ContentEncoding.DEFAULT) {
GMime.Part part = new GMime.Part();
if (mime_type != null) {
part.set_content_type(new GMime.ContentType.from_string(mime_type));
part.set_content_type(GMime.ContentType.parse(
Geary.RFC822.get_parser_options(),
mime_type
));
}
GMime.DataWrapper body_wrapper = new GMime.DataWrapper.with_stream(
new GMime.StreamMem.with_buffer(body),
encoding
);
part.set_content_object(body_wrapper);
part.set_content(body_wrapper);
return part;
}

View file

@ -40,7 +40,10 @@ class Geary.RFC822.PartTest : TestCase {
part.set_content_id(ID);
part.set_content_description(DESC);
part.set_content_disposition(
new GMime.ContentDisposition.from_string("inline")
GMime.ContentDisposition.parse(
Geary.RFC822.get_parser_options(),
"inline"
)
);
Part test = new Part(part);
@ -93,13 +96,16 @@ class Geary.RFC822.PartTest : TestCase {
uint8[] body) {
GMime.Part part = new GMime.Part();
if (mime_type != null) {
part.set_content_type(new GMime.ContentType.from_string(mime_type));
part.set_content_type(GMime.ContentType.parse(
Geary.RFC822.get_parser_options(),
mime_type
));
}
GMime.DataWrapper body_wrapper = new GMime.DataWrapper.with_stream(
new GMime.StreamMem.with_buffer(body),
GMime.ContentEncoding.BINARY
);
part.set_content_object(body_wrapper);
part.set_content(body_wrapper);
part.encode(GMime.EncodingConstraint.7BIT);
return part;
}