mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
edc737dce1
commit
72fce11e2d
@ -8700,9 +8700,11 @@ Sorry for the inconvenience.";
|
|||||||
"Conversation.HoldForAudioOnly" = "Hold to record audio.";
|
"Conversation.HoldForAudioOnly" = "Hold to record audio.";
|
||||||
"Conversation.HoldForVideoOnly" = "Hold to record video.";
|
"Conversation.HoldForVideoOnly" = "Hold to record video.";
|
||||||
"Conversation.Translation.TranslateTo" = "Translate to %@";
|
"Conversation.Translation.TranslateTo" = "Translate to %@";
|
||||||
|
"Conversation.Translation.TranslateToOther" = "Translate to %@";
|
||||||
"Conversation.Translation.ShowOriginal" = "Show Original";
|
"Conversation.Translation.ShowOriginal" = "Show Original";
|
||||||
"Conversation.Translation.ChooseLanguage" = "Choose Another Language";
|
"Conversation.Translation.ChooseLanguage" = "Choose Another Language";
|
||||||
"Conversation.Translation.DoNotTranslate" = "Do Not Translate %@";
|
"Conversation.Translation.DoNotTranslate" = "Do Not Translate %@";
|
||||||
|
"Conversation.Translation.DoNotTranslateOther" = "Do Not Translate %@";
|
||||||
"Conversation.Translation.Hide" = "Hide";
|
"Conversation.Translation.Hide" = "Hide";
|
||||||
"Conversation.Translation.AddedToDoNotTranslateText" = "**%@** is added to the Do Not Translate list.";
|
"Conversation.Translation.AddedToDoNotTranslateText" = "**%@** is added to the Do Not Translate list.";
|
||||||
"Conversation.Translation.TranslationBarHiddenChatText" = "Translation bar is now hidden for this chat.";
|
"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.SetProfilePhoto" = "Set as Profile Photo";
|
||||||
"AvatarEditor.SuggestProfilePhoto" = "Suggest as Profile Photo";
|
"AvatarEditor.SuggestProfilePhoto" = "Suggest as Profile Photo";
|
||||||
"AvatarEditor.SetGroupPhoto" = "Set as Group Photo";
|
"AvatarEditor.SetGroupPhoto" = "Set as Group Photo";
|
||||||
"AvatarEditor.SetChannelPhoto" = "Set as Group Photo";
|
"AvatarEditor.SetChannelPhoto" = "Set as Channel Photo";
|
||||||
"AvatarEditor.Set" = "Set";
|
"AvatarEditor.Set" = "Set";
|
||||||
|
|
||||||
"Premium.UpgradeDescription" = "Your current **Telegram Premium** plan can be upgraded at a **discount**.";
|
"Premium.UpgradeDescription" = "Your current **Telegram Premium** plan can be upgraded at a **discount**.";
|
||||||
|
@ -96,7 +96,9 @@ public func generateRectsImage(color: UIColor, rects: [CGRect], inset: CGFloat,
|
|||||||
var currentRects: [CGRect] = []
|
var currentRects: [CGRect] = []
|
||||||
for rect in rects {
|
for rect in rects {
|
||||||
if rect.width.isZero {
|
if rect.width.isZero {
|
||||||
combinedRects.append(currentRects)
|
if !currentRects.isEmpty {
|
||||||
|
combinedRects.append(currentRects)
|
||||||
|
}
|
||||||
currentRects.removeAll()
|
currentRects.removeAll()
|
||||||
} else {
|
} else {
|
||||||
currentRects.append(rect)
|
currentRects.append(rect)
|
||||||
|
@ -182,7 +182,11 @@ private final class LegacyComponentsGlobalsProviderImpl: NSObject, LegacyCompone
|
|||||||
let convertedType: ManagedAudioSessionType
|
let convertedType: ManagedAudioSessionType
|
||||||
switch type {
|
switch type {
|
||||||
case TGAudioSessionTypePlayAndRecord, TGAudioSessionTypePlayAndRecordHeadphones:
|
case TGAudioSessionTypePlayAndRecord, TGAudioSessionTypePlayAndRecordHeadphones:
|
||||||
convertedType = .recordWithOthers
|
if legacyContext.sharedContext.currentMediaInputSettings.with({ $0 }).pauseMusicOnRecording {
|
||||||
|
convertedType = .record(speaker: false)
|
||||||
|
} else {
|
||||||
|
convertedType = .recordWithOthers
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
convertedType = .play
|
convertedType = .play
|
||||||
}
|
}
|
||||||
|
@ -635,8 +635,7 @@ class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
|
|||||||
guard let item = self.item else {
|
guard let item = self.item else {
|
||||||
return
|
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 {
|
if isTranslating, !rects.isEmpty {
|
||||||
let shimmeringNode: ShimmeringLinkNode
|
let shimmeringNode: ShimmeringLinkNode
|
||||||
if let current = self.shimmeringNode {
|
if let current = self.shimmeringNode {
|
||||||
|
@ -641,19 +641,7 @@ public func createChannelController(context: AccountContext, mode: CreateChannel
|
|||||||
guard let imageCompletion, let videoCompletion else {
|
guard let imageCompletion, let videoCompletion else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let peerType: AvatarEditorScreen.PeerType
|
let controller = AvatarEditorScreen(context: context, inputData: keyboardInputData.get(), peerType: .channel, markup: nil)
|
||||||
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)
|
|
||||||
controller.imageCompletion = imageCompletion
|
controller.imageCompletion = imageCompletion
|
||||||
controller.videoCompletion = videoCompletion
|
controller.videoCompletion = videoCompletion
|
||||||
pushControllerImpl?(controller)
|
pushControllerImpl?(controller)
|
||||||
|
@ -965,19 +965,7 @@ public func createGroupControllerImpl(context: AccountContext, peerIds: [PeerId]
|
|||||||
guard let imageCompletion, let videoCompletion else {
|
guard let imageCompletion, let videoCompletion else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let peerType: AvatarEditorScreen.PeerType
|
let controller = AvatarEditorScreen(context: context, inputData: keyboardInputData.get(), peerType: .group, markup: nil)
|
||||||
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)
|
|
||||||
controller.imageCompletion = imageCompletion
|
controller.imageCompletion = imageCompletion
|
||||||
controller.videoCompletion = videoCompletion
|
controller.videoCompletion = videoCompletion
|
||||||
pushImpl?(controller)
|
pushImpl?(controller)
|
||||||
|
@ -311,7 +311,7 @@ final class EditableTokenListNode: ASDisplayNode, UITextFieldDelegate {
|
|||||||
self.clipsToBounds = true
|
self.clipsToBounds = true
|
||||||
|
|
||||||
self.textFieldNode.textField.delegate = self
|
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
|
self.textFieldNode.textField.didDeleteBackwardWhileEmpty = { [weak self] in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
if let selectedTokenId = strongSelf.selectedTokenId {
|
if let selectedTokenId = strongSelf.selectedTokenId {
|
||||||
@ -518,7 +518,7 @@ final class EditableTokenListNode: ASDisplayNode, UITextFieldDelegate {
|
|||||||
for tokenNode in self.tokenNodes {
|
for tokenNode in self.tokenNodes {
|
||||||
let convertedPoint = self.view.convert(point, to: tokenNode.view)
|
let convertedPoint = self.view.convert(point, to: tokenNode.view)
|
||||||
if tokenNode.bounds.contains(convertedPoint) {
|
if tokenNode.bounds.contains(convertedPoint) {
|
||||||
if tokenNode.isSelected && convertedPoint.x < 24.0 {
|
if tokenNode.isSelected {
|
||||||
self.deleteToken?(tokenNode.token.id)
|
self.deleteToken?(tokenNode.token.id)
|
||||||
} else {
|
} else {
|
||||||
self.updateSelectedTokenId(tokenNode.token.id, animated: true)
|
self.updateSelectedTokenId(tokenNode.token.id, animated: true)
|
||||||
|
@ -8,7 +8,7 @@ public struct MediaInputSettings: Codable, Equatable {
|
|||||||
public let pauseMusicOnRecording: Bool
|
public let pauseMusicOnRecording: Bool
|
||||||
|
|
||||||
public static var defaultSettings: MediaInputSettings {
|
public static var defaultSettings: MediaInputSettings {
|
||||||
return MediaInputSettings(enableRaiseToSpeak: true, pauseMusicOnRecording: true)
|
return MediaInputSettings(enableRaiseToSpeak: true, pauseMusicOnRecording: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(enableRaiseToSpeak: Bool, pauseMusicOnRecording: Bool) {
|
public init(enableRaiseToSpeak: Bool, pauseMusicOnRecording: Bool) {
|
||||||
@ -20,7 +20,7 @@ public struct MediaInputSettings: Codable, Equatable {
|
|||||||
let container = try decoder.container(keyedBy: StringCodingKey.self)
|
let container = try decoder.container(keyedBy: StringCodingKey.self)
|
||||||
|
|
||||||
self.enableRaiseToSpeak = (try container.decode(Int32.self, forKey: "enableRaiseToSpeak")) != 0
|
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 {
|
public func encode(to encoder: Encoder) throws {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user