mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibIMAP: Parse body-type-msg to spec
This commit is contained in:
parent
4a92d712ea
commit
642a3f85ef
Notes:
sideshowbarker
2024-07-17 07:08:37 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/642a3f85ef Pull-request: https://github.com/SerenityOS/serenity/pull/20923
@ -213,7 +213,7 @@ struct BodyStructureData {
|
||||
HashMap<DeprecatedString, DeprecatedString> fields;
|
||||
unsigned bytes { 0 };
|
||||
unsigned lines { 0 };
|
||||
Optional<Envelope> envelope;
|
||||
Optional<Tuple<Envelope, NonnullOwnPtr<BodyStructure>>> contanied_message;
|
||||
|
||||
Optional<DeprecatedString> md5 {};
|
||||
Optional<Tuple<DeprecatedString, HashMap<DeprecatedString, DeprecatedString>>> disposition {};
|
||||
|
@ -453,11 +453,18 @@ BodyStructure Parser::parse_one_part_body()
|
||||
// NOTE: "media-text SP body-fields" part is already parsed.
|
||||
consume(" "sv);
|
||||
data.lines = MUST(parse_number());
|
||||
} else if (data.type.equals_ignoring_ascii_case("MESSAGE"sv) && data.subtype.equals_ignoring_ascii_case("RFC822"sv)) {
|
||||
} else if (data.type.equals_ignoring_ascii_case("MESSAGE"sv) && data.subtype.is_one_of_ignoring_ascii_case("RFC822"sv, "GLOBAL"sv)) {
|
||||
// body-type-msg
|
||||
// NOTE: "media-message SP body-fields" part is already parsed.
|
||||
consume(" "sv);
|
||||
data.envelope = parse_envelope();
|
||||
auto envelope = parse_envelope();
|
||||
|
||||
consume(" ("sv);
|
||||
auto body = parse_body_structure();
|
||||
data.contanied_message = Tuple { move(envelope), make<BodyStructure>(move(body)) };
|
||||
|
||||
consume(" "sv);
|
||||
data.lines = MUST(parse_number());
|
||||
} else {
|
||||
// body-type-basic
|
||||
// NOTE: "media-basic SP body-fields" is already parsed.
|
||||
|
Loading…
Reference in New Issue
Block a user