Fix recursive fetchChatters call (#4097)

This commit is contained in:
pajlada 2022-11-02 10:31:28 +01:00 committed by GitHub
parent 7640677a43
commit 4196bba4ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 20 deletions

View file

@ -69,7 +69,7 @@
- Minor: Migrated /uniquechatoff and /r9kbetaoff to Helix API. (#4057) - Minor: Migrated /uniquechatoff and /r9kbetaoff to Helix API. (#4057)
- Minor: Added stream titles to windows live toast notifications. (#1297) - Minor: Added stream titles to windows live toast notifications. (#1297)
- Minor: Make menus and placeholders display appropriate custom key combos. (#4045) - Minor: Make menus and placeholders display appropriate custom key combos. (#4045)
- Minor: Migrated /chatters to Helix API. (#4088) - Minor: Migrated /chatters to Helix API. (#4088, #4097)
- Minor: Add settings tooltips. (#3437) - Minor: Add settings tooltips. (#3437)
- Bugfix: Connection to Twitch PubSub now recovers more reliably. (#3643, #3716) - Bugfix: Connection to Twitch PubSub now recovers more reliably. (#3643, #3716)
- Bugfix: Fixed `Smooth scrolling on new messages` setting sometimes hiding messages. (#4028) - Bugfix: Fixed `Smooth scrolling on new messages` setting sometimes hiding messages. (#4028)

View file

@ -2078,11 +2078,10 @@ void Helix::getChatters(
auto finalChatters = std::make_shared<HelixChatters>(); auto finalChatters = std::make_shared<HelixChatters>();
ResultCallback<HelixChatters> fetchSuccess; auto fetchSuccess = [this, broadcasterID, moderatorID, maxChattersToFetch,
finalChatters, successCallback,
fetchSuccess = [this, broadcasterID, moderatorID, maxChattersToFetch, failureCallback](auto fs) {
finalChatters, &fetchSuccess, successCallback, return [=](auto chatters) {
failureCallback](auto chatters) {
qCDebug(chatterinoTwitch) qCDebug(chatterinoTwitch)
<< "Fetched" << chatters.chatters.size() << "chatters"; << "Fetched" << chatters.chatters.size() << "chatters";
finalChatters->chatters.merge(chatters.chatters); finalChatters->chatters.merge(chatters.chatters);
@ -2096,13 +2095,15 @@ void Helix::getChatters(
return; return;
} }
this->fetchChatters(broadcasterID, moderatorID, NUM_CHATTERS_TO_FETCH, this->fetchChatters(broadcasterID, moderatorID,
chatters.cursor, fetchSuccess, failureCallback); NUM_CHATTERS_TO_FETCH, chatters.cursor, fs,
failureCallback);
};
}; };
// Initiate the recursive calls // Initiate the recursive calls
this->fetchChatters(broadcasterID, moderatorID, NUM_CHATTERS_TO_FETCH, "", this->fetchChatters(broadcasterID, moderatorID, NUM_CHATTERS_TO_FETCH, "",
fetchSuccess, failureCallback); fetchSuccess(fetchSuccess), failureCallback);
} }
// List the VIPs of a channel // List the VIPs of a channel