Fix saved message handling

This commit is contained in:
Ali 2023-04-13 19:02:31 +04:00
parent 76a78d3fb0
commit 5342401f31
2 changed files with 13 additions and 2 deletions

View File

@ -469,7 +469,11 @@ public class ItemListDisclosureItemNode: ListViewItemNode, ItemListItemNode {
if case let .channel(channel) = iconPeer, channel.flags.contains(.isForum) { if case let .channel(channel) = iconPeer, channel.flags.contains(.isForum) {
clipStyle = .roundedRect clipStyle = .roundedRect
} }
avatarNode.setPeer(context: context, theme: item.presentationData.theme, peer: iconPeer, clipStyle: clipStyle) var overrideImage: AvatarNodeImageOverride?
if iconPeer.id == context.account.peerId {
overrideImage = .savedMessagesIcon
}
avatarNode.setPeer(context: context, theme: item.presentationData.theme, peer: iconPeer, overrideImage: overrideImage, clipStyle: clipStyle)
} else if let avatarNode = strongSelf.avatarNode { } else if let avatarNode = strongSelf.avatarNode {
strongSelf.avatarNode = nil strongSelf.avatarNode = nil
avatarNode.removeFromSupernode() avatarNode.removeFromSupernode()

View File

@ -166,7 +166,14 @@ private enum StorageUsageExceptionsEntry: ItemListNodeEntry {
optionText = timeIntervalString(strings: presentationData.strings, value: value) optionText = timeIntervalString(strings: presentationData.strings, value: value)
} }
return ItemListDisclosureItem(presentationData: presentationData, icon: nil, context: arguments.context, iconPeer: EnginePeer(peer.peer), title: EnginePeer(peer.peer).displayTitle(strings: presentationData.strings, displayOrder: .firstLast), enabled: true, titleFont: .bold, label: optionText, labelStyle: .text, additionalDetailLabel: additionalDetailLabel, sectionId: self.section, style: .blocks, disclosureStyle: .optionArrows, action: { let title: String
if peer.peer.id == arguments.context.account.peerId {
title = presentationData.strings.DialogList_SavedMessages
} else {
title = EnginePeer(peer.peer).displayTitle(strings: presentationData.strings, displayOrder: .firstLast)
}
return ItemListDisclosureItem(presentationData: presentationData, icon: nil, context: arguments.context, iconPeer: EnginePeer(peer.peer), title: title, enabled: true, titleFont: .bold, label: optionText, labelStyle: .text, additionalDetailLabel: additionalDetailLabel, sectionId: self.section, style: .blocks, disclosureStyle: .optionArrows, action: {
arguments.openPeerMenu(peer.peer.id, value) arguments.openPeerMenu(peer.peer.id, value)
}, tag: StorageUsageExceptionsEntryTag.peer(peer.peer.id)) }, tag: StorageUsageExceptionsEntryTag.peer(peer.peer.id))
} }