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
Notes: sideshowbarker 2024-07-17 02:55:44 +09:00

View file

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