From a7487ab43e47b6fd3431e59c824d9050709ea5c4 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 1 Sep 2018 13:43:17 +0000 Subject: [PATCH] Temporary fix for timeouts not graying out messages properly Fix #669 --- src/common/Channel.cpp | 3 ++- src/messages/Message.hpp | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/common/Channel.cpp b/src/common/Channel.cpp index f9ac3ac5..ac1d6ea5 100644 --- a/src/common/Channel.cpp +++ b/src/common/Channel.cpp @@ -143,7 +143,8 @@ void Channel::addOrReplaceTimeout(MessagePtr message) if (s->flags.hasNone({MessageFlag::Timeout, MessageFlag::Untimeout}) && s->loginName == message->timeoutUser) { // FOURTF: disabled for now - // s->flags.EnableFlag(MessageFlag::Disabled); + // PAJLADA: Shitty solution described in Message.hpp + s->flags.set(MessageFlag::Disabled); } } diff --git a/src/messages/Message.hpp b/src/messages/Message.hpp index 7aacc47e..5fb50f61 100644 --- a/src/messages/Message.hpp +++ b/src/messages/Message.hpp @@ -33,7 +33,13 @@ struct Message : boost::noncopyable { Message(); ~Message(); - MessageFlags flags; + // Making this a mutable means that we can update a messages flags, + // while still keeping Message constant. This means that a message's flag + // can be updated without the renderer being made aware, which might be bad. + // This is a temporary effort until we can figure out what the right + // const-correct way to deal with this is. + // This might bring race conditions with it + mutable MessageFlags flags; QTime parseTime; QString id; QString searchText;