refactor: Remove Leading Mention in Replies and Highlight Participated Threads (#4047)

This commit is contained in:
nerix
2022-10-08 16:25:32 +02:00
committed by GitHub
parent 29272e130a
commit 4e2da540d2
19 changed files with 286 additions and 20 deletions
+1
View File
@@ -43,6 +43,7 @@ enum class MessageFlag : int64_t {
FirstMessage = (1LL << 23),
ReplyMessage = (1LL << 24),
ElevatedMessage = (1LL << 25),
ParticipatedThread = (1LL << 26),
};
using MessageFlags = FlagsEnum<MessageFlag>;
+10
View File
@@ -58,4 +58,14 @@ size_t MessageThread::liveCount(
return count;
}
bool MessageThread::participated() const
{
return this->participated_;
}
void MessageThread::markParticipated()
{
this->participated_ = true;
}
} // namespace chatterino
+5
View File
@@ -23,6 +23,10 @@ public:
/// Returns the number of live reply references
size_t liveCount(const std::shared_ptr<const Message> &exclude) const;
bool participated() const;
void markParticipated();
const QString &rootId() const
{
return rootMessageId_;
@@ -42,6 +46,7 @@ private:
const QString rootMessageId_;
const std::shared_ptr<const Message> rootMessage_;
std::vector<std::weak_ptr<const Message>> replies_;
bool participated_ = false;
};
} // namespace chatterino
+2 -1
View File
@@ -149,7 +149,8 @@ void SharedMessageBuilder::parseHighlights()
auto badges = SharedMessageBuilder::parseBadgeTag(this->tags);
auto [highlighted, highlightResult] = getIApp()->getHighlights()->check(
this->args, badges, this->ircMessage->nick(), this->originalMessage_);
this->args, badges, this->ircMessage->nick(), this->originalMessage_,
this->message().flags);
if (!highlighted)
{