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

LibIMAP: Support for LOGIN and LOGOUT

This commit is contained in:
x-yl 2021-06-01 19:10:20 +04:00 committed by Ali Mohammad Pur
parent 2f04d24b66
commit f00c2c0192
4 changed files with 31 additions and 0 deletions

View file

@ -19,6 +19,8 @@ namespace IMAP {
enum class CommandType {
Capability,
List,
Login,
Logout,
Noop,
Select,
};
@ -50,6 +52,7 @@ enum class ResponseType : unsigned {
UIDValidity = 1u << 6,
Unseen = 1u << 7,
PermanentFlags = 1u << 8,
Bye = 1u << 13,
};
class Parser;
@ -208,6 +211,18 @@ public:
return m_permanent_flags;
}
void set_bye(Optional<String> message)
{
add_response_type(ResponseType::Bye);
m_bye_message = move(message);
}
Optional<String>& bye_message()
{
VERIFY(contains_response_type(ResponseType::Bye));
return m_bye_message;
}
private:
unsigned m_response_type;
@ -222,6 +237,7 @@ private:
unsigned m_unseen {};
Vector<String> m_permanent_flags;
Vector<String> m_flags;
Optional<String> m_bye_message;
};
class SolidResponse {