mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:37:45 +00:00
LibIMAP: Support for CAPABILITY command & response
This involves parsing messages with untagged responses
This commit is contained in:
parent
ac712b07f9
commit
0f42ea6770
4 changed files with 55 additions and 0 deletions
|
@ -17,10 +17,12 @@
|
|||
|
||||
namespace IMAP {
|
||||
enum class CommandType {
|
||||
Capability,
|
||||
Noop,
|
||||
};
|
||||
|
||||
enum class ResponseType : unsigned {
|
||||
Capability = 1u << 0,
|
||||
};
|
||||
|
||||
class Parser;
|
||||
|
@ -65,8 +67,22 @@ public:
|
|||
m_response_type = m_response_type | static_cast<unsigned>(response_type);
|
||||
}
|
||||
|
||||
void add_capabilities(Vector<String>&& capabilities)
|
||||
{
|
||||
m_capabilities = move(capabilities);
|
||||
add_response_type(ResponseType::Capability);
|
||||
}
|
||||
|
||||
Vector<String>& capabilities()
|
||||
{
|
||||
VERIFY(contains_response_type(ResponseType::Capability));
|
||||
return m_capabilities;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned m_response_type;
|
||||
|
||||
Vector<String> m_capabilities;
|
||||
};
|
||||
|
||||
class SolidResponse {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue