mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fix recursive fetchChatters call (#4097)
This commit is contained in:
parent
7640677a43
commit
4196bba4ad
2 changed files with 21 additions and 20 deletions
|
@ -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)
|
||||||
|
|
|
@ -2078,31 +2078,32 @@ 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,
|
||||||
|
failureCallback](auto fs) {
|
||||||
|
return [=](auto chatters) {
|
||||||
|
qCDebug(chatterinoTwitch)
|
||||||
|
<< "Fetched" << chatters.chatters.size() << "chatters";
|
||||||
|
finalChatters->chatters.merge(chatters.chatters);
|
||||||
|
finalChatters->total = chatters.total;
|
||||||
|
|
||||||
fetchSuccess = [this, broadcasterID, moderatorID, maxChattersToFetch,
|
if (chatters.cursor.isEmpty() ||
|
||||||
finalChatters, &fetchSuccess, successCallback,
|
finalChatters->chatters.size() >= maxChattersToFetch)
|
||||||
failureCallback](auto chatters) {
|
{
|
||||||
qCDebug(chatterinoTwitch)
|
// Done paginating
|
||||||
<< "Fetched" << chatters.chatters.size() << "chatters";
|
successCallback(*finalChatters);
|
||||||
finalChatters->chatters.merge(chatters.chatters);
|
return;
|
||||||
finalChatters->total = chatters.total;
|
}
|
||||||
|
|
||||||
if (chatters.cursor.isEmpty() ||
|
this->fetchChatters(broadcasterID, moderatorID,
|
||||||
finalChatters->chatters.size() >= maxChattersToFetch)
|
NUM_CHATTERS_TO_FETCH, chatters.cursor, fs,
|
||||||
{
|
failureCallback);
|
||||||
// Done paginating
|
};
|
||||||
successCallback(*finalChatters);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this->fetchChatters(broadcasterID, moderatorID, NUM_CHATTERS_TO_FETCH,
|
|
||||||
chatters.cursor, fetchSuccess, 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
|
||||||
|
|
Loading…
Reference in a new issue