Replace result with "Request Aborted" error only if it is successful.
This commit is contained in:
parent
5cd523408d
commit
f9b81efe4b
@ -9145,7 +9145,7 @@ void ContactsManager::reload_created_public_dialogs(PublicDialogType type,
|
||||
}
|
||||
|
||||
void ContactsManager::finish_get_created_public_dialogs(PublicDialogType type, Result<Unit> &&result) {
|
||||
if (G()->close_flag()) {
|
||||
if (G()->close_flag() && result.is_ok()) {
|
||||
result = Global::request_aborted_error();
|
||||
}
|
||||
|
||||
|
@ -1438,7 +1438,7 @@ void GroupCallManager::reload_group_call(InputGroupCallId input_group_call_id,
|
||||
|
||||
void GroupCallManager::finish_get_group_call(InputGroupCallId input_group_call_id,
|
||||
Result<tl_object_ptr<telegram_api::phone_groupCall>> &&result) {
|
||||
if (G()->close_flag()) {
|
||||
if (G()->close_flag() && result.is_ok()) {
|
||||
result = Global::request_aborted_error();
|
||||
}
|
||||
|
||||
|
@ -23977,7 +23977,7 @@ MessagesManager::FoundMessages MessagesManager::offline_search_messages(DialogId
|
||||
|
||||
void MessagesManager::on_message_db_fts_result(Result<MessageDbFtsResult> result, string offset, int32 limit,
|
||||
int64 random_id, Promise<Unit> &&promise) {
|
||||
if (G()->close_flag()) {
|
||||
if (G()->close_flag() && result.is_ok()) {
|
||||
result = Global::request_aborted_error();
|
||||
}
|
||||
if (result.is_error()) {
|
||||
@ -24009,7 +24009,7 @@ void MessagesManager::on_message_db_fts_result(Result<MessageDbFtsResult> result
|
||||
void MessagesManager::on_message_db_calls_result(Result<MessageDbCallsResult> result, int64 random_id,
|
||||
MessageId first_db_message_id, MessageSearchFilter filter,
|
||||
Promise<Unit> &&promise) {
|
||||
if (G()->close_flag()) {
|
||||
if (G()->close_flag() && result.is_ok()) {
|
||||
result = Global::request_aborted_error();
|
||||
}
|
||||
if (result.is_error()) {
|
||||
@ -30191,7 +30191,7 @@ void MessagesManager::upload_imported_message_attachment(DialogId dialog_id, int
|
||||
}
|
||||
|
||||
void MessagesManager::on_imported_message_attachments_uploaded(int64 random_id, Result<Unit> &&result) {
|
||||
if (G()->close_flag()) {
|
||||
if (G()->close_flag() && result.is_ok()) {
|
||||
result = Global::request_aborted_error();
|
||||
}
|
||||
|
||||
@ -30920,7 +30920,7 @@ void MessagesManager::on_get_message_notifications_from_database(DialogId dialog
|
||||
int32 limit,
|
||||
Result<vector<MessageDbDialogMessage>> result,
|
||||
Promise<vector<Notification>> promise) {
|
||||
if (G()->close_flag()) {
|
||||
if (G()->close_flag() && result.is_ok()) {
|
||||
result = Global::request_aborted_error();
|
||||
}
|
||||
if (result.is_error()) {
|
||||
|
@ -975,7 +975,7 @@ void WebPagesManager::on_load_web_page_instant_view_from_database(WebPageId web_
|
||||
|
||||
void WebPagesManager::update_web_page_instant_view_load_requests(WebPageId web_page_id, bool force_update,
|
||||
Result<WebPageId> r_web_page_id) {
|
||||
if (G()->close_flag()) {
|
||||
if (G()->close_flag() && r_web_page_id.is_ok()) {
|
||||
r_web_page_id = Global::request_aborted_error();
|
||||
}
|
||||
LOG(INFO) << "Update load requests for " << web_page_id;
|
||||
|
Loading…
Reference in New Issue
Block a user