Use login name for NotificationController lookup (#3648)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Sidd 2022-04-06 14:10:22 -07:00 committed by GitHub
parent 81a62764c8
commit 870aa74427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -2,6 +2,8 @@
## Unversioned
- Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646)
## 2.3.5
- Major: Added highlights for first messages (#3267)

View file

@ -178,12 +178,12 @@ void NotificationController::fetchFakeChannels()
std::unordered_set<QString> liveStreams;
for (const auto &stream : streams)
{
liveStreams.insert(stream.userName);
liveStreams.insert(stream.userLogin);
}
for (const auto &name : batch)
{
auto it = liveStreams.find(name);
auto it = liveStreams.find(name.toLower());
this->checkStream(it != liveStreams.end(), name);
}
},

View file

@ -86,8 +86,10 @@ struct HelixUsersFollowsResponse {
struct HelixStream {
QString id; // stream id
QString userId;
QString userLogin;
QString userName;
QString gameId;
QString gameName;
QString type;
QString title;
int viewerCount;
@ -98,8 +100,10 @@ struct HelixStream {
HelixStream()
: id("")
, userId("")
, userLogin("")
, userName("")
, gameId("")
, gameName("")
, type("")
, title("")
, viewerCount()
@ -112,8 +116,10 @@ struct HelixStream {
explicit HelixStream(QJsonObject jsonObject)
: id(jsonObject.value("id").toString())
, userId(jsonObject.value("user_id").toString())
, userLogin(jsonObject.value("user_login").toString())
, userName(jsonObject.value("user_name").toString())
, gameId(jsonObject.value("game_id").toString())
, gameName(jsonObject.value("game_name").toString())
, type(jsonObject.value("type").toString())
, title(jsonObject.value("title").toString())
, viewerCount(jsonObject.value("viewer_count").toInt())