Various improvements

This commit is contained in:
Isaac 2024-01-30 12:30:29 +01:00
parent 68dd428cbd
commit 83c7c54616
3 changed files with 24 additions and 4 deletions

View File

@ -164,6 +164,18 @@ public final class PeerInfoChatPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScro
self.presentationData = presentationData
})
let strings = self.presentationData.strings
self.statusPromise.set(self.context.engine.data.subscribe(
TelegramEngine.EngineData.Item.Messages.MessageCount(peerId: self.context.account.peerId, threadId: peerId.toInt64(), tag: [])
)
|> map { count in
if let count {
return PeerInfoStatusData(text: strings.Conversation_Messages(Int32(count)), isActivity: false, key: .savedMessages)
} else {
return nil
}
})
self.ready.set(self.chatController.ready.get())
self.addSubnode(self.chatController.displayNode)

View File

@ -9,6 +9,8 @@ public enum PeerInfoPaneKey: Int32 {
case members
case stories
case media
case savedMessagesChats
case savedMessages
case files
case music
case voice
@ -16,8 +18,6 @@ public enum PeerInfoPaneKey: Int32 {
case gifs
case groupsInCommon
case recommended
case savedMessagesChats
case savedMessages
}
public struct PeerInfoStatusData: Equatable {

View File

@ -36,7 +36,11 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode {
switch chatLocation {
case .peer, .replyThread, .feed:
if chatLocation.peerId == context.account.peerId, presentationInterfaceState.hasSearchTags {
if case .standard(.embedded(false)) = presentationInterfaceState.mode {
placeholderText = strings.Common_Search
} else {
placeholderText = strings.Chat_SearchTagsPlaceholder
}
} else {
placeholderText = strings.Conversation_SearchPlaceholder
}
@ -114,7 +118,11 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode {
if presentationInterfaceState.historyFilter != nil {
placeholderText = self.strings.Common_Search
} else if self.chatLocation.peerId == self.context.account.peerId, presentationInterfaceState.hasSearchTags {
if case .standard(.embedded(false)) = presentationInterfaceState.mode {
placeholderText = strings.Common_Search
} else {
placeholderText = self.strings.Chat_SearchTagsPlaceholder
}
} else {
placeholderText = self.strings.Conversation_SearchPlaceholder
}