aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index db502c5..c487ad9 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -19,6 +19,7 @@ namespace QuickMedia {
BodyItem(const BodyItem &other) {
title = other.title;
+ description = other.description;
url = other.url;
thumbnail_url = other.thumbnail_url;
attached_content_url = other.attached_content_url;
@@ -29,6 +30,10 @@ namespace QuickMedia {
title_text = std::make_unique<Text>(*other.title_text);
else
title_text = nullptr;
+ if(other.description_text)
+ description_text = std::make_unique<Text>(*other.description_text);
+ else
+ description_text = nullptr;
replies = other.replies;
post_number = other.post_number;
}
@@ -38,7 +43,14 @@ namespace QuickMedia {
dirty = true;
}
- std::string title;
+ void set_description(std::string new_description) {
+ description = std::move(new_description);
+ }
+
+ const std::string& get_title() const { return title; }
+ const std::string& get_description() const { return description; }
+
+ // TODO: Use a list of strings instead, not all plugins need all of these fields
std::string url;
std::string thumbnail_url;
std::string attached_content_url;
@@ -46,9 +58,13 @@ namespace QuickMedia {
bool visible;
bool dirty;
std::unique_ptr<Text> title_text;
+ std::unique_ptr<Text> description_text;
// Used by image boards for example. The elements are indices to other body items
std::vector<size_t> replies;
std::string post_number;
+ private:
+ std::string title;
+ std::string description;
};
using BodyItems = std::vector<std::unique_ptr<BodyItem>>;