Ignore USER_NOT_PARTICIPANT error when leaving a channel.

This commit is contained in:
levlam 2023-03-09 16:51:12 +03:00
parent f100399c8e
commit 453aecd9af

View File

@ -2921,6 +2921,9 @@ class LeaveChannelQuery final : public Td::ResultHandler {
} }
void on_error(Status status) final { void on_error(Status status) final {
if (status.message() == "USER_NOT_PARTICIPANT") {
return td_->contacts_manager_->reload_channel(channel_id_, std::move(promise_));
}
td_->contacts_manager_->on_get_channel_error(channel_id_, status, "LeaveChannelQuery"); td_->contacts_manager_->on_get_channel_error(channel_id_, status, "LeaveChannelQuery");
promise_.set_error(std::move(status)); promise_.set_error(std::move(status));
} }