diff options
author | ConfuSomu | 2022-12-26 18:18:21 -0500 |
---|---|---|
committer | ConfuSomu | 2022-12-26 18:18:21 -0500 |
commit | 8b3b17f03ed8a3bfc9d72978f8b0134807132ee0 (patch) | |
tree | bafdd7cba619b16e3478eb10107e0d2235be9b51 /src/archive_parser.cpp | |
parent | 477a7257e3aaec13dac7096ab91749399543502e (diff) | |
download | ActorViewer-8b3b17f03ed8a3bfc9d72978f8b0134807132ee0.tar ActorViewer-8b3b17f03ed8a3bfc9d72978f8b0134807132ee0.tar.gz ActorViewer-8b3b17f03ed8a3bfc9d72978f8b0134807132ee0.zip |
Implement initial list of statuses
Diffstat (limited to 'src/archive_parser.cpp')
-rw-r--r-- | src/archive_parser.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/archive_parser.cpp b/src/archive_parser.cpp index 09b8cef..61b5f14 100644 --- a/src/archive_parser.cpp +++ b/src/archive_parser.cpp @@ -1,4 +1,5 @@ #include "archive_parser.h" +#include "src/types.h" #include <QFile> #include <QJsonParseError> @@ -44,3 +45,25 @@ Archive::~Archive() { delete outbox_json; outbox_json = nullptr; delete outbox_items; outbox_items = nullptr; } + +QStringList Archive::get_status_list(ViewTootTypes types) { + QStringList statuses; + + for (auto&& item : *outbox_items) { + if (item.isObject()){ + QJsonObject obj = item.toObject(); + + // TODO: check the status type + + if (obj.value("object").isObject()) { + QJsonObject activity = obj.value("object").toObject(); + + if (activity.value("content").isString()) { + statuses.append(activity.value("content").toString()); + } + } + } + } + + return statuses; +} |