mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Use getters in MTP classes.
This commit is contained in:
@@ -228,16 +228,18 @@ void GifsListWidget::inlineResultsDone(const MTPmessages_BotResults &result) {
|
||||
auto adding = (it != _inlineCache.cend());
|
||||
if (result.type() == mtpc_messages_botResults) {
|
||||
auto &d = result.c_messages_botResults();
|
||||
Auth().data().processUsers(d.vusers);
|
||||
Auth().data().processUsers(d.vusers());
|
||||
|
||||
auto &v = d.vresults.v;
|
||||
auto queryId = d.vquery_id.v;
|
||||
auto &v = d.vresults().v;
|
||||
auto queryId = d.vquery_id().v;
|
||||
|
||||
if (it == _inlineCache.cend()) {
|
||||
it = _inlineCache.emplace(_inlineQuery, std::make_unique<InlineCacheEntry>()).first;
|
||||
it = _inlineCache.emplace(
|
||||
_inlineQuery,
|
||||
std::make_unique<InlineCacheEntry>()).first;
|
||||
}
|
||||
auto entry = it->second.get();
|
||||
entry->nextOffset = qs(d.vnext_offset);
|
||||
entry->nextOffset = qs(d.vnext_offset().value_or_empty());
|
||||
if (auto count = v.size()) {
|
||||
entry->results.reserve(entry->results.size() + count);
|
||||
}
|
||||
@@ -853,9 +855,9 @@ void GifsListWidget::searchForGifs(const QString &query) {
|
||||
Expects(result.type() == mtpc_contacts_resolvedPeer);
|
||||
|
||||
auto &data = result.c_contacts_resolvedPeer();
|
||||
Auth().data().processUsers(data.vusers);
|
||||
Auth().data().processChats(data.vchats);
|
||||
if (auto peer = Auth().data().peerLoaded(peerFromMTP(data.vpeer))) {
|
||||
Auth().data().processUsers(data.vusers());
|
||||
Auth().data().processChats(data.vchats());
|
||||
if (auto peer = Auth().data().peerLoaded(peerFromMTP(data.vpeer()))) {
|
||||
if (auto user = peer->asUser()) {
|
||||
_searchBot = user;
|
||||
}
|
||||
|
Reference in New Issue
Block a user