mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[WIP] Saved messages
This commit is contained in:
@@ -5067,9 +5067,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
}
|
||||
|
||||
let hasSearchTags: Signal<Bool, NoError>
|
||||
if case let .peer(peerId) = self.chatLocation, peerId == context.account.peerId {
|
||||
if let peerId = self.chatLocation.peerId, peerId == context.account.peerId {
|
||||
hasSearchTags = context.engine.data.subscribe(
|
||||
TelegramEngine.EngineData.Item.Messages.SavedMessageTagStats(peerId: context.account.peerId)
|
||||
TelegramEngine.EngineData.Item.Messages.SavedMessageTagStats(peerId: context.account.peerId, threadId: self.chatLocation.threadId)
|
||||
)
|
||||
|> map { tags -> Bool in
|
||||
return !tags.isEmpty
|
||||
@@ -5619,9 +5619,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
}
|
||||
|
||||
let hasSearchTags: Signal<Bool, NoError>
|
||||
if case let .peer(peerId) = self.chatLocation, peerId == context.account.peerId {
|
||||
if let peerId = self.chatLocation.peerId, peerId == context.account.peerId {
|
||||
hasSearchTags = context.engine.data.subscribe(
|
||||
TelegramEngine.EngineData.Item.Messages.SavedMessageTagStats(peerId: context.account.peerId)
|
||||
TelegramEngine.EngineData.Item.Messages.SavedMessageTagStats(peerId: context.account.peerId, threadId: self.chatLocation.threadId)
|
||||
)
|
||||
|> map { tags -> Bool in
|
||||
return !tags.isEmpty
|
||||
@@ -5727,6 +5727,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
return $0.updatedPeer { _ in
|
||||
return renderedPeer
|
||||
}.updatedSavedMessagesTopicPeer(savedMessagesPeer?.peer)
|
||||
.updatedHasSearchTags(hasSearchTags)
|
||||
})
|
||||
|
||||
(strongSelf.chatInfoNavigationButton?.buttonItem.customDisplayNode as? ChatAvatarNavigationNode)?.setPeer(context: strongSelf.context, theme: strongSelf.presentationData.theme, peer: savedMessagesPeer?.peer, overrideImage: imageOverride)
|
||||
|
||||
Reference in New Issue
Block a user