diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index abff60c6e0..b6b30bc99d 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -6613,6 +6613,14 @@ Sorry for the inconvenience."; "WallpaperPreview.Animate" = "Animate"; "WallpaperPreview.AnimateDescription" = "Colors will move when you send messages"; +"Username.InvalidStartsWithUnderscore" = "Sorry, a username can't start with an underscore."; +"Username.InvalidEndsWithUnderscore" = "Sorry, a username can't end with an underscore."; + +"Channel.Username.InvalidStartsWithUnderscore" = "Channel names can't start with an underscore."; +"Channel.Username.InvalidEndsWithUnderscore" = "Channel names can't end with an underscore."; + +"Group.Username.InvalidStartsWithUnderscore" = "Group names can't start with an underscore."; +"Group.Username.InvalidEndsWithUnderscore" = "Group names can't end with an underscore."; "Appstore.Cloud" = "**Cloud-based**\nUnlimited storage for chats,\nmedia and documents."; "Appstore.Cloud.Profile" = "**Jennifer**\n23 y.o. designer from San Francisco."; @@ -6645,4 +6653,3 @@ Sorry for the inconvenience."; "Appstore.Secure" = "**Secure**\nAll chats are protected\nwith strong encryption."; "Appstore.Secure.Chat" = "**Little Sister**\nAny gift ideas for mom?\n**You**A dog!\n**You**I'm serious. Let's get her a puppy. \n**You**\nI saw this!\n**Little Sister**\nI needed proof this was your idea!"; "Appstore.Secure.Chat.Name" = "**Little Sister**"; - diff --git a/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift b/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift index 5b51dff0a7..ad94da6eb9 100644 --- a/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift @@ -560,9 +560,17 @@ private func channelVisibilityControllerEntries(presentationData: PresentationDa text = presentationData.strings.Channel_Username_InvalidStartsWithNumber } case .startsWithUnderscore: - text = presentationData.strings.Channel_Username_InvalidCharacters + if isGroup { + text = presentationData.strings.Group_Username_InvalidStartsWithUnderscore + } else { + text = presentationData.strings.Channel_Username_InvalidStartsWithUnderscore + } case .endsWithUnderscore: - text = presentationData.strings.Channel_Username_InvalidCharacters + if isGroup { + text = presentationData.strings.Group_Username_InvalidEndsWithUnderscore + } else { + text = presentationData.strings.Channel_Username_InvalidEndsWithUnderscore + } case .tooShort: if isGroup { text = presentationData.strings.Group_Username_InvalidTooShort @@ -696,9 +704,9 @@ private func channelVisibilityControllerEntries(presentationData: PresentationDa case .startsWithDigit: text = presentationData.strings.Group_Username_InvalidStartsWithNumber case .startsWithUnderscore: - text = presentationData.strings.Channel_Username_InvalidCharacters + text = presentationData.strings.Channel_Username_InvalidStartsWithUnderscore case .endsWithUnderscore: - text = presentationData.strings.Channel_Username_InvalidCharacters + text = presentationData.strings.Channel_Username_InvalidEndsWithUnderscore case .tooShort: text = presentationData.strings.Group_Username_InvalidTooShort case .invalidCharacters: diff --git a/submodules/SettingsUI/Sources/Themes/ThemeAccentColorControllerNode.swift b/submodules/SettingsUI/Sources/Themes/ThemeAccentColorControllerNode.swift index 9f10567e80..cdfd7766a4 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeAccentColorControllerNode.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeAccentColorControllerNode.swift @@ -1181,8 +1181,8 @@ final class ThemeAccentColorControllerNode: ASDisplayNode, UIScrollViewDelegate updated.backgroundColors = [] } } - appeared = true } + appeared = true } else { updated.colorPanelCollapsed = true if updated.patternWallpaper != nil { diff --git a/submodules/SettingsUI/Sources/Themes/WallpaperColorPickerNode.swift b/submodules/SettingsUI/Sources/Themes/WallpaperColorPickerNode.swift index 4f8acaa470..81e8bd28e0 100644 --- a/submodules/SettingsUI/Sources/Themes/WallpaperColorPickerNode.swift +++ b/submodules/SettingsUI/Sources/Themes/WallpaperColorPickerNode.swift @@ -272,6 +272,7 @@ struct HSBColor: Equatable { } let values: (h: CGFloat, s: CGFloat, b: CGFloat) + let backingColor: UIColor var hue: CGFloat { return self.values.h @@ -291,14 +292,17 @@ struct HSBColor: Equatable { init(values: (h: CGFloat, s: CGFloat, b: CGFloat)) { self.values = values + self.backingColor = UIColor(hue: values.h, saturation: values.s, brightness: values.b, alpha: 1.0) } init(hue: CGFloat, saturation: CGFloat, brightness: CGFloat) { self.values = (h: hue, s: saturation, b: brightness) + self.backingColor = UIColor(hue: self.values.h, saturation: self.values.s, brightness: self.values.b, alpha: 1.0) } init(color: UIColor) { self.values = color.hsb + self.backingColor = color } init(rgb: UInt32) { @@ -306,7 +310,7 @@ struct HSBColor: Equatable { } var color: UIColor { - return UIColor(hue: self.values.h, saturation: self.values.s, brightness: self.values.b, alpha: 1.0) + return self.backingColor } } diff --git a/submodules/SettingsUI/Sources/UsernameSetupController.swift b/submodules/SettingsUI/Sources/UsernameSetupController.swift index 11a86a6b54..b3ea2e1a71 100644 --- a/submodules/SettingsUI/Sources/UsernameSetupController.swift +++ b/submodules/SettingsUI/Sources/UsernameSetupController.swift @@ -194,7 +194,11 @@ private func usernameSetupControllerEntries(presentationData: PresentationData, switch error { case .startsWithDigit: statusText = presentationData.strings.Username_InvalidStartsWithNumber - case .startsWithUnderscore, .endsWithUnderscore, .invalidCharacters: + case .startsWithUnderscore: + statusText = presentationData.strings.Username_InvalidStartsWithUnderscore + case .endsWithUnderscore: + statusText = presentationData.strings.Username_InvalidEndsWithUnderscore + case .invalidCharacters: statusText = presentationData.strings.Username_InvalidCharacters case .tooShort: statusText = presentationData.strings.Username_InvalidTooShort