diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 0299c74498..fb7f182b8a 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -8700,9 +8700,11 @@ Sorry for the inconvenience."; "Conversation.HoldForAudioOnly" = "Hold to record audio."; "Conversation.HoldForVideoOnly" = "Hold to record video."; "Conversation.Translation.TranslateTo" = "Translate to %@"; +"Conversation.Translation.TranslateToOther" = "Translate to %@"; "Conversation.Translation.ShowOriginal" = "Show Original"; "Conversation.Translation.ChooseLanguage" = "Choose Another Language"; "Conversation.Translation.DoNotTranslate" = "Do Not Translate %@"; +"Conversation.Translation.DoNotTranslateOther" = "Do Not Translate %@"; "Conversation.Translation.Hide" = "Hide"; "Conversation.Translation.AddedToDoNotTranslateText" = "**%@** is added to the Do Not Translate list."; "Conversation.Translation.TranslationBarHiddenChatText" = "Translation bar is now hidden for this chat."; @@ -8720,7 +8722,7 @@ Sorry for the inconvenience."; "AvatarEditor.SetProfilePhoto" = "Set as Profile Photo"; "AvatarEditor.SuggestProfilePhoto" = "Suggest as Profile Photo"; "AvatarEditor.SetGroupPhoto" = "Set as Group Photo"; -"AvatarEditor.SetChannelPhoto" = "Set as Group Photo"; +"AvatarEditor.SetChannelPhoto" = "Set as Channel Photo"; "AvatarEditor.Set" = "Set"; "Premium.UpgradeDescription" = "Your current **Telegram Premium** plan can be upgraded at a **discount**."; diff --git a/submodules/Display/Source/LinkHighlightingNode.swift b/submodules/Display/Source/LinkHighlightingNode.swift index 9d5ac326c4..7d823e7e90 100644 --- a/submodules/Display/Source/LinkHighlightingNode.swift +++ b/submodules/Display/Source/LinkHighlightingNode.swift @@ -96,7 +96,9 @@ public func generateRectsImage(color: UIColor, rects: [CGRect], inset: CGFloat, var currentRects: [CGRect] = [] for rect in rects { if rect.width.isZero { - combinedRects.append(currentRects) + if !currentRects.isEmpty { + combinedRects.append(currentRects) + } currentRects.removeAll() } else { currentRects.append(rect) diff --git a/submodules/LegacyUI/Sources/TelegramInitializeLegacyComponents.swift b/submodules/LegacyUI/Sources/TelegramInitializeLegacyComponents.swift index 02e30a3351..49c59c2352 100644 --- a/submodules/LegacyUI/Sources/TelegramInitializeLegacyComponents.swift +++ b/submodules/LegacyUI/Sources/TelegramInitializeLegacyComponents.swift @@ -182,7 +182,11 @@ private final class LegacyComponentsGlobalsProviderImpl: NSObject, LegacyCompone let convertedType: ManagedAudioSessionType switch type { case TGAudioSessionTypePlayAndRecord, TGAudioSessionTypePlayAndRecordHeadphones: - convertedType = .recordWithOthers + if legacyContext.sharedContext.currentMediaInputSettings.with({ $0 }).pauseMusicOnRecording { + convertedType = .record(speaker: false) + } else { + convertedType = .recordWithOthers + } default: convertedType = .play } diff --git a/submodules/TelegramUI/Sources/ChatMessageTextBubbleContentNode.swift b/submodules/TelegramUI/Sources/ChatMessageTextBubbleContentNode.swift index 23ff44da75..b1642c0a50 100644 --- a/submodules/TelegramUI/Sources/ChatMessageTextBubbleContentNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageTextBubbleContentNode.swift @@ -635,8 +635,7 @@ class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode { guard let item = self.item else { return } - let rects = self.textNode.textNode.rangeRects(in: NSRange(location: 0, length: self.textNode.textNode.cachedLayout?.attributedString?.length ?? 0))?.rects ?? [] - + let rects = self.textNode.textNode.rangeRects(in: NSRange(location: 0, length: self.textNode.textNode.cachedLayout?.attributedString?.length ?? 0))?.rects ?? [] if isTranslating, !rects.isEmpty { let shimmeringNode: ShimmeringLinkNode if let current = self.shimmeringNode { diff --git a/submodules/TelegramUI/Sources/CreateChannelController.swift b/submodules/TelegramUI/Sources/CreateChannelController.swift index 61f4205ee2..bc7c6c6290 100644 --- a/submodules/TelegramUI/Sources/CreateChannelController.swift +++ b/submodules/TelegramUI/Sources/CreateChannelController.swift @@ -641,19 +641,7 @@ public func createChannelController(context: AccountContext, mode: CreateChannel guard let imageCompletion, let videoCompletion else { return } - let peerType: AvatarEditorScreen.PeerType - if case .legacyGroup = peer { - peerType = .group - } else if case let .channel(channel) = peer { - if case .group = channel.info { - peerType = channel.flags.contains(.isForum) ? .forum : .group - } else { - peerType = .channel - } - } else { - peerType = .user - } - let controller = AvatarEditorScreen(context: context, inputData: keyboardInputData.get(), peerType: peerType, markup: nil) + let controller = AvatarEditorScreen(context: context, inputData: keyboardInputData.get(), peerType: .channel, markup: nil) controller.imageCompletion = imageCompletion controller.videoCompletion = videoCompletion pushControllerImpl?(controller) diff --git a/submodules/TelegramUI/Sources/CreateGroupController.swift b/submodules/TelegramUI/Sources/CreateGroupController.swift index 7e66187661..de1fca0a60 100644 --- a/submodules/TelegramUI/Sources/CreateGroupController.swift +++ b/submodules/TelegramUI/Sources/CreateGroupController.swift @@ -965,19 +965,7 @@ public func createGroupControllerImpl(context: AccountContext, peerIds: [PeerId] guard let imageCompletion, let videoCompletion else { return } - let peerType: AvatarEditorScreen.PeerType - if case .legacyGroup = peer { - peerType = .group - } else if case let .channel(channel) = peer { - if case .group = channel.info { - peerType = channel.flags.contains(.isForum) ? .forum : .group - } else { - peerType = .channel - } - } else { - peerType = .user - } - let controller = AvatarEditorScreen(context: context, inputData: keyboardInputData.get(), peerType: peerType, markup: nil) + let controller = AvatarEditorScreen(context: context, inputData: keyboardInputData.get(), peerType: .group, markup: nil) controller.imageCompletion = imageCompletion controller.videoCompletion = videoCompletion pushImpl?(controller) diff --git a/submodules/TelegramUI/Sources/EditableTokenListNode.swift b/submodules/TelegramUI/Sources/EditableTokenListNode.swift index 528ee840ff..6f72701385 100644 --- a/submodules/TelegramUI/Sources/EditableTokenListNode.swift +++ b/submodules/TelegramUI/Sources/EditableTokenListNode.swift @@ -311,7 +311,7 @@ final class EditableTokenListNode: ASDisplayNode, UITextFieldDelegate { self.clipsToBounds = true self.textFieldNode.textField.delegate = self - self.textFieldNode.textField.addTarget(self, action: #selector(textFieldChanged(_:)), for: .editingChanged) + self.textFieldNode.textField.addTarget(self, action: #selector(self.textFieldChanged(_:)), for: .editingChanged) self.textFieldNode.textField.didDeleteBackwardWhileEmpty = { [weak self] in if let strongSelf = self { if let selectedTokenId = strongSelf.selectedTokenId { @@ -518,7 +518,7 @@ final class EditableTokenListNode: ASDisplayNode, UITextFieldDelegate { for tokenNode in self.tokenNodes { let convertedPoint = self.view.convert(point, to: tokenNode.view) if tokenNode.bounds.contains(convertedPoint) { - if tokenNode.isSelected && convertedPoint.x < 24.0 { + if tokenNode.isSelected { self.deleteToken?(tokenNode.token.id) } else { self.updateSelectedTokenId(tokenNode.token.id, animated: true) diff --git a/submodules/TelegramUIPreferences/Sources/MediaInputSettings.swift b/submodules/TelegramUIPreferences/Sources/MediaInputSettings.swift index 35e68adf63..b49f77ce31 100644 --- a/submodules/TelegramUIPreferences/Sources/MediaInputSettings.swift +++ b/submodules/TelegramUIPreferences/Sources/MediaInputSettings.swift @@ -8,7 +8,7 @@ public struct MediaInputSettings: Codable, Equatable { public let pauseMusicOnRecording: Bool public static var defaultSettings: MediaInputSettings { - return MediaInputSettings(enableRaiseToSpeak: true, pauseMusicOnRecording: true) + return MediaInputSettings(enableRaiseToSpeak: true, pauseMusicOnRecording: false) } public init(enableRaiseToSpeak: Bool, pauseMusicOnRecording: Bool) { @@ -20,7 +20,7 @@ public struct MediaInputSettings: Codable, Equatable { let container = try decoder.container(keyedBy: StringCodingKey.self) self.enableRaiseToSpeak = (try container.decode(Int32.self, forKey: "enableRaiseToSpeak")) != 0 - self.pauseMusicOnRecording = (try container.decode(Int32.self, forKey: "pauseMusicOnRecording")) != 0 + self.pauseMusicOnRecording = (try container.decodeIfPresent(Int32.self, forKey: "pauseMusicOnRecording") ?? 0) != 0 } public func encode(to encoder: Encoder) throws {