mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Add maximum cache size setting
This commit is contained in:
@@ -2047,33 +2047,36 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
galleryController.setHintWillBePresentedInPreviewingContext(true)
|
||||
|
||||
let items: Signal<[ContextMenuItem], NoError> = context.account.postbox.transaction { transaction -> [ContextMenuItem] in
|
||||
let isChannel = peer.id.namespace == Namespaces.Peer.CloudChannel
|
||||
var items: [ContextMenuItem] = [
|
||||
.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Conversation_ContextMenuOpenProfile, icon: { theme in
|
||||
.action(ContextMenuActionItem(text: isChannel ? strongSelf.presentationData.strings.Conversation_ContextMenuOpenChannelProfile : strongSelf.presentationData.strings.Conversation_ContextMenuOpenProfile, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Info"), color: theme.actionSheet.primaryTextColor)
|
||||
}, action: { _, f in
|
||||
f(.dismissWithoutContent)
|
||||
self?.openPeer(peerId: peer.id, navigation: .info, fromMessage: nil)
|
||||
}))
|
||||
]
|
||||
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Conversation_ContextMenuSendMessage, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Message"), color: theme.actionSheet.primaryTextColor)
|
||||
items.append(.action(ContextMenuActionItem(text: isChannel ? strongSelf.presentationData.strings.Conversation_ContextMenuOpenChannel : strongSelf.presentationData.strings.Conversation_ContextMenuSendMessage, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: isChannel ? "Chat/Context Menu/Channels" : "Chat/Context Menu/Message"), color: theme.actionSheet.primaryTextColor)
|
||||
}, action: { _, f in
|
||||
f(.dismissWithoutContent)
|
||||
self?.openPeer(peerId: peer.id, navigation: .chat(textInputState: nil, subject: nil, peekData: nil), fromMessage: nil)
|
||||
})))
|
||||
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Conversation_ContextMenuMention, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Mention"), color: theme.actionSheet.primaryTextColor)
|
||||
}, action: { _, f in
|
||||
f(.dismissWithoutContent)
|
||||
|
||||
self?.interfaceInteraction?.updateTextInputStateAndMode { current, inputMode in
|
||||
var inputMode = inputMode
|
||||
if inputMode == .none {
|
||||
inputMode = .text
|
||||
if !isChannel {
|
||||
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Conversation_ContextMenuMention, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Mention"), color: theme.actionSheet.primaryTextColor)
|
||||
}, action: { _, f in
|
||||
f(.dismissWithoutContent)
|
||||
|
||||
self?.interfaceInteraction?.updateTextInputStateAndMode { current, inputMode in
|
||||
var inputMode = inputMode
|
||||
if inputMode == .none {
|
||||
inputMode = .text
|
||||
}
|
||||
return (chatTextInputAddMentionAttribute(current, peer: peer), inputMode)
|
||||
}
|
||||
return (chatTextInputAddMentionAttribute(current, peer: peer), inputMode)
|
||||
}
|
||||
})))
|
||||
})))
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user