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

Method computeJump

Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp:5626–5657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5624}
5625
5626RowDescriptor InnerWidget::computeJump(
5627 const RowDescriptor &to,
5628 JumpSkip skip) const {
5629 auto result = to;
5630 if (result.key) {
5631 const auto down = (skip == JumpSkip::NextOrEnd)
5632 || (skip == JumpSkip::NextOrOriginal);
5633 const auto needSkip = [&] {
5634 return (result.key.folder() != nullptr)
5635 || (GetEnhancedBool("skip_to_next")
5636 && !result.key.entry()->chatListUnreadState().messages
5637 && !result.key.entry()->chatListUnreadState().marks)
5638 || (session().supportMode()
5639 && !result.key.entry()->chatListBadgesState().unread);
5640 };
5641 while (needSkip()) {
5642 const auto next = down
5643 ? chatListEntryAfter(result)
5644 : chatListEntryBefore(result);
5645 if (next.key) {
5646 result = next;
5647 } else {
5648 if (skip == JumpSkip::PreviousOrOriginal
5649 || skip == JumpSkip::NextOrOriginal) {
5650 result = to;
5651 }
5652 break;
5653 }
5654 }
5655 }
5656 return result;
5657}
5658
5659bool InnerWidget::jumpToDialogRow(RowDescriptor to) {
5660 if (to == chatListEntryLast()) {

Callers

nothing calls this directly

Calls 6

GetEnhancedBoolFunction · 0.85
supportModeMethod · 0.80
folderMethod · 0.45
chatListUnreadStateMethod · 0.45
entryMethod · 0.45
chatListBadgesStateMethod · 0.45

Tested by

no test coverage detected