mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Merge commit '838c352971dd8a75be5940a351eab0ff6a97c4c4'
# Conflicts: # submodules/TelegramUI/Sources/ChatHistoryEntriesForView.swift
This commit is contained in:
@@ -15,6 +15,7 @@ func chatHistoryEntriesForView(
|
||||
includeSearchEntry: Bool,
|
||||
reverse: Bool,
|
||||
groupMessages: Bool,
|
||||
reverseGroupedMessages: Bool,
|
||||
selectedMessages: Set<MessageId>?,
|
||||
presentationData: ChatPresentationData,
|
||||
historyAppearsCleared: Bool,
|
||||
@@ -155,12 +156,21 @@ func chatHistoryEntriesForView(
|
||||
}
|
||||
}
|
||||
|
||||
if groupMessages {
|
||||
if groupMessages || reverseGroupedMessages {
|
||||
if !groupBucket.isEmpty && message.groupInfo != groupBucket[0].0.groupInfo {
|
||||
let groupStableId = groupBucket[0].0.groupInfo!.stableId
|
||||
if !existingGroupStableIds.contains(groupStableId) {
|
||||
existingGroupStableIds.append(groupStableId)
|
||||
entries.append(.MessageGroupEntry(groupBucket[0].0.groupInfo!, groupBucket, presentationData))
|
||||
if reverseGroupedMessages {
|
||||
groupBucket.reverse()
|
||||
}
|
||||
if groupMessages {
|
||||
let groupStableId = groupBucket[0].0.groupInfo!.stableId
|
||||
if !existingGroupStableIds.contains(groupStableId) {
|
||||
existingGroupStableIds.append(groupStableId)
|
||||
entries.append(.MessageGroupEntry(groupBucket[0].0.groupInfo!, groupBucket, presentationData))
|
||||
}
|
||||
} else {
|
||||
for (message, isRead, selection, attributes, location) in groupBucket {
|
||||
entries.append(.MessageEntry(message, presentationData, isRead, location, selection, attributes))
|
||||
}
|
||||
}
|
||||
groupBucket.removeAll()
|
||||
}
|
||||
@@ -193,15 +203,21 @@ func chatHistoryEntriesForView(
|
||||
}
|
||||
|
||||
if !groupBucket.isEmpty {
|
||||
assert(groupMessages)
|
||||
|
||||
let groupStableId = groupBucket[0].0.groupInfo!.stableId
|
||||
if !existingGroupStableIds.contains(groupStableId) {
|
||||
existingGroupStableIds.append(groupStableId)
|
||||
entries.append(.MessageGroupEntry(groupBucket[0].0.groupInfo!, groupBucket, presentationData))
|
||||
assert(groupMessages || reverseGroupedMessages)
|
||||
if reverseGroupedMessages {
|
||||
groupBucket.reverse()
|
||||
}
|
||||
if groupMessages {
|
||||
let groupStableId = groupBucket[0].0.groupInfo!.stableId
|
||||
if !existingGroupStableIds.contains(groupStableId) {
|
||||
existingGroupStableIds.append(groupStableId)
|
||||
entries.append(.MessageGroupEntry(groupBucket[0].0.groupInfo!, groupBucket, presentationData))
|
||||
}
|
||||
} else {
|
||||
for (message, isRead, selection, attributes, location) in groupBucket {
|
||||
entries.append(.MessageEntry(message, presentationData, isRead, location, selection, attributes))
|
||||
}
|
||||
}
|
||||
|
||||
groupBucket.removeAll()
|
||||
}
|
||||
|
||||
if let maybeJoinMessage = joinMessage, !view.holeLater {
|
||||
|
||||
Reference in New Issue
Block a user