Geary.RFC822: Clean up message data interfaces and classes

Split Geary.RFC822.MessageData interface up into DecodedMessageData and
EncodedMessageData so the difference between the two is clear and they
can't be used interchangeably.

Add `DecodedMessageData::to_rfc822_string` to provide a common interface
for round-tripping decoded data.

Update all classes to implement one of these and follow the same general
API patterns.
This commit is contained in:
Michael Gratton 2020-05-06 11:27:00 +10:00 committed by Michael James Gratton
parent 5b253cbee6
commit 6e7631b8d3
10 changed files with 138 additions and 78 deletions

View file

@ -434,7 +434,7 @@ class Geary.App.ConversationMonitorTest : TestCase {
references.message_id
);
}
email.set_send_date(new Geary.RFC822.Date.from_date_time(now));
email.set_send_date(new RFC822.Date(now));
email.set_email_properties(new MockEmailProperties(now));
email.set_full_references(mid, null, refs_list);
return email;

View file

@ -489,7 +489,7 @@ class Geary.App.ConversationSetTest : TestCase {
references.message_id
);
}
email.set_send_date(new Geary.RFC822.Date.from_date_time(now));
email.set_send_date(new RFC822.Date(now));
email.set_email_properties(new MockEmailProperties(now));
email.set_full_references(mid, null, refs_list);
return email;

View file

@ -289,7 +289,7 @@ class Geary.App.ConversationTest : TestCase {
);
email.set_full_references(mid, null, null);
email.set_email_properties(new MockEmailProperties(now));
email.set_send_date(new Geary.RFC822.Date.from_date_time(now));
email.set_send_date(new RFC822.Date(now));
return email;
}