Ignore STORY_NOT_MODIFIED errors for regular users.

This commit is contained in:
levlam 2023-06-05 18:28:21 +03:00
parent f57ab79f67
commit b82d711508

View File

@ -196,6 +196,9 @@ class EditStoryPrivacyQuery final : public Td::ResultHandler {
} }
void on_error(Status status) final { void on_error(Status status) final {
if (!td_->auth_manager_->is_bot() && status.message() == "STORY_NOT_MODIFIED") {
return promise_.set_value(Unit());
}
promise_.set_error(std::move(status)); promise_.set_error(std::move(status));
} }
}; };
@ -375,6 +378,10 @@ class StoryManager::EditStoryQuery final : public Td::ResultHandler {
void on_error(Status status) final { void on_error(Status status) final {
LOG(INFO) << "Receive error for EditStoryQuery: " << status; LOG(INFO) << "Receive error for EditStoryQuery: " << status;
if (!td_->auth_manager_->is_bot() && status.message() == "STORY_NOT_MODIFIED") {
return td_->story_manager_->on_story_edited(file_id_, std::move(pending_story_), Status::OK());
}
if (G()->close_flag() && G()->use_message_database()) { if (G()->close_flag() && G()->use_message_database()) {
// do not send error, story will be edited after restart // do not send error, story will be edited after restart
return; return;