Merge commit '30e40411499e3bfdfe41f47c1a3c39236a50a1c8'

# Conflicts:
#	submodules/TelegramCore/Sources/TelegramEngine/Payments/Stars.swift
This commit is contained in:
Isaac
2024-10-29 00:41:00 +01:00
52 changed files with 1429 additions and 255 deletions

View File

@@ -653,6 +653,9 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
private var loadStateUpdated: ((ChatHistoryNodeLoadState, Bool) -> Void)?
private var additionalLoadStateUpdated: [(ChatHistoryNodeLoadState, Bool) -> Void] = []
public private(set) var hasAtLeast3Messages: Bool = false
public var hasAtLeast3MessagesUpdated: ((Bool) -> Void)?
public private(set) var hasPlentyOfMessages: Bool = false
public var hasPlentyOfMessagesUpdated: ((Bool) -> Void)?
@@ -3779,13 +3782,18 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
}
}
var hasAtLeast3Messages = false
var hasPlentyOfMessages = false
var hasLotsOfMessages = false
if let historyView = strongSelf.historyView {
if historyView.originalView.holeEarlier || historyView.originalView.holeLater {
hasAtLeast3Messages = true
hasPlentyOfMessages = true
hasLotsOfMessages = true
} else if !historyView.originalView.holeEarlier && !historyView.originalView.holeLater {
if historyView.filteredEntries.count >= 3 {
hasAtLeast3Messages = true
}
if historyView.filteredEntries.count >= 10 {
hasPlentyOfMessages = true
}
@@ -3795,6 +3803,10 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
}
}
if strongSelf.hasAtLeast3Messages != hasAtLeast3Messages {
strongSelf.hasAtLeast3Messages = hasAtLeast3Messages
strongSelf.hasAtLeast3MessagesUpdated?(hasAtLeast3Messages)
}
if strongSelf.hasPlentyOfMessages != hasPlentyOfMessages {
strongSelf.hasPlentyOfMessages = hasPlentyOfMessages
strongSelf.hasPlentyOfMessagesUpdated?(hasPlentyOfMessages)