#pragma once // Spec: models.md Attachment. fromChatFrame is the lenient variant used by chat socket messages. #include #include #include #include "core/Date.hpp" #include "core/Json.hpp" namespace dp { struct Attachment { std::string id; std::optional filename; std::string url; std::optional size; bool isImage = false; bool isVideo = false; std::string mimeType; Date createdAt{}; bool canModify = false; static Attachment fromJson(const Json& j); // Chat frame: only uid and url are required; missing is_image/is_video/mime_type/can_modify default, // missing created_at is `now`. static Attachment fromChatFrame(const Json& j); }; } // namespace dp