#include <sstream>
#include <stdexcept>
+#include "common/filesystem/filesystem_provider.h"
#include "common/logger.h"
#include "common/tools.h"
picojson::object data = args.get<picojson::object>();
picojson::value v_message = data.at(SEND_MESSAGE_ARGS_MESSAGE);
+
+ bool has_attachments = v_message.get("hasAttachment").get<bool>();
+ if (has_attachments) {
+ const auto& attachments = v_message.get("attachments").get<std::vector<picojson::value>>();
+ for (const auto& att : attachments) {
+ const auto& attachment_path = att.get("filePath").get<std::string>();
+ const auto& attachment_real_path =
+ common::FilesystemProvider::Create().GetRealPath(attachment_path);
+ CHECK_STORAGE_ACCESS(attachment_real_path, &out);
+ }
+ }
+
const double callbackId = args.get(JSON_CALLBACK_ID).get<double>();
auto json = std::shared_ptr<picojson::value>(new picojson::value(picojson::object()));