1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:17:35 +00:00

LibIMAP: Parse body-type-msg to spec

This commit is contained in:
Karol Kosek 2023-09-03 00:31:07 +02:00 committed by Andrew Kaster
parent 4a92d712ea
commit 642a3f85ef
2 changed files with 10 additions and 3 deletions

View file

@ -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.