mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
[WIP] Topics
This commit is contained in:
parent
508cbc7366
commit
adc94814c9
@ -420,10 +420,12 @@ final class MutableMessageHistoryView {
|
|||||||
|
|
||||||
func updatePeerIds(transaction: PostboxTransaction) {
|
func updatePeerIds(transaction: PostboxTransaction) {
|
||||||
switch self.peerIds {
|
switch self.peerIds {
|
||||||
case let .single(peerId, _):
|
case let .single(peerId, threadId):
|
||||||
if let updatedData = transaction.currentUpdatedCachedPeerData[peerId] {
|
if threadId == nil {
|
||||||
if updatedData.associatedHistoryMessageId != nil {
|
if let updatedData = transaction.currentUpdatedCachedPeerData[peerId] {
|
||||||
self.peerIds = .associated(peerId, updatedData.associatedHistoryMessageId)
|
if updatedData.associatedHistoryMessageId != nil {
|
||||||
|
self.peerIds = .associated(peerId, updatedData.associatedHistoryMessageId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case let .associated(peerId, associatedId):
|
case let .associated(peerId, associatedId):
|
||||||
|
@ -4725,10 +4725,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
self.reportIrrelvantGeoNoticePromise.set(.single(nil))
|
self.reportIrrelvantGeoNoticePromise.set(.single(nil))
|
||||||
|
|
||||||
let replyThreadType: ChatTitleContent.ReplyThreadType
|
let replyThreadType: ChatTitleContent.ReplyThreadType
|
||||||
|
var replyThreadId: Int64?
|
||||||
switch chatLocation {
|
switch chatLocation {
|
||||||
case .peer:
|
case .peer:
|
||||||
replyThreadType = .replies
|
replyThreadType = .replies
|
||||||
case let .replyThread(replyThreadMessage):
|
case let .replyThread(replyThreadMessage):
|
||||||
|
replyThreadId = Int64(replyThreadMessage.messageId.id)
|
||||||
if replyThreadMessage.isChannelPost {
|
if replyThreadMessage.isChannelPost {
|
||||||
replyThreadType = .comments
|
replyThreadType = .comments
|
||||||
} else {
|
} else {
|
||||||
@ -4742,11 +4744,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
|
|
||||||
let messageAndTopic = messagePromise.get()
|
let messageAndTopic = messagePromise.get()
|
||||||
|> mapToSignal { message -> Signal<(message: Message?, threadData: MessageHistoryThreadData?), NoError> in
|
|> mapToSignal { message -> Signal<(message: Message?, threadData: MessageHistoryThreadData?), NoError> in
|
||||||
guard let message = message else {
|
guard let replyThreadId = replyThreadId else {
|
||||||
return .single((nil, nil))
|
return .single((message, nil))
|
||||||
}
|
}
|
||||||
|
let viewKey: PostboxViewKey = .messageHistoryThreadInfo(peerId: peerId, threadId: replyThreadId)
|
||||||
let viewKey: PostboxViewKey = .messageHistoryThreadInfo(peerId: peerId, threadId: Int64(message.id.id))
|
|
||||||
return context.account.postbox.combinedView(keys: [viewKey])
|
return context.account.postbox.combinedView(keys: [viewKey])
|
||||||
|> map { views -> (message: Message?, threadData: MessageHistoryThreadData?) in
|
|> map { views -> (message: Message?, threadData: MessageHistoryThreadData?) in
|
||||||
guard let view = views.views[viewKey] as? MessageHistoryThreadInfoView else {
|
guard let view = views.views[viewKey] as? MessageHistoryThreadInfoView else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user