You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
677 B
34 lines
677 B
#ifndef _MAIL_
|
|
#define _MAIL_
|
|
|
|
#include <protocol/protocol.hpp>
|
|
|
|
#include <functional>
|
|
#include <vector>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
|
|
namespace mail {
|
|
namespace status {
|
|
const int SPAM = 0;
|
|
const int HAM = 1;
|
|
const int UNSURE = 2;
|
|
const int ERROR = 3;
|
|
}
|
|
|
|
struct message_t {
|
|
std::vector<std::string> header;
|
|
std::vector<std::string> body;
|
|
};
|
|
|
|
struct session_t {
|
|
bool has_header = 0;
|
|
protocol::token::string_t token;
|
|
message_t message;
|
|
int status = status::UNSURE;
|
|
};
|
|
|
|
using session_map_t = std::unordered_map<protocol::session_key_t, session_t>;
|
|
}
|
|
|
|
#endif |