aboutsummaryrefslogtreecommitdiffstats
path: root/src/archive/mastodon.cpp
diff options
context:
space:
mode:
authorConfuSomu2023-09-12 09:38:16 -0400
committerConfuSomu2023-09-12 09:38:16 -0400
commit40fd76d5b992fb868b44a6f76152655a0408e37b (patch)
tree6e7997fa25d0dfa12831fbed7577d6d7b1d81fdc /src/archive/mastodon.cpp
parent9c60bc8ce4a0990c228d2cd746791b88c41532b8 (diff)
downloadActorViewer-40fd76d5b992fb868b44a6f76152655a0408e37b.tar
ActorViewer-40fd76d5b992fb868b44a6f76152655a0408e37b.tar.gz
ActorViewer-40fd76d5b992fb868b44a6f76152655a0408e37b.zip
Implement archive method for getting APActivity
This replaces the existing method that returns HTML with a method that gives us an APActivity object, which is more precise and allows more extension in the future.
Diffstat (limited to 'src/archive/mastodon.cpp')
-rw-r--r--src/archive/mastodon.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/archive/mastodon.cpp b/src/archive/mastodon.cpp
index 01d476d..238b861 100644
--- a/src/archive/mastodon.cpp
+++ b/src/archive/mastodon.cpp
@@ -237,13 +237,12 @@ std::vector<APAttachmentFields> MastodonArchive::get_status_attachments_list(QJs
return list;
}
-// status_index is assumed to be a valid index
-const QString MastodonArchive::get_html_status_info(int status_index, int text_zone_width, StatusType status_type, QLocale* locale) {
+APActivity* MastodonArchive::get_activity(int status_index, Hinting_t hinting) {
// the JSON AP Activity
QJsonObject activity = outbox_items->at(status_index).toObject();
APActivityFields act_fields = {
- .visibility = status_type
+ .visibility = hinting.status_type
};
QString obj_url;
@@ -331,7 +330,7 @@ const QString MastodonArchive::get_html_status_info(int status_index, int text_z
}
// TODO: it is currently a waste to create this APActivity object that will be immediately destroyed but it allows us to extend archive parsing to something that will become abstract (and an abstract base class) and separate from display (the final goal) which will allow us to add other sources that feed us with posts, reblogs and Actor information. furthermore, these objects can be cached for reuse in a session.
- return APActivity(act_fields).get_html_render({text_zone_width, locale});
+ return new APActivity(act_fields);
}
// TODO: make this use an APActivity object that will be present as an StatusListItem member.