aboutsummaryrefslogtreecommitdiffstats
path: root/src/activitypub/apactor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/activitypub/apactor.cpp')
-rw-r--r--src/activitypub/apactor.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/activitypub/apactor.cpp b/src/activitypub/apactor.cpp
new file mode 100644
index 0000000..6731dd3
--- /dev/null
+++ b/src/activitypub/apactor.cpp
@@ -0,0 +1,35 @@
+#include "apactor.h"
+
+APActor::APActor() {}
+
+APActor::APActor(const QString url) {
+ object_url = url;
+}
+
+const QString APActor::get_url() {
+ return object_url;
+}
+
+QString APActor::get_html_render(HtmlRenderDetails render_info) {
+ // TODO: could be made nicer with profile images
+ return object_url;
+}
+
+const QString APActor::get_plain_render() {
+ return object_url;
+}
+
+QString APActorList::get_html_render(HtmlRenderDetails render_info) {
+ // have something basic for the moment
+ QString text;
+
+ for (APActor elem : *this)
+ text.append(elem.get_plain_render() + ", ");
+
+ if (text.isEmpty())
+ text = "<em>(empty)</em>";
+ else
+ text.chop(2); // remove leftover ", "
+
+ return text;
+}