diff options
author | ConfuSomu | 2024-01-20 21:57:39 -0500 |
---|---|---|
committer | ConfuSomu | 2024-01-20 21:57:39 -0500 |
commit | 5aac009e969cc3bd15c484ba3437348cb7a4d186 (patch) | |
tree | 96cff55a273b9de31d639b00f7139110946ce1b6 /src/activitypub/apactor.h | |
parent | 328c9b166e9d623cd1b80c7ae064baf6172da58f (diff) | |
download | ActorViewer-5aac009e969cc3bd15c484ba3437348cb7a4d186.tar ActorViewer-5aac009e969cc3bd15c484ba3437348cb7a4d186.tar.gz ActorViewer-5aac009e969cc3bd15c484ba3437348cb7a4d186.zip |
Implemement Actor information tab
This class still has improvements to be made, but it works and I am
satisfied with it!
Diffstat (limited to 'src/activitypub/apactor.h')
-rw-r--r-- | src/activitypub/apactor.h | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/src/activitypub/apactor.h b/src/activitypub/apactor.h index 60ef0bf..ad8d689 100644 --- a/src/activitypub/apactor.h +++ b/src/activitypub/apactor.h @@ -1,22 +1,60 @@ #pragma once #include "apbase.h" +#include "apattachment.h" +#include <QDateTime> #include <vector> +struct APPropertyValue { + QString key; + QString value; +}; + +struct APActorFields { + QString url; + QString username; // without the leading '@' + QString display_name; + QString summary; // Profile biography/description (bio) + QStringList keys; + QStringList values; + APAttachment* avatar = nullptr; + APAttachment* header = nullptr; + bool manuallyApprovesFollowers = false; + bool discoverable = true; // is discoverable or indexable + QString joined_date; + QStringList also_known_as; // other Actors representing the same user +}; + // APActors will have an avatar, display name, username and more that will be fetched using the remote instance +// Currently missing: featured tags and featured posts class APActor : APBase { public: // Empty actor APActor(); - APActor(const QString url); - ~APActor() {}; + APActor(const QString& url); + APActor(APActorFields& fields); + ~APActor(); const QString get_url(); QString get_html_render(HtmlRenderDetails render_info); const QString get_plain_render(); private: + friend class TabActorInfo; + QString object_url; + QString username; + QString name; // Display name + QString summary; // Profile biography/description (bio) + typedef std::vector<APPropertyValue> APPropertyValueList; // Key/value table in profile (example: "web site | http://example.com/") + APPropertyValueList table; + APAttachment* avatar = nullptr; + APAttachment* header = nullptr; + bool manuallyApprovesFollowers = false; + bool discoverable = true; // is discoverable or indexable + QDateTime joined; + // TODO: parse the also_known_as field + // APActorList known_as; }; class APActorList : public std::vector<APActor>, APBase { |