diff --git a/submodules/DebugSettingsUI/Sources/DebugController.swift b/submodules/DebugSettingsUI/Sources/DebugController.swift index c9f31be081..1ddd32ac9b 100644 --- a/submodules/DebugSettingsUI/Sources/DebugController.swift +++ b/submodules/DebugSettingsUI/Sources/DebugController.swift @@ -72,7 +72,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { case keepChatNavigationStack(PresentationTheme, Bool) case skipReadHistory(PresentationTheme, Bool) case unidirectionalSwipeToReply(Bool) - case dustEffect(Bool) + case callV2(Bool) case alternativeStoryMedia(Bool) case crashOnSlowQueries(PresentationTheme, Bool) case crashOnMemoryPressure(PresentationTheme, Bool) @@ -125,7 +125,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { return DebugControllerSection.logging.rawValue case .webViewInspection, .resetWebViewCache: return DebugControllerSection.web.rawValue - case .keepChatNavigationStack, .skipReadHistory, .unidirectionalSwipeToReply, .dustEffect, .alternativeStoryMedia, .crashOnSlowQueries, .crashOnMemoryPressure: + case .keepChatNavigationStack, .skipReadHistory, .unidirectionalSwipeToReply, .callV2, .alternativeStoryMedia, .crashOnSlowQueries, .crashOnMemoryPressure: return DebugControllerSection.experiments.rawValue case .clearTips, .resetNotifications, .crash, .resetData, .resetDatabase, .resetDatabaseAndCache, .resetHoles, .reindexUnread, .resetCacheIndex, .reindexCache, .resetBiometricsData, .optimizeDatabase, .photoPreview, .knockoutWallpaper, .storiesExperiment, .storiesJpegExperiment, .playlistPlayback, .enableQuickReactionSwitch, .voiceConference, .experimentalCompatibility, .enableDebugDataDisplay, .acceleratedStickers, .inlineForums, .localTranscription, .enableReactionOverrides, .restorePurchases: return DebugControllerSection.experiments.rawValue @@ -178,7 +178,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { return 16 case .unidirectionalSwipeToReply: return 17 - case .dustEffect: + case .callV2: return 18 case .alternativeStoryMedia: return 19 @@ -951,11 +951,11 @@ private enum DebugControllerEntry: ItemListNodeEntry { return settings }).start() }) - case let .dustEffect(value): - return ItemListSwitchItem(presentationData: presentationData, title: "Dust Effect", value: value, sectionId: self.section, style: .blocks, updated: { value in + case let .callV2(value): + return ItemListSwitchItem(presentationData: presentationData, title: "CallV2", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = updateExperimentalUISettingsInteractively(accountManager: arguments.sharedContext.accountManager, { settings in var settings = settings - settings.dustEffect = value + settings.callV2 = value return settings }).start() }) @@ -1426,7 +1426,7 @@ private func debugControllerEntries(sharedContext: SharedAccountContext, present entries.append(.skipReadHistory(presentationData.theme, experimentalSettings.skipReadHistory)) #endif entries.append(.unidirectionalSwipeToReply(experimentalSettings.unidirectionalSwipeToReply)) - entries.append(.dustEffect(experimentalSettings.dustEffect)) + entries.append(.callV2(experimentalSettings.callV2)) entries.append(.alternativeStoryMedia(experimentalSettings.alternativeStoryMedia)) } entries.append(.crashOnSlowQueries(presentationData.theme, experimentalSettings.crashOnLongQueries)) diff --git a/submodules/TelegramCallsUI/Sources/CallController.swift b/submodules/TelegramCallsUI/Sources/CallController.swift index 110c3c4b24..b13783c8a2 100644 --- a/submodules/TelegramCallsUI/Sources/CallController.swift +++ b/submodules/TelegramCallsUI/Sources/CallController.swift @@ -148,7 +148,12 @@ public final class CallController: ViewController { } override public func loadDisplayNode() { + var useV2 = self.call.context.sharedContext.immediateExperimentalUISettings.callV2 if let data = self.call.context.currentAppConfiguration.with({ $0 }).data, let _ = data["ios_killswitch_disable_callui_v2"] { + useV2 = false + } + + if !useV2 { self.displayNode = CallControllerNode(sharedContext: self.sharedContext, account: self.account, presentationData: self.presentationData, statusBar: self.statusBar, debugInfo: self.call.debugInfo(), shouldStayHiddenUntilConnection: !self.call.isOutgoing && self.call.isIntegratedWithCallKit, easyDebugAccess: self.easyDebugAccess, call: self.call) self.isContentsReady.set(.single(true)) } else { diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index 5c1858bc06..ea9f3274e8 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -1673,10 +1673,13 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL let colorImage = generateSettingsMenuPeerColorsLabelIcon(colors: colors) var boostIcon: UIImage? + var additionalBadge: String? if let approximateBoostLevel = channel.approximateBoostLevel, approximateBoostLevel < 1 { boostIcon = generateDisclosureActionBoostLevelBadgeImage(text: presentationData.strings.Channel_Info_BoostLevelPlusBadge("1").string) + } else { + additionalBadge = presentationData.strings.Settings_New } - items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemPeerColor, label: .image(colorImage, colorImage.size), additionalBadgeIcon: boostIcon, text: presentationData.strings.Channel_Info_AppearanceItem, icon: UIImage(bundleImageName: "Chat/Info/NameColorIcon"), action: { + items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemPeerColor, label: .image(colorImage, colorImage.size), additionalBadgeLabel: additionalBadge, additionalBadgeIcon: boostIcon, text: presentationData.strings.Channel_Info_AppearanceItem, icon: UIImage(bundleImageName: "Chat/Info/NameColorIcon"), action: { interaction.editingOpenNameColorSetup() })) } diff --git a/submodules/TelegramUI/Components/Settings/BoostLevelIconComponent/Sources/BoostLevelIconComponent.swift b/submodules/TelegramUI/Components/Settings/BoostLevelIconComponent/Sources/BoostLevelIconComponent.swift index 0bee22b64e..5f8d9d42d9 100644 --- a/submodules/TelegramUI/Components/Settings/BoostLevelIconComponent/Sources/BoostLevelIconComponent.swift +++ b/submodules/TelegramUI/Components/Settings/BoostLevelIconComponent/Sources/BoostLevelIconComponent.swift @@ -82,7 +82,7 @@ public final class BoostLevelIconComponent: Component { func update(component: BoostLevelIconComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment, transition: Transition) -> CGSize { if self.component != component { - self.imageView.image = generateDisclosureActionBoostLevelBadgeImage(text: component.strings.Channel_Appearance_BoostLevel("\(component.level)")) + self.imageView.image = generateDisclosureActionBoostLevelBadgeImage(text: component.strings.Channel_Appearance_BoostLevel("\(component.level)").string) } self.component = component diff --git a/submodules/TelegramUIPreferences/Sources/ExperimentalUISettings.swift b/submodules/TelegramUIPreferences/Sources/ExperimentalUISettings.swift index ee0f1844e0..189ca331ef 100644 --- a/submodules/TelegramUIPreferences/Sources/ExperimentalUISettings.swift +++ b/submodules/TelegramUIPreferences/Sources/ExperimentalUISettings.swift @@ -54,7 +54,7 @@ public struct ExperimentalUISettings: Codable, Equatable { public var storiesJpegExperiment: Bool public var crashOnMemoryPressure: Bool public var unidirectionalSwipeToReply: Bool - public var dustEffect: Bool + public var callV2: Bool public var alternativeStoryMedia: Bool public var allowWebViewInspection: Bool @@ -89,7 +89,7 @@ public struct ExperimentalUISettings: Codable, Equatable { storiesJpegExperiment: false, crashOnMemoryPressure: false, unidirectionalSwipeToReply: false, - dustEffect: false, + callV2: false, alternativeStoryMedia: false, allowWebViewInspection: false ) @@ -125,7 +125,7 @@ public struct ExperimentalUISettings: Codable, Equatable { storiesJpegExperiment: Bool, crashOnMemoryPressure: Bool, unidirectionalSwipeToReply: Bool, - dustEffect: Bool, + callV2: Bool, alternativeStoryMedia: Bool, allowWebViewInspection: Bool ) { @@ -158,7 +158,7 @@ public struct ExperimentalUISettings: Codable, Equatable { self.storiesJpegExperiment = storiesJpegExperiment self.crashOnMemoryPressure = crashOnMemoryPressure self.unidirectionalSwipeToReply = unidirectionalSwipeToReply - self.dustEffect = dustEffect + self.callV2 = callV2 self.alternativeStoryMedia = alternativeStoryMedia self.allowWebViewInspection = allowWebViewInspection } @@ -195,7 +195,7 @@ public struct ExperimentalUISettings: Codable, Equatable { self.storiesJpegExperiment = try container.decodeIfPresent(Bool.self, forKey: "storiesJpegExperiment") ?? false self.crashOnMemoryPressure = try container.decodeIfPresent(Bool.self, forKey: "crashOnMemoryPressure") ?? false self.unidirectionalSwipeToReply = try container.decodeIfPresent(Bool.self, forKey: "unidirectionalSwipeToReply") ?? false - self.dustEffect = try container.decodeIfPresent(Bool.self, forKey: "dustEffect_2") ?? false + self.callV2 = try container.decodeIfPresent(Bool.self, forKey: "callV2") ?? false self.alternativeStoryMedia = try container.decodeIfPresent(Bool.self, forKey: "alternativeStoryMedia") ?? false self.allowWebViewInspection = try container.decodeIfPresent(Bool.self, forKey: "allowWebViewInspection") ?? false } @@ -232,7 +232,7 @@ public struct ExperimentalUISettings: Codable, Equatable { try container.encode(self.storiesJpegExperiment, forKey: "storiesJpegExperiment") try container.encode(self.crashOnMemoryPressure, forKey: "crashOnMemoryPressure") try container.encode(self.unidirectionalSwipeToReply, forKey: "unidirectionalSwipeToReply") - try container.encode(self.dustEffect, forKey: "dustEffect_2") + try container.encode(self.callV2, forKey: "callV2") try container.encode(self.alternativeStoryMedia, forKey: "alternativeStoryMedia") try container.encode(self.allowWebViewInspection, forKey: "allowWebViewInspection") }