From 453aecd9af5e726a8d58a10e49c2e07699146835 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 9 Mar 2023 16:51:12 +0300 Subject: [PATCH] Ignore USER_NOT_PARTICIPANT error when leaving a channel. --- td/telegram/ContactsManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index c7c14371c..7e500f8d8 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -2921,6 +2921,9 @@ class LeaveChannelQuery final : public Td::ResultHandler { } 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"); promise_.set_error(std::move(status)); }