Various fixes

This commit is contained in:
Ilya Laktyushin 2021-02-20 20:31:43 +04:00
parent 9d3f6d34c0
commit 4e4f479b57
3 changed files with 12 additions and 4 deletions

View File

@ -456,7 +456,7 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
self.currentMessage = message
let canDelete: Bool
var canShare = !message.containsSecretMedia && !Namespaces.Message.allScheduled.contains(message.id.namespace)
var canShare = !message.containsSecretMedia
var canEdit = false
for media in message.media {

View File

@ -218,6 +218,8 @@ public final class InviteLinkQRCodeController: ViewController {
self.qrButtonNode = HighlightTrackingButtonNode()
self.qrImageNode = TransformImageNode()
self.qrImageNode.clipsToBounds = true
self.qrImageNode.cornerRadius = 16.0
self.qrIconNode = AnimatedStickerNode()
if let path = getAppBundle().path(forResource: "PlaneLogo", ofType: "tgs") {

View File

@ -1013,7 +1013,9 @@ final class ChatMediaInputNode: ChatInputNode {
gallery.setHintWillBePresentedInPreviewingContext(true)
var items: [ContextMenuItem] = []
items.append(.action(ContextMenuActionItem(text: strongSelf.strings.MediaPicker_Send, icon: { _ in nil }, action: { _, f in
items.append(.action(ContextMenuActionItem(text: strongSelf.strings.MediaPicker_Send, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Resend"), color: theme.actionSheet.primaryTextColor)
}, action: { _, f in
f(.default)
if isSaved {
let _ = self?.controllerInteraction.sendGif(file.file, sourceNode, sourceRect)
@ -1022,7 +1024,9 @@ final class ChatMediaInputNode: ChatInputNode {
}
})))
if isSaved || isGifSaved {
items.append(.action(ContextMenuActionItem(text: strongSelf.strings.Conversation_ContextMenuDelete, textColor: .destructive, icon: { _ in nil }, action: { _, f in
items.append(.action(ContextMenuActionItem(text: strongSelf.strings.Conversation_ContextMenuDelete, textColor: .destructive, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.actionSheet.destructiveActionTextColor)
}, action: { _, f in
f(.dismissWithoutContent)
guard let strongSelf = self else {
@ -1031,7 +1035,9 @@ final class ChatMediaInputNode: ChatInputNode {
let _ = removeSavedGif(postbox: strongSelf.context.account.postbox, mediaId: file.file.media.fileId).start()
})))
} else if canSaveGif && !isGifSaved {
items.append(.action(ContextMenuActionItem(text: strongSelf.strings.Preview_SaveGif, icon: { _ in nil }, action: { _, f in
items.append(.action(ContextMenuActionItem(text: strongSelf.strings.Preview_SaveGif, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Save"), color: theme.actionSheet.primaryTextColor)
}, action: { _, f in
f(.dismissWithoutContent)
guard let strongSelf = self else {