From b64cb2c537d06d822a63f8139ca9bf2ffd80c21f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 4 Oct 2020 11:30:03 +0200 Subject: Matrix: show room name in mention notification, timestamps for messages --- include/Body.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/Body.hpp') 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 title_text; std::unique_ptr description_text; std::unique_ptr author_text; + std::unique_ptr timestamp_text; // Used by image boards for example. The elements are indices to other body items std::vector 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>; -- cgit v1.2.3