diff --git a/src/util/completionmodel.cpp b/src/util/completionmodel.cpp index 0bef743b1..a183c04a0 100644 --- a/src/util/completionmodel.cpp +++ b/src/util/completionmodel.cpp @@ -105,6 +105,8 @@ void CompletionModel::addUser(const QString &str) this->emotes.erase(p.first); auto result2 = this->emotes.insert(ts); assert(result2.second); + } else { + p.first->timeAdded = std::chrono::steady_clock::now(); } } } diff --git a/src/util/completionmodel.hpp b/src/util/completionmodel.hpp index 629f5dd15..016e23985 100644 --- a/src/util/completionmodel.hpp +++ b/src/util/completionmodel.hpp @@ -39,7 +39,7 @@ class CompletionModel : public QAbstractListModel // Type will help decide the lifetime of the tagged strings Type type; - std::chrono::steady_clock::time_point timeAdded; + mutable std::chrono::steady_clock::time_point timeAdded; bool HasExpired(const std::chrono::steady_clock::time_point &now) const {