| 5624 | } |
| 5625 | |
| 5626 | RowDescriptor 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 | |
| 5659 | bool InnerWidget::jumpToDialogRow(RowDescriptor to) { |
| 5660 | if (to == chatListEntryLast()) { |
nothing calls this directly
no test coverage detected