1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:07:36 +00:00

LibIMAP: Implement serializing FetchCommands with PeekBody type

This commit is contained in:
Karol Kosek 2023-07-11 18:53:35 +02:00 committed by Sam Atkins
parent b5bfe732d7
commit 2132e0f1bb

View file

@ -74,10 +74,12 @@ DeprecatedString FetchCommand::DataItem::serialize() const
case DataItemType::UID: case DataItemType::UID:
return "UID"; return "UID";
case DataItemType::PeekBody: case DataItemType::PeekBody:
TODO();
case DataItemType::BodySection: { case DataItemType::BodySection: {
StringBuilder sb; StringBuilder sb;
if (type == DataItemType::BodySection)
sb.appendff("BODY[{}]", section.value().serialize()); sb.appendff("BODY[{}]", section.value().serialize());
else
sb.appendff("BODY.PEEK[{}]", section.value().serialize());
if (partial_fetch) { if (partial_fetch) {
sb.appendff("<{}.{}>", start, octets); sb.appendff("<{}.{}>", start, octets);
} }