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

Method readInboxTill

Telegram/SourceFiles/data/data_histories.cpp:209–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209void Histories::readInboxTill(not_null<HistoryItem*> item) {
210 const auto history = item->history();
211 if (!item->isRegular()) {
212 readClientSideMessage(item);
213 auto view = item->mainView();
214 if (!view) {
215 return;
216 }
217 auto block = view->block();
218 auto blockIndex = block->indexInHistory();
219 auto itemIndex = view->indexInBlock();
220 while (blockIndex > 0 || itemIndex > 0) {
221 if (itemIndex > 0) {
222 view = block->messages[--itemIndex].get();
223 } else {
224 while (blockIndex > 0) {
225 block = history->blocks[--blockIndex].get();
226 itemIndex = block->messages.size();
227 if (itemIndex > 0) {
228 view = block->messages[--itemIndex].get();
229 break;
230 }
231 }
232 }
233 item = view->data();
234 if (item->isRegular()) {
235 break;
236 }
237 }
238 if (!item->isRegular()) {
239 LOG(("App Error: "
240 "Can't read history till unknown local message."));
241 return;
242 }
243 }
244 readInboxTill(history, item->id);
245}
246
247void Histories::readInboxTill(not_null<History*> history, MsgId tillId) {
248 readInboxTill(history, tillId, false);

Callers 3

paintEventMethod · 0.80
keyPressEventMethod · 0.80
checkActivationMethod · 0.80

Calls 15

IsServerMsgIdFunction · 0.85
bFunction · 0.85
AppClass · 0.85
isRegularMethod · 0.80
mainViewMethod · 0.80
indexInHistoryMethod · 0.80
indexInBlockMethod · 0.80
updateChatListEntryMethod · 0.80
trackUnreadMessagesMethod · 0.80
countStillUnreadLocalMethod · 0.80

Tested by

no test coverage detected