From 40fd76d5b992fb868b44a6f76152655a0408e37b Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Tue, 12 Sep 2023 09:38:16 -0400 Subject: 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. --- src/archive/mastodon.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/archive/mastodon.cpp') 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 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. -- cgit v1.2.3-54-g00ecf