[WIP] Quotes and link previews

This commit is contained in:
Ali
2023-10-18 01:11:23 +04:00
parent 137c3d9101
commit af8474aca5
88 changed files with 2582 additions and 966 deletions

View File

@@ -135,7 +135,7 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie
adjustedUpdateItems.append(ChatHistoryViewTransitionUpdateEntry(index: adjustedIndex, previousIndex: adjustedPreviousIndex, entry: entry, directionHint: directionHint))
}
var scrolledToIndex: MessageHistoryAnchorIndex?
var scrolledToIndex: MessageHistoryScrollToSubject?
var scrolledToSomeIndex = false
let curve: ListViewAnimationCurve = scrollAnimationCurve ?? .Default(duration: nil)
@@ -193,13 +193,14 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie
index += 1
}
}
case let .index(scrollIndex, position, directionHint, animated, highlight, displayLink):
case let .index(scrollSubject, position, directionHint, animated, highlight, displayLink):
let scrollIndex = scrollSubject
if case .center = position, highlight {
scrolledToIndex = scrollIndex
scrolledToIndex = scrollSubject
}
var index = toView.filteredEntries.count - 1
for entry in toView.filteredEntries {
if scrollIndex.isLessOrEqual(to: entry.index) {
if scrollIndex.index.isLessOrEqual(to: entry.index) {
scrollToItem = ListViewScrollToItem(index: index, position: position, animated: animated, curve: curve, directionHint: directionHint, displayLink: displayLink)
break
}
@@ -209,7 +210,7 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie
if scrollToItem == nil {
var index = 0
for entry in toView.filteredEntries.reversed() {
if !scrollIndex.isLess(than: entry.index) {
if !scrollIndex.index.isLess(than: entry.index) {
scrolledToSomeIndex = true
scrollToItem = ListViewScrollToItem(index: index, position: position, animated: animated, curve: curve, directionHint: directionHint)
break