From e322946df7c33f76dbee46ec5b8e2118fbae8a26 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Sat, 15 Jul 2023 15:52:49 +0200 Subject: Account for "@context" in outbox.json being array "@context" in the outbox.json file is not always a string and sometimes might be an array with multiple elements. This patch implements a json_check_item method which checks for the existence of "https://www.w3.org/ns/activitystreams" in both cases. --- src/archive_parser.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/archive_parser.h') diff --git a/src/archive_parser.h b/src/archive_parser.h index 7377120..7f41878 100644 --- a/src/archive_parser.h +++ b/src/archive_parser.h @@ -49,4 +49,8 @@ private: QStringList get_status_object_language_list(QJsonObject obj, QString element_name); std::vector get_status_attachments_list(QJsonValueRef attachments_ref); void find_attachment_dir(QString example_attachment); + + // Check the `object`, which may be a simple string or a QJsonArray, for the existance of a string `item`. + // Returns true if the `item` exists, else false. + bool json_check_item(const QJsonValue& object, const QString& item); }; -- cgit v1.2.3-54-g00ecf