aboutsummaryrefslogtreecommitdiffstats
path: root/src/archive_parser.h
diff options
context:
space:
mode:
authorConfuSomu2023-07-15 15:52:49 +0200
committerConfuSomu2023-07-15 15:52:49 +0200
commite322946df7c33f76dbee46ec5b8e2118fbae8a26 (patch)
tree9a0fb14e794743c6baa87dcb61a694b5166141bc /src/archive_parser.h
parent0e84cb6c13b8b47ed0d05b21f14490bf6c4744f2 (diff)
downloadActorViewer-e322946df7c33f76dbee46ec5b8e2118fbae8a26.tar
ActorViewer-e322946df7c33f76dbee46ec5b8e2118fbae8a26.tar.gz
ActorViewer-e322946df7c33f76dbee46ec5b8e2118fbae8a26.zip
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.
Diffstat (limited to 'src/archive_parser.h')
-rw-r--r--src/archive_parser.h4
1 files changed, 4 insertions, 0 deletions
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<APAttachmentFields> 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);
};