aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-04 11:30:03 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-04 14:15:24 +0200
commitb64cb2c537d06d822a63f8139ca9bf2ffd80c21f (patch)
treedaf7dc651b561c277d605a2eb097f2858150b7ec /include
parent8a21f2d4f70ecd4509aa8976c5e40ee70395a6a0 (diff)
Matrix: show room name in mention notification, timestamps for messages
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index bf5f6aa..5ee93fc 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -56,9 +56,17 @@ namespace QuickMedia {
dirty_author = true;
}
+ void set_timestamp(time_t new_timestamp) {
+ if(timestamp == 0 && new_timestamp == 0)
+ return;
+ timestamp = new_timestamp;
+ dirty_timestamp = true;
+ }
+
const std::string& get_title() const { return title; }
const std::string& get_description() const { return description; }
const std::string& get_author() const { return author; }
+ time_t get_timestamp() const { return timestamp; }
// TODO: Use a list of strings instead, not all plugins need all of these fields
std::string url;
@@ -68,10 +76,12 @@ namespace QuickMedia {
bool dirty;
bool dirty_description;
bool dirty_author;
+ bool dirty_timestamp;
bool thumbnail_is_local;
std::unique_ptr<Text> title_text;
std::unique_ptr<Text> description_text;
std::unique_ptr<Text> author_text;
+ std::unique_ptr<sf::Text> timestamp_text;
// Used by image boards for example. The elements are indices to other body items
std::vector<size_t> replies;
std::string post_number;
@@ -83,6 +93,7 @@ namespace QuickMedia {
std::string title;
std::string description;
std::string author;
+ time_t timestamp;
};
using BodyItems = std::vector<std::shared_ptr<BodyItem>>;