feat(filters): filter by author user ID (#5862)
This commit is contained in:
@@ -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"},
|
||||
|
||||
@@ -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)},
|
||||
|
||||
@@ -47,6 +47,7 @@ struct Message {
|
||||
QString loginName;
|
||||
QString displayName;
|
||||
QString localizedName;
|
||||
QString userID;
|
||||
QString timeoutUser;
|
||||
QString channelName;
|
||||
QColor usernameColor;
|
||||
|
||||
@@ -2102,6 +2102,7 @@ std::pair<MessagePtrMut, HighlightAlert> MessageBuilder::makeIrcMessage(
|
||||
|
||||
MessageBuilder builder;
|
||||
builder.parseUsernameColor(tags, userID);
|
||||
builder->userID = userID;
|
||||
|
||||
if (args.isAction)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user