refactor: Remove Leading Mention in Replies and Highlight Participated Threads (#4047)
This commit is contained in:
@@ -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>;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user