diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-09-25 21:40:22 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-09-25 22:27:15 +0200 |
commit | d5d462f555ef9d7ce7e001aca5586c19b4d9edc8 (patch) | |
tree | 8fa80cce39f3df27513ff16815bb7b5d11814d8e /include | |
parent | eac2ace1c14c1ae0564d757b26a359c6bd4b754a (diff) |
Matrix: add display name colors depending on user id
Diffstat (limited to 'include')
-rw-r--r-- | include/Body.hpp | 11 |
1 files changed, 9 insertions, 2 deletions
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<size_t> replies; std::string post_number; sf::Color title_color; + sf::Color author_color; private: std::string title; std::string description; |