Check close_flag() first.
This commit is contained in:
parent
516e2e8a07
commit
acef6e61a0
|
@ -381,7 +381,7 @@ void DeviceTokenManager::dec_sync_cnt() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceTokenManager::loop() {
|
void DeviceTokenManager::loop() {
|
||||||
if (sync_cnt_ != 0 || G()->close_flag()) {
|
if (G()->close_flag() || sync_cnt_ != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (int32 token_type = 1; token_type < TokenType::Size; token_type++) {
|
for (int32 token_type = 1; token_type < TokenType::Size; token_type++) {
|
||||||
|
|
|
@ -5907,7 +5907,7 @@ unique_ptr<MessageContent> get_message_content(Td *td, FormattedText message,
|
||||||
DialogId owner_dialog_id, int32 message_date, bool is_content_read,
|
DialogId owner_dialog_id, int32 message_date, bool is_content_read,
|
||||||
UserId via_bot_user_id, MessageSelfDestructType *ttl,
|
UserId via_bot_user_id, MessageSelfDestructType *ttl,
|
||||||
bool *disable_web_page_preview, const char *source) {
|
bool *disable_web_page_preview, const char *source) {
|
||||||
if (!td->auth_manager_->was_authorized() && !G()->close_flag() && media_ptr != nullptr &&
|
if (!G()->close_flag() && !td->auth_manager_->was_authorized() && media_ptr != nullptr &&
|
||||||
media_ptr->get_id() != telegram_api::messageMediaEmpty::ID) {
|
media_ptr->get_id() != telegram_api::messageMediaEmpty::ID) {
|
||||||
LOG(ERROR) << "Receive without authorization from " << source << ": " << to_string(media_ptr);
|
LOG(ERROR) << "Receive without authorization from " << source << ": " << to_string(media_ptr);
|
||||||
media_ptr = nullptr;
|
media_ptr = nullptr;
|
||||||
|
|
|
@ -23885,7 +23885,7 @@ void MessagesManager::on_message_media_uploaded(DialogId dialog_id, const Messag
|
||||||
actor_id(this), &MessagesManager::on_media_message_ready_to_send, dialog_id, message_id,
|
actor_id(this), &MessagesManager::on_media_message_ready_to_send, dialog_id, message_id,
|
||||||
PromiseCreator::lambda([this, dialog_id, input_media = std::move(input_media), file_id,
|
PromiseCreator::lambda([this, dialog_id, input_media = std::move(input_media), file_id,
|
||||||
thumbnail_file_id](Result<Message *> result) mutable {
|
thumbnail_file_id](Result<Message *> result) mutable {
|
||||||
if (result.is_error() || G()->close_flag()) {
|
if (G()->close_flag() || result.is_error()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23968,7 +23968,7 @@ void MessagesManager::on_secret_message_media_uploaded(DialogId dialog_id, const
|
||||||
send_closure_later(actor_id(this), &MessagesManager::on_media_message_ready_to_send, dialog_id, m->message_id,
|
send_closure_later(actor_id(this), &MessagesManager::on_media_message_ready_to_send, dialog_id, m->message_id,
|
||||||
PromiseCreator::lambda([this, dialog_id, secret_input_media = std::move(secret_input_media)](
|
PromiseCreator::lambda([this, dialog_id, secret_input_media = std::move(secret_input_media)](
|
||||||
Result<Message *> result) mutable {
|
Result<Message *> result) mutable {
|
||||||
if (result.is_error() || G()->close_flag()) {
|
if (G()->close_flag() || result.is_error()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24158,7 +24158,7 @@ void MessagesManager::on_upload_message_media_finished(int64 media_album_id, Dia
|
||||||
for (auto request_message_id : message_ids) {
|
for (auto request_message_id : message_ids) {
|
||||||
LOG(INFO) << "Send on_media_message_ready_to_send for " << request_message_id << " in " << dialog_id;
|
LOG(INFO) << "Send on_media_message_ready_to_send for " << request_message_id << " in " << dialog_id;
|
||||||
auto promise = PromiseCreator::lambda([this, media_album_id](Result<Message *> result) {
|
auto promise = PromiseCreator::lambda([this, media_album_id](Result<Message *> result) {
|
||||||
if (result.is_error() || G()->close_flag()) {
|
if (G()->close_flag() || result.is_error()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27891,7 +27891,7 @@ void MessagesManager::remove_message_notifications_by_message_ids(DialogId dialo
|
||||||
void MessagesManager::do_remove_message_notification(DialogId dialog_id, bool from_mentions,
|
void MessagesManager::do_remove_message_notification(DialogId dialog_id, bool from_mentions,
|
||||||
NotificationId notification_id,
|
NotificationId notification_id,
|
||||||
vector<MessageDbDialogMessage> result) {
|
vector<MessageDbDialogMessage> result) {
|
||||||
if (result.empty() || G()->close_flag()) {
|
if (G()->close_flag() || result.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CHECK(result.size() == 1);
|
CHECK(result.size() == 1);
|
||||||
|
|
|
@ -166,7 +166,7 @@ void NotificationManager::on_flush_pending_updates_timeout_callback(void *notifi
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NotificationManager::is_disabled() const {
|
bool NotificationManager::is_disabled() const {
|
||||||
return !td_->auth_manager_->is_authorized() || td_->auth_manager_->is_bot() || G()->close_flag();
|
return G()->close_flag() || !td_->auth_manager_->is_authorized() || td_->auth_manager_->is_bot();
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder &operator<<(StringBuilder &string_builder, const NotificationManager::ActiveNotificationsUpdate &update) {
|
StringBuilder &operator<<(StringBuilder &string_builder, const NotificationManager::ActiveNotificationsUpdate &update) {
|
||||||
|
|
|
@ -208,7 +208,7 @@ void PrivacyManager::do_update_privacy(UserPrivacySetting user_privacy_setting,
|
||||||
info.is_synchronized_ = true;
|
info.is_synchronized_ = true;
|
||||||
|
|
||||||
if (!(info.rules_ == privacy_rules)) {
|
if (!(info.rules_ == privacy_rules)) {
|
||||||
if ((from_update || was_synchronized) && !G()->close_flag()) {
|
if (!G()->close_flag() && (from_update || was_synchronized)) {
|
||||||
switch (user_privacy_setting.type()) {
|
switch (user_privacy_setting.type()) {
|
||||||
case UserPrivacySetting::Type::UserStatus: {
|
case UserPrivacySetting::Type::UserStatus: {
|
||||||
send_closure_later(G()->contacts_manager(), &ContactsManager::on_update_online_status_privacy);
|
send_closure_later(G()->contacts_manager(), &ContactsManager::on_update_online_status_privacy);
|
||||||
|
|
|
@ -620,7 +620,7 @@ void TopDialogManager::on_first_sync() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TopDialogManager::loop() {
|
void TopDialogManager::loop() {
|
||||||
if (td_->auth_manager_->is_bot() || G()->close_flag()) {
|
if (G()->close_flag() || td_->auth_manager_->is_bot()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user