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 ## Unversioned
- Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646)
## 2.3.5 ## 2.3.5
- Major: Added highlights for first messages (#3267) - Major: Added highlights for first messages (#3267)

View file

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

View file

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