#pragma once #include "user_handler.h" #include #include #include #include #include namespace fs = std::filesystem; using json = nlohmann::json; struct mail { std::string filename; /* metadata */ u_int id; int64_t timestamp; std::string sender; std::vector recipients; std::string subject; mail(std::string filename, std::string subject); mail(std::string filename, int64_t timestamp, std::string subject); bool operator()(const u_int& id) const { return id == this->id; } bool operator<(mail& left) const { return left.timestamp > this->timestamp; } fs::path getPath() { return this->filename; }; json mailToJson(); void remove(); };