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

LibIMAP: Support for the SEARCH command

This commit is contained in:
x-yl 2021-06-02 18:36:42 +04:00 committed by Ali Mohammad Pur
parent 318709c8ca
commit a6339297ec
5 changed files with 188 additions and 0 deletions

View file

@ -182,6 +182,14 @@ void Parser::parse_untagged()
parse_while([](u8 x) { return x != '\r'; });
consume("\r\n");
}
} else if (try_consume("SEARCH")) {
Vector<unsigned> ids;
while (!try_consume("\r\n")) {
consume(" ");
auto id = parse_number();
ids.append(id);
}
m_response.data().set_search_results(move(ids));
} else if (try_consume("BYE")) {
auto message = parse_while([](u8 x) { return x != '\r'; });
consume("\r\n");