feat(filters): filter by author user ID (#5862)

This commit is contained in:
apa420
2025-01-30 22:05:12 +01:00
committed by GitHub
parent 71179ed6fa
commit f914e0406e
91 changed files with 104 additions and 0 deletions
+3
View File
@@ -14,6 +14,7 @@ const QMap<QString, Type> MESSAGE_TYPING_CONTEXT{
{"author.badges", Type::StringList},
{"author.color", Type::Color},
{"author.name", Type::String},
{"author.user_id", Type::String},
{"author.no_color", Type::Bool},
{"author.subbed", Type::Bool},
{"author.sub_length", Type::Int},
@@ -60,6 +61,7 @@ ContextMap buildContextMap(const MessagePtr &m, chatterino::Channel *channel)
* author.badges
* author.color
* author.name
* author.user_id
* author.no_color
* author.subbed
* author.sub_length
@@ -121,6 +123,7 @@ ContextMap buildContextMap(const MessagePtr &m, chatterino::Channel *channel)
{"author.badges", std::move(badges)},
{"author.color", m->usernameColor},
{"author.name", m->displayName},
{"author.user_id", m->userID},
{"author.no_color", !m->usernameColor.isValid()},
{"author.subbed", subscribed},
{"author.sub_length", subLength},
@@ -20,6 +20,7 @@ const QMap<QString, QString> VALID_IDENTIFIERS_MAP{
{"author.badges", "author badges"},
{"author.color", "author color"},
{"author.name", "author name"},
{"author.user_id", "author user id"},
{"author.no_color", "author has no color?"},
{"author.subbed", "author subscribed?"},
{"author.sub_length", "author sub length"},
+1
View File
@@ -100,6 +100,7 @@ QJsonObject Message::toJson() const
{"loginName"_L1, this->loginName},
{"displayName"_L1, this->displayName},
{"localizedName"_L1, this->localizedName},
{"userID"_L1, this->userID},
{"timeoutUser"_L1, this->timeoutUser},
{"channelName"_L1, this->channelName},
{"usernameColor"_L1, this->usernameColor.name(QColor::HexArgb)},
+1
View File
@@ -47,6 +47,7 @@ struct Message {
QString loginName;
QString displayName;
QString localizedName;
QString userID;
QString timeoutUser;
QString channelName;
QColor usernameColor;
+1
View File
@@ -2102,6 +2102,7 @@ std::pair<MessagePtrMut, HighlightAlert> MessageBuilder::makeIrcMessage(
MessageBuilder builder;
builder.parseUsernameColor(tags, userID);
builder->userID = userID;
if (args.isAction)
{