Reload chatbot rules after adding an exception.

This commit is contained in:
John Preston 2024-03-20 16:58:52 +04:00
parent 5381fe5a1a
commit 9f67b9ba2f
2 changed files with 9 additions and 0 deletions

View file

@ -164,6 +164,7 @@ void Chatbots::removeFrom(not_null<PeerData*> peer) {
api->requestPeerSettings(peer);
}
_sentRequests.remove(peer);
reload();
}).fail([=] {
api->requestPeerSettings(peer);
_sentRequests.remove(peer);
@ -171,4 +172,10 @@ void Chatbots::removeFrom(not_null<PeerData*> peer) {
_sentRequests[peer] = SentRequest{ type, id };
}
void Chatbots::reload() {
_loaded = false;
_owner->session().api().request(base::take(_requestId)).cancel();
preload();
}
} // namespace Data

View file

@ -55,6 +55,8 @@ private:
mtpRequestId requestId = 0;
};
void reload();
const not_null<Session*> _owner;
rpl::variable<ChatbotsSettings> _settings;