mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Reload chatbot rules after adding an exception.
This commit is contained in:
parent
5381fe5a1a
commit
9f67b9ba2f
2 changed files with 9 additions and 0 deletions
|
@ -164,6 +164,7 @@ void Chatbots::removeFrom(not_null<PeerData*> peer) {
|
||||||
api->requestPeerSettings(peer);
|
api->requestPeerSettings(peer);
|
||||||
}
|
}
|
||||||
_sentRequests.remove(peer);
|
_sentRequests.remove(peer);
|
||||||
|
reload();
|
||||||
}).fail([=] {
|
}).fail([=] {
|
||||||
api->requestPeerSettings(peer);
|
api->requestPeerSettings(peer);
|
||||||
_sentRequests.remove(peer);
|
_sentRequests.remove(peer);
|
||||||
|
@ -171,4 +172,10 @@ void Chatbots::removeFrom(not_null<PeerData*> peer) {
|
||||||
_sentRequests[peer] = SentRequest{ type, id };
|
_sentRequests[peer] = SentRequest{ type, id };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Chatbots::reload() {
|
||||||
|
_loaded = false;
|
||||||
|
_owner->session().api().request(base::take(_requestId)).cancel();
|
||||||
|
preload();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Data
|
} // namespace Data
|
||||||
|
|
|
@ -55,6 +55,8 @@ private:
|
||||||
mtpRequestId requestId = 0;
|
mtpRequestId requestId = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void reload();
|
||||||
|
|
||||||
const not_null<Session*> _owner;
|
const not_null<Session*> _owner;
|
||||||
|
|
||||||
rpl::variable<ChatbotsSettings> _settings;
|
rpl::variable<ChatbotsSettings> _settings;
|
||||||
|
|
Loading…
Add table
Reference in a new issue