mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Merge commit '30e40411499e3bfdfe41f47c1a3c39236a50a1c8'
# Conflicts: # submodules/TelegramCore/Sources/TelegramEngine/Payments/Stars.swift
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user