diff --git a/src/messages/message.cpp b/src/messages/message.cpp index f3ebd5b44..d2fca598d 100644 --- a/src/messages/message.cpp +++ b/src/messages/message.cpp @@ -31,7 +31,7 @@ MessagePtr Message::createSystemMessage(const QString &text) message->addElement(new TimestampElement(QTime::currentTime())); message->addElement(new TextElement(text, MessageElement::Text, MessageColor::System)); - message->flags |= MessageFlags::System; + message->flags.EnableFlag(MessageFlags::System); message->searchText = text; return message; @@ -72,7 +72,8 @@ MessagePtr Message::createTimeoutMessage(const QString &username, const QString } MessagePtr message = Message::createSystemMessage(text); - message->flags |= MessageFlags::System; + message->flags.EnableFlag(MessageFlags::System); + message->flags.EnableFlag(MessageFlags::Timeout); message->timeoutUser = username; return message; } diff --git a/src/providers/twitch/ircmessagehandler.cpp b/src/providers/twitch/ircmessagehandler.cpp index d1ab09f23..ea493e3dd 100644 --- a/src/providers/twitch/ircmessagehandler.cpp +++ b/src/providers/twitch/ircmessagehandler.cpp @@ -104,10 +104,11 @@ void IrcMessageHandler::handleClearChatMessage(Communi::IrcMessage *message) int snapshotLength = snapshot.getLength(); for (int i = std::max(0, snapshotLength - 20); i < snapshotLength; i++) { - if (snapshot[i]->flags & Message::Timeout && snapshot[i]->loginName == username) { + auto &s = snapshot[i]; + if (s->flags.HasFlag(Message::Timeout) && s->timeoutUser == username) { MessagePtr replacement( Message::createTimeoutMessage(username, durationInSeconds, reason, true)); - chan->replaceMessage(snapshot[i], replacement); + chan->replaceMessage(s, replacement); addMessage = false; break; }