Various fixes

This commit is contained in:
Ilya Laktyushin 2022-11-10 19:03:06 +04:00
parent 1cd53598d0
commit 57c7a4d521
2 changed files with 12 additions and 6 deletions

View File

@ -178,7 +178,7 @@ public class ChatListItem: ListViewItem, ChatListSearchItemNeighbour {
if case let .forum(_, _, threadIdValue, _, _) = self.index {
threadId = threadIdValue
}
self.interaction.messageSelected(peer, threadId, message, promoInfo)
self.interaction.messageSelected(peer, threadId ?? message.threadId, message, promoInfo)
} else if let peer = peer.peer {
self.interaction.peerSelected(peer, nil, nil, promoInfo)
} else if let peer = peer.peers[peer.peerId] {
@ -1352,6 +1352,10 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
forumTopicData = forumTopicDataValue
topForumTopicItems = topForumTopicItemsValue
if item.interaction.searchTextHighightState != nil, threadInfo == nil, topForumTopicItems.isEmpty, let message = messagesValue.first, let threadId = message.threadId, let associatedThreadInfo = message.associatedThreadInfo {
topForumTopicItems = [EngineChatList.ForumTopicData(id: threadId, title: associatedThreadInfo.title, iconFileId: associatedThreadInfo.icon, iconColor: associatedThreadInfo.iconColor, maxOutgoingReadMessageId: message.id, isUnread: false)]
}
switch peerValue.peer {
case .user, .secretChat:
if let peerPresence = peerPresence, case .present = peerPresence.status {
@ -2018,14 +2022,16 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
var effectiveAuthorTitle = (hideAuthor && !hasDraft) ? nil : authorAttributedString
let isSearching = item.interaction.searchTextHighightState != nil
var forumThreads: [(id: Int64, title: NSAttributedString, iconId: Int64?, iconColor: Int32)] = []
if forumThread != nil || !topForumTopicItems.isEmpty {
if let forumThread = forumThread {
forumThreads.append((id: forumThread.id, title: NSAttributedString(string: forumThread.title, font: textFont, textColor: forumThread.isUnread ? theme.authorNameColor : theme.messageTextColor), iconId: forumThread.iconId, iconColor: forumThread.iconColor))
forumThreads.append((id: forumThread.id, title: NSAttributedString(string: forumThread.title, font: textFont, textColor: forumThread.isUnread || isSearching ? theme.authorNameColor : theme.messageTextColor), iconId: forumThread.iconId, iconColor: forumThread.iconColor))
}
for item in topForumTopicItems {
if forumThread?.id != item.id {
forumThreads.append((id: item.id, title: NSAttributedString(string: item.title, font: textFont, textColor: item.isUnread ? theme.authorNameColor : theme.messageTextColor), iconId: item.iconFileId, iconColor: item.iconColor))
forumThreads.append((id: item.id, title: NSAttributedString(string: item.title, font: textFont, textColor: item.isUnread || isSearching ? theme.authorNameColor : theme.messageTextColor), iconId: item.iconFileId, iconColor: item.iconColor))
}
}
@ -2492,7 +2498,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
let textNodeFrame = CGRect(origin: CGPoint(x: contentRect.origin.x - 1.0, y: contentRect.minY + titleLayout.size.height - 1.0 + UIScreenPixel + (authorLayout.height.isZero ? 0.0 : (authorLayout.height - 3.0))), size: textLayout.size)
strongSelf.textNode.textNode.frame = textNodeFrame
if let textArrowImage = textArrowImage {
if let textArrowImage = textArrowImage, !isSearching {
let textArrowNode: ASImageNode
if let current = strongSelf.textArrowNode {
textArrowNode = current
@ -2510,7 +2516,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
textArrowNode.removeFromSupernode()
}
if let topForumTopicRect {
if let topForumTopicRect, !isSearching {
let compoundHighlightingNode: LinkHighlightingNode
if let current = strongSelf.compoundHighlightingNode {
compoundHighlightingNode = current

View File

@ -666,7 +666,7 @@ public func makeDefaultDarkPresentationTheme(extendingThemeReference: Presentati
panelSeparatorColor: UIColor(rgb: 0x545458, alpha: 0.3),
panelBackgroundColor: UIColor(rgb: 0x141414, alpha: 0.65),
buttonFillColor: UIColor(rgb: 0xe9e9e9, alpha: 0.85),
buttonHighlightColor: UIColor(rgb: 0xffffff, alpha: 0.1),
buttonHighlightColor: UIColor(rgb: 0xffffff, alpha: 0.05),
buttonStrokeColor: UIColor(rgb: 0x000000, alpha: 0.85),
buttonHighlightedFillColor: UIColor(rgb: 0x5a5a5a, alpha: 0.7),
buttonHighlightedStrokeColor: UIColor(rgb: 0x0c0c0c),