mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Another feed experiment
This commit is contained in:
@@ -928,7 +928,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
|
||||
let customChannelDiscussionReadState: Signal<MessageId?, NoError>
|
||||
if case let .peer(peerId) = chatLocation, peerId.namespace == Namespaces.Peer.CloudChannel {
|
||||
let cachedDataKey = PostboxViewKey.cachedPeerData(peerId: chatLocation.peerId)
|
||||
let cachedDataKey = PostboxViewKey.cachedPeerData(peerId: peerId)
|
||||
let peerKey = PostboxViewKey.basicPeer(peerId)
|
||||
customChannelDiscussionReadState = context.account.postbox.combinedView(keys: [cachedDataKey, peerKey])
|
||||
|> mapToSignal { views -> Signal<PeerId?, NoError> in
|
||||
@@ -1062,7 +1062,12 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
case let .id(id):
|
||||
initialSearchLocation = .id(id)
|
||||
case let .timestamp(timestamp):
|
||||
initialSearchLocation = .index(MessageIndex(id: MessageId(peerId: strongSelf.chatLocation.peerId, namespace: Namespaces.Message.Cloud, id: 1), timestamp: timestamp))
|
||||
if let peerId = strongSelf.chatLocation.peerId {
|
||||
initialSearchLocation = .index(MessageIndex(id: MessageId(peerId: peerId, namespace: Namespaces.Message.Cloud, id: 1), timestamp: timestamp))
|
||||
} else {
|
||||
//TODO:implement
|
||||
initialSearchLocation = .index(.absoluteUpperBound())
|
||||
}
|
||||
}
|
||||
strongSelf.chatHistoryLocationValue = ChatHistoryLocationInput(content: .InitialSearch(location: initialSearchLocation, count: 60, highlight: highlight), id: (strongSelf.chatHistoryLocationValue?.id).flatMap({ $0 + 1 }) ?? 0)
|
||||
} else if let subject = subject, case let .pinnedMessages(maybeMessageId) = subject, let messageId = maybeMessageId {
|
||||
@@ -1307,7 +1312,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
}
|
||||
if apply {
|
||||
switch chatLocation {
|
||||
case .peer, .replyThread:
|
||||
case .peer, .replyThread, .feed:
|
||||
if !context.sharedContext.immediateExperimentalUISettings.skipReadHistory {
|
||||
context.applyMaxReadIndex(for: chatLocation, contextHolder: chatLocationContextHolder, messageIndex: messageIndex)
|
||||
}
|
||||
@@ -1348,7 +1353,12 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
case let .id(id):
|
||||
initialSearchLocation = .id(id)
|
||||
case let .timestamp(timestamp):
|
||||
initialSearchLocation = .index(MessageIndex(id: MessageId(peerId: self.chatLocation.peerId, namespace: Namespaces.Message.Cloud, id: 1), timestamp: timestamp))
|
||||
if let peerId = self.chatLocation.peerId {
|
||||
initialSearchLocation = .index(MessageIndex(id: MessageId(peerId: peerId, namespace: Namespaces.Message.Cloud, id: 1), timestamp: timestamp))
|
||||
} else {
|
||||
//TODO:implement
|
||||
initialSearchLocation = .index(MessageIndex.absoluteUpperBound())
|
||||
}
|
||||
}
|
||||
self.chatHistoryLocationValue = ChatHistoryLocationInput(content: .InitialSearch(location: initialSearchLocation, count: 60, highlight: highlight), id: 0)
|
||||
} else if let subject = subject, case let .pinnedMessages(maybeMessageId) = subject, let messageId = maybeMessageId {
|
||||
@@ -2108,7 +2118,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
switch self.chatLocation {
|
||||
case .peer:
|
||||
messageIndex = maxIncomingIndex
|
||||
case .replyThread:
|
||||
case .replyThread, .feed:
|
||||
messageIndex = maxOverallIndex
|
||||
}
|
||||
|
||||
@@ -2520,7 +2530,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
switch strongSelf.chatLocation {
|
||||
case .peer:
|
||||
messageIndex = incomingIndex
|
||||
case .replyThread:
|
||||
case .replyThread, .feed:
|
||||
messageIndex = overallIndex
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user