aboutsummaryrefslogtreecommitdiffstats
path: root/src/activitypub/apactor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/activitypub/apactor.h')
-rw-r--r--src/activitypub/apactor.h42
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 {