mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 16:05:57 +00:00
Fix request cancel in Histories.
This commit is contained in:
@@ -621,7 +621,11 @@ void Histories::finishSentRequest(
|
|||||||
not_null<State*> state,
|
not_null<State*> state,
|
||||||
int id) {
|
int id) {
|
||||||
_historyByRequest.remove(id);
|
_historyByRequest.remove(id);
|
||||||
state->sent.remove(id);
|
const auto i = state->sent.find(id);
|
||||||
|
if (i != end(state->sent)) {
|
||||||
|
session().api().request(i->second.id).cancel();
|
||||||
|
state->sent.erase(i);
|
||||||
|
}
|
||||||
if (!state->postponed.empty() && !postponeHistoryRequest(*state)) {
|
if (!state->postponed.empty() && !postponeHistoryRequest(*state)) {
|
||||||
for (auto &[id, postponed] : base::take(state->postponed)) {
|
for (auto &[id, postponed] : base::take(state->postponed)) {
|
||||||
const auto requestId = postponed.generator([=] {
|
const auto requestId = postponed.generator([=] {
|
||||||
|
Reference in New Issue
Block a user