diff --git a/src/json.cpp b/src/json.cpp index c182421..69205b2 100644 --- a/src/json.cpp +++ b/src/json.cpp @@ -1,5 +1,5 @@ /* This file is part of FediBlock-backend. - * Copyright © 2020 tastytea + * Copyright © 2020, 2021 tastytea * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -37,7 +37,8 @@ string to_json(const entry_type &entry) {"receipts", entry.receipts}, {"description", entry.description}, {"screenshots", filenames}, - {"report_time", entry.report_time}}; + {"report_time", entry.report_time}, + {"unreachable", entry.unreachable}}; // clang-format on return json.dump(4); } @@ -81,6 +82,7 @@ entry_type from_json(const string_view json_string) {} entry.tags = json[0].at("tags").get>(); entry.report_time = json[0].at("report_time").get(); + entry.unreachable = json[0].value("unreachable", false); return entry; } diff --git a/src/types.hpp b/src/types.hpp index 60cd8b1..83ba70f 100644 --- a/src/types.hpp +++ b/src/types.hpp @@ -35,6 +35,7 @@ struct entry_type vector screenshot_filepaths; string report_time; string json_url; + bool unreachable{false}; }; enum class http_method