aboutsummaryrefslogtreecommitdiffstats
path: root/src/activitypub/apquestion.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/activitypub/apquestion.h')
-rw-r--r--src/activitypub/apquestion.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/activitypub/apquestion.h b/src/activitypub/apquestion.h
new file mode 100644
index 0000000..350ceec
--- /dev/null
+++ b/src/activitypub/apquestion.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "appost.h"
+#include "apbase.h"
+#include "fields.h"
+#include <vector>
+#include <list>
+
+// APQuestion represents an ActivityPub Question Object
+class APQuestion : public APPost {
+public:
+ APQuestion();
+ // A post that will be built from strings, including attachments
+ APQuestion(APObjectFields fields);
+ ~APQuestion() {};
+
+ QString get_html_render(HtmlRenderDetails render_info);
+
+protected:
+ struct PollOption {
+ QString name;
+ int votes;
+ };
+ typedef std::vector<PollOption> PollOptionList;
+
+ QDateTime end_time;
+ QDateTime closed_time;
+
+ int total_votes = 0;
+
+ PollOptionList options;
+
+ QString get_html_poll_options(HtmlRenderDetails render_info);
+};