MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / refreshRows

Method refreshRows

Telegram/SourceFiles/boxes/peer_list_controllers.cpp:1214–1243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1212}
1213
1214void ChooseTopicBoxController::refreshRows(bool initial) {
1215 auto added = false;
1216 if (_forum->bot()
1217 && !delegate()->peerListFindRow(PeerListRowId(0))
1218 && (!_filter || _filter(_forum->history()))) {
1219 const auto userCreatesTopics = Data::IsBotUserCreatesTopics(
1220 _forum->peer());
1221 delegate()->peerListAppendRow(
1222 std::make_unique<AllMessagesRow>(userCreatesTopics));
1223 added = true;
1224 }
1225 for (const auto &row : _forum->topicsList()->indexed()->all()) {
1226 if (const auto topic = row->topic()) {
1227 const auto id = topic->rootId().bare;
1228 auto already = delegate()->peerListFindRow(id);
1229 if (initial || !already) {
1230 if (auto created = createRow(topic)) {
1231 delegate()->peerListAppendRow(std::move(created));
1232 added = true;
1233 }
1234 } else if (already->isSearchResult()) {
1235 delegate()->peerListAppendFoundRow(already);
1236 added = true;
1237 }
1238 }
1239 }
1240 if (added) {
1241 delegate()->peerListRefreshRows();
1242 }
1243}
1244
1245void ChooseTopicBoxController::loadMoreRows() {
1246 _forum->requestTopics();

Callers

nothing calls this directly

Calls 15

IsBotUserCreatesTopicsFunction · 0.85
indexedMethod · 0.80
topicsListMethod · 0.80
rootIdMethod · 0.80
isSearchResultMethod · 0.80
sublistPeerMethod · 0.80
botMethod · 0.45
peerListFindRowMethod · 0.45
historyMethod · 0.45
peerMethod · 0.45
peerListAppendRowMethod · 0.45
topicMethod · 0.45

Tested by

no test coverage detected