Respect founder badge in author.subbed filter (#2971)

This commit is contained in:
Paweł 2021-07-06 17:14:05 +02:00 committed by GitHub
parent cc9d44a0bb
commit 8a0ed79eca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View file

@ -9,6 +9,7 @@
- Bugfix: Fixed large timeout durations in moderation buttons overlapping with usernames or other buttons. (#2865, #2921) - Bugfix: Fixed large timeout durations in moderation buttons overlapping with usernames or other buttons. (#2865, #2921)
- Bugfix: Middle mouse click no longer scrolls in not fully populated usercards and splits. (#2933) - Bugfix: Middle mouse click no longer scrolls in not fully populated usercards and splits. (#2933)
- Bugfix: Fix bad behavior of the HTML color picker edit when user input is being entered. (#2942) - Bugfix: Fix bad behavior of the HTML color picker edit when user input is being entered. (#2942)
- Bugfix: Fixed founder badge not being respected by `author.subbed` filter. (#2971)
## 2.3.3 ## 2.3.3

View file

@ -47,10 +47,20 @@ ContextMap buildContextMap(const MessagePtr &m)
watchingChannel->getName().compare( watchingChannel->getName().compare(
m->channelName, Qt::CaseInsensitive) == 0; m->channelName, Qt::CaseInsensitive) == 0;
bool subscribed = badges.contains("subscriber"); bool subscribed = false;
int subLength = (subscribed && m->badgeInfos.count("subscriber") != 0) int subLength = 0;
? m->badgeInfos.at("subscriber").toInt() for (const QString &subBadge : {"subscriber", "founder"})
: 0; {
if (!badges.contains(subBadge))
{
continue;
}
subscribed = true;
if (m->badgeInfos.find(subBadge) != m->badgeInfos.end())
{
subLength = m->badgeInfos.at(subBadge).toInt();
}
}
return { return {
{"author.badges", std::move(badges)}, {"author.badges", std::move(badges)},