From d5d462f555ef9d7ce7e001aca5586c19b4d9edc8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 25 Sep 2020 21:40:22 +0200 Subject: Matrix: add display name colors depending on user id --- include/Body.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/Body.hpp b/include/Body.hpp index 79bece6..4987735 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -17,6 +17,8 @@ namespace QuickMedia { BodyItem(const BodyItem &other); void set_title(std::string new_title) { + if(title.empty() && new_title.empty()) + return; title = std::move(new_title); dirty = true; } @@ -27,6 +29,8 @@ namespace QuickMedia { } void set_description(std::string new_description) { + if(description.empty() && new_description.empty()) + return; description = std::move(new_description); dirty_description = true; } @@ -36,8 +40,10 @@ namespace QuickMedia { dirty_description = true; } - void set_author(std::string str) { - author = std::move(str); + void set_author(std::string new_author) { + if(author.empty() && new_author.empty()) + return; + author = std::move(new_author); dirty_author = true; } @@ -61,6 +67,7 @@ namespace QuickMedia { std::vector replies; std::string post_number; sf::Color title_color; + sf::Color author_color; private: std::string title; std::string description; -- cgit v1.2.3