diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 4846c0ec09..ced71d78bd 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -6760,6 +6760,7 @@ Sorry for the inconvenience."; "Conversation.ForwardOptions.Text" = "What whould you like to do with %1$@ from %2$@?"; "Conversation.ForwardOptions.TextPersonal" = "What whould you like to do with %1$@ from your chat with %2$@?"; +"Conversation.ForwardOptions.TextSaved" = "What whould you like to do with %1$@ from your Saved Messages?"; "Conversation.ForwardOptions.ShowOptions" = "Show Forwarding Options"; "Conversation.ForwardOptions.CancelForwarding" = "Cancel Forwarding"; diff --git a/submodules/CallListUI/Sources/CallListControllerNode.swift b/submodules/CallListUI/Sources/CallListControllerNode.swift index da0a55f504..0812280fd2 100644 --- a/submodules/CallListUI/Sources/CallListControllerNode.swift +++ b/submodules/CallListUI/Sources/CallListControllerNode.swift @@ -710,6 +710,9 @@ final class CallListControllerNode: ASDisplayNode { self.emptyButtonTextNode.layer.animateAlpha(from: previousAlpha, to: alpha, duration: 0.25) self.emptyButtonNode.isUserInteractionEnabled = !isHidden + self.listNode.alpha = 1.0 - alpha + self.listNode.layer.animateAlpha(from: 1.0 - previousAlpha, to: 1.0 - alpha, duration: 0.25) + if !isHidden { let type = self.currentLocationAndType.scope let emptyText: String diff --git a/submodules/TelegramUI/Sources/AppDelegate.swift b/submodules/TelegramUI/Sources/AppDelegate.swift index d28e42339f..d77804fefc 100644 --- a/submodules/TelegramUI/Sources/AppDelegate.swift +++ b/submodules/TelegramUI/Sources/AppDelegate.swift @@ -2124,7 +2124,7 @@ private func extractAccountManagerState(records: AccountRecordsView Void = { userId in + let startCall: (PeerId) -> Void = { peerId in self.startCallWhenReady(accountId: nil, peerId: peerId, isVideo: isVideo) } diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index e2c0901db3..c64bdf6ed3 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -6927,7 +6927,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G if (isPremium || maybeSuggestPremium) && !isHidden { return chatTranslationState(context: context, peerId: peerId) |> map { translationState -> ChatPresentationTranslationState? in - if let translationState, !translationState.fromLang.isEmpty { + if let translationState, !translationState.fromLang.isEmpty && (translationState.fromLang != baseLanguageCode || translationState.isEnabled) { return ChatPresentationTranslationState(isEnabled: translationState.isEnabled, fromLang: translationState.fromLang, toLang: translationState.toLang ?? baseLanguageCode) } else { return nil diff --git a/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift b/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift index be0009f633..4debf79fd8 100644 --- a/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift @@ -1050,6 +1050,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { } } + if let subject = item.associatedData.subject, case .forwardedMessages = subject { + needsShareButton = false + } + var isEmoji = false if let _ = telegramDice { imageSize = displaySize diff --git a/submodules/TelegramUI/Sources/ChatMessageBubbleItemNode.swift b/submodules/TelegramUI/Sources/ChatMessageBubbleItemNode.swift index 731862597a..1e6cddcfb6 100644 --- a/submodules/TelegramUI/Sources/ChatMessageBubbleItemNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageBubbleItemNode.swift @@ -1353,6 +1353,10 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode needsShareButton = false } } + + if let subject = item.associatedData.subject, case .forwardedMessages = subject { + needsShareButton = false + } var tmpWidth: CGFloat if allowFullWidth { diff --git a/submodules/TelegramUI/Sources/ChatMessageInstantVideoItemNode.swift b/submodules/TelegramUI/Sources/ChatMessageInstantVideoItemNode.swift index f51c390768..e11a2937fb 100644 --- a/submodules/TelegramUI/Sources/ChatMessageInstantVideoItemNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageInstantVideoItemNode.swift @@ -362,6 +362,10 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerD } } + if let subject = item.associatedData.subject, case .forwardedMessages = subject { + needsShareButton = false + } + var layoutInsets = layoutConstants.instantVideo.insets if dateHeaderAtBottom { layoutInsets.top += layoutConstants.timestampHeaderHeight diff --git a/submodules/TelegramUI/Sources/ChatMessageStickerItemNode.swift b/submodules/TelegramUI/Sources/ChatMessageStickerItemNode.swift index 5b7e8cb05f..070c7142e4 100644 --- a/submodules/TelegramUI/Sources/ChatMessageStickerItemNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageStickerItemNode.swift @@ -513,6 +513,10 @@ class ChatMessageStickerItemNode: ChatMessageItemView { } } + if let subject = item.associatedData.subject, case .forwardedMessages = subject { + needsShareButton = false + } + var layoutInsets = UIEdgeInsets(top: mergedTop.merged ? layoutConstants.bubble.mergedSpacing : layoutConstants.bubble.defaultSpacing, left: 0.0, bottom: mergedBottom.merged ? layoutConstants.bubble.mergedSpacing : layoutConstants.bubble.defaultSpacing, right: 0.0) if dateHeaderAtBottom { layoutInsets.top += layoutConstants.timestampHeaderHeight diff --git a/submodules/TelegramUI/Sources/ForwardAccessoryPanelNode.swift b/submodules/TelegramUI/Sources/ForwardAccessoryPanelNode.swift index 2678e8d4bd..efc8bb8395 100644 --- a/submodules/TelegramUI/Sources/ForwardAccessoryPanelNode.swift +++ b/submodules/TelegramUI/Sources/ForwardAccessoryPanelNode.swift @@ -86,7 +86,7 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode { let messageIds: [MessageId] private var messages: [Message] = [] private var authors: String? - private var sourcePeer: (isPersonal: Bool, displayTitle: String)? + private var sourcePeer: (peerId: PeerId, displayTitle: String)? let closeButton: HighlightableButtonNode let lineNode: ASImageNode @@ -172,7 +172,7 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode { var uniquePeerIds = Set() var title = "" var text = NSMutableAttributedString(string: "") - var sourcePeer: (Bool, String)? + var sourcePeer: (PeerId, String)? for message in messages { if let author = message.forwardInfo?.author ?? message.effectiveAuthor, !uniquePeerIds.contains(author.id) { uniquePeerIds.insert(author.id) @@ -186,7 +186,7 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode { } } if let peer = message.peers[message.id.peerId] { - sourcePeer = (peer.id.namespace == Namespaces.Peer.CloudUser, EnginePeer(peer).displayTitle(strings: strongSelf.strings, displayOrder: strongSelf.nameDisplayOrder)) + sourcePeer = (peer.id, EnginePeer(peer).displayTitle(strings: strongSelf.strings, displayOrder: strongSelf.nameDisplayOrder)) } } @@ -361,13 +361,20 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode { } @objc func closePressed() { - guard let (isPersonal, peerDisplayTitle) = self.sourcePeer else { + guard let (peerId, peerDisplayTitle) = self.sourcePeer else { return } let messageCount = Int32(self.messageIds.count) let messages = self.strings.Conversation_ForwardOptions_Messages(messageCount) - let string = isPersonal ? self.strings.Conversation_ForwardOptions_TextPersonal(messages, peerDisplayTitle) : self.strings.Conversation_ForwardOptions_Text(messages, peerDisplayTitle) - + let string: PresentationStrings.FormattedString + if peerId == self.context.account.peerId { + string = self.strings.Conversation_ForwardOptions_TextSaved(messages) + } else if peerId.namespace == Namespaces.Peer.CloudUser { + string = self.strings.Conversation_ForwardOptions_TextPersonal(messages, peerDisplayTitle) + } else { + string = self.strings.Conversation_ForwardOptions_Text(messages, peerDisplayTitle) + } + let font = Font.regular(floor(self.fontSize.baseDisplaySize * 15.0 / 17.0)) let boldFont = Font.semibold(floor(self.fontSize.baseDisplaySize * 15.0 / 17.0)) let body = MarkdownAttributeSet(font: font, textColor: self.theme.actionSheet.secondaryTextColor)