optimize chatter list (#2814)
* optimize chatter list * changelog * Fix tests Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -119,13 +119,14 @@ namespace {
|
||||
|
||||
return messages;
|
||||
}
|
||||
std::pair<Outcome, UsernameSet> parseChatters(const QJsonObject &jsonRoot)
|
||||
std::pair<Outcome, std::unordered_set<QString>> parseChatters(
|
||||
const QJsonObject &jsonRoot)
|
||||
{
|
||||
static QStringList categories = {"broadcaster", "vips", "moderators",
|
||||
"staff", "admins", "global_mods",
|
||||
"viewers"};
|
||||
|
||||
auto usernames = UsernameSet();
|
||||
auto usernames = std::unordered_set<QString>();
|
||||
|
||||
// parse json
|
||||
QJsonObject jsonCategories = jsonRoot.value("chatters").toObject();
|
||||
@@ -823,7 +824,7 @@ void TwitchChannel::refreshChatters()
|
||||
auto pair = parseChatters(std::move(data));
|
||||
if (pair.first)
|
||||
{
|
||||
this->setChatters(std::move(pair.second));
|
||||
this->updateOnlineChatters(pair.second);
|
||||
}
|
||||
|
||||
return pair.first;
|
||||
|
||||
Reference in New Issue
Block a user