mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Fix channel comment message threadIds
This commit is contained in:
parent
0cc27f6782
commit
4199e25314
@ -437,6 +437,7 @@ final class MutableMessageHistoryView {
|
|||||||
case .external:
|
case .external:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func replay(postbox: PostboxImpl, transaction: PostboxTransaction) -> Bool {
|
func replay(postbox: PostboxImpl, transaction: PostboxTransaction) -> Bool {
|
||||||
|
@ -575,7 +575,17 @@ func enqueueMessages(transaction: Transaction, account: Account, peerId: PeerId,
|
|||||||
if let replyToMessageId = replyToMessageId {
|
if let replyToMessageId = replyToMessageId {
|
||||||
if let message = transaction.getMessage(replyToMessageId) {
|
if let message = transaction.getMessage(replyToMessageId) {
|
||||||
if let threadIdValue = message.threadId {
|
if let threadIdValue = message.threadId {
|
||||||
threadId = threadIdValue
|
if threadIdValue == 1 {
|
||||||
|
if let channel = transaction.getPeer(message.id.peerId) as? TelegramChannel, channel.flags.contains(.isForum) {
|
||||||
|
threadId = threadIdValue
|
||||||
|
} else {
|
||||||
|
if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .group = channel.info {
|
||||||
|
threadId = makeMessageThreadId(replyToMessageId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
threadId = threadIdValue
|
||||||
|
}
|
||||||
} else if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .group = channel.info {
|
} else if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .group = channel.info {
|
||||||
threadId = makeMessageThreadId(replyToMessageId)
|
threadId = makeMessageThreadId(replyToMessageId)
|
||||||
}
|
}
|
||||||
|
@ -3065,13 +3065,15 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||||||
|
|
||||||
if foundCorrelationMessage {
|
if foundCorrelationMessage {
|
||||||
self.layoutActionOnViewTransition = nil
|
self.layoutActionOnViewTransition = nil
|
||||||
|
let (mappedTransition, updateSizeAndInsets) = layoutActionOnViewTransition(transition)
|
||||||
|
self.transaction(deleteIndices: mappedTransition.deleteItems, insertIndicesAndItems: transition.insertItems, updateIndicesAndItems: transition.updateItems, options: mappedTransition.options, scrollToItem: mappedTransition.scrollToItem, updateSizeAndInsets: updateSizeAndInsets, stationaryItemRange: mappedTransition.stationaryItemRange, updateOpaqueState: ChatHistoryTransactionOpaqueState(historyView: transition.historyView), completion: { result in
|
||||||
|
completion(true, result)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
self.transaction(deleteIndices: transition.deleteItems, insertIndicesAndItems: transition.insertItems, updateIndicesAndItems: transition.updateItems, options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange, updateOpaqueState: ChatHistoryTransactionOpaqueState(historyView: transition.historyView), completion: { result in
|
||||||
|
completion(false, result)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let (mappedTransition, updateSizeAndInsets) = layoutActionOnViewTransition(transition)
|
|
||||||
|
|
||||||
self.transaction(deleteIndices: mappedTransition.deleteItems, insertIndicesAndItems: transition.insertItems, updateIndicesAndItems: transition.updateItems, options: mappedTransition.options, scrollToItem: mappedTransition.scrollToItem, updateSizeAndInsets: updateSizeAndInsets, stationaryItemRange: mappedTransition.stationaryItemRange, updateOpaqueState: ChatHistoryTransactionOpaqueState(historyView: transition.historyView), completion: { result in
|
|
||||||
completion(true, result)
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
self.transaction(deleteIndices: transition.deleteItems, insertIndicesAndItems: transition.insertItems, updateIndicesAndItems: transition.updateItems, options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange, updateOpaqueState: ChatHistoryTransactionOpaqueState(historyView: transition.historyView), completion: { result in
|
self.transaction(deleteIndices: transition.deleteItems, insertIndicesAndItems: transition.insertItems, updateIndicesAndItems: transition.updateItems, options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange, updateOpaqueState: ChatHistoryTransactionOpaqueState(historyView: transition.historyView), completion: { result in
|
||||||
completion(false, result)
|
completion(false, result)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user