Skip to content

Commit e12e096

Browse files
committed
Various fixes
1 parent 7facb8b commit e12e096

File tree

12 files changed

+101
-46
lines changed

12 files changed

+101
-46
lines changed

‎Telegram/Telegram-iOS/en.lproj/Localizable.strings‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15891,6 +15891,8 @@ Error: %8$@";
1589115891

1589215892
"GroupInfo.ActionSend" = "Send Message";
1589315893
"GroupInfo.ActionEditRank" = "Edit Member Tag";
15894+
"GroupInfo.ActionEditAdminRank" = "Edit Admin Tag";
15895+
"GroupInfo.ActionEditAdmin" = "Edit Admin Rights";
1589415896
"GroupInfo.ActionRemove" = "Remove";
1589515897

1589615898
"PeerInfo.EnableSharing" = "Enable Sharing";

‎submodules/ChatListUI/Sources/ChatListFilterPresetListController.swift‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -810,13 +810,23 @@ public func chatListFilterPresetListController(context: AccountContext, mode: Ch
810810

811811
var didFocusOnItem = false
812812
controller.afterTransactionCompleted = { [weak controller] in
813-
guard let toggleDirection = animateNextShowHideTagsTransition.swap(nil) else {
813+
guard let controller else {
814814
return
815815
}
816816

817-
guard let controller else {
817+
if let focusOnItemTag, !didFocusOnItem {
818+
controller.forEachItemNode { itemNode in
819+
if let itemNode = itemNode as? ItemListItemNode, let tag = itemNode.tag, tag.isEqual(to: focusOnItemTag) {
820+
didFocusOnItem = true
821+
itemNode.displayHighlight()
822+
}
823+
}
824+
}
825+
826+
guard let toggleDirection = animateNextShowHideTagsTransition.swap(nil) else {
818827
return
819828
}
829+
820830
var presetItemNodes: [ChatListFilterPresetListItemNode] = []
821831
controller.forEachItemNode { itemNode in
822832
if let itemNode = itemNode as? ChatListFilterPresetListItemNode {
@@ -831,15 +841,6 @@ public func chatListFilterPresetListController(context: AccountContext, mode: Ch
831841
}
832842
delay += 0.02
833843
}
834-
835-
if let focusOnItemTag, !didFocusOnItem {
836-
controller.forEachItemNode { itemNode in
837-
if let itemNode = itemNode as? ItemListItemNode, let tag = itemNode.tag, tag.isEqual(to: focusOnItemTag) {
838-
didFocusOnItem = true
839-
itemNode.displayHighlight()
840-
}
841-
}
842-
}
843844
}
844845

845846
return controller

‎submodules/PeerInfoUI/Sources/ChannelPermissionsController.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ public func allGroupPermissionList(peer: EnginePeer, expandMedia: Bool) -> [(Tel
610610
(.banSendMedia, .banMembers),
611611
(.banAddMembers, .banMembers),
612612
(.banPinMessages, .pinMessages),
613+
(.banEditRank, .editRank),
613614
(.banManageTopics, .manageTopics),
614615
(.banChangeInfo, .changeInfo)
615616
]

‎submodules/PremiumUI/Sources/PremiumDemoScreen.swift‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,8 @@ private final class DemoSheetContent: CombinedComponent {
13071307
buttonAnimationName = "premium_unlock"
13081308
case .todo:
13091309
buttonText = strings.Premium_PaidMessages_Proceed
1310+
case .copyProtection:
1311+
buttonText = strings.Premium_PaidMessages_Proceed
13101312
default:
13111313
buttonText = strings.Common_OK
13121314
}

‎submodules/SettingsUI/Sources/Data and Storage/ProxySettingsActionItem.swift‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ final class ProxySettingsActionItem: ListViewItem, ItemListItem {
8181

8282
private final class ProxySettingsActionItemNode: ListViewItemNode, ItemListItemNode {
8383
private let backgroundNode: ASDisplayNode
84+
private let highlightNode: ASDisplayNode
8485
private let topStripeNode: ASDisplayNode
8586
private let bottomStripeNode: ASDisplayNode
8687
private let highlightedBackgroundNode: ASDisplayNode
@@ -99,6 +100,9 @@ private final class ProxySettingsActionItemNode: ListViewItemNode, ItemListItemN
99100
self.backgroundNode = ASDisplayNode()
100101
self.backgroundNode.isLayerBacked = true
101102

103+
self.highlightNode = ASDisplayNode()
104+
self.highlightNode.isLayerBacked = true
105+
102106
self.topStripeNode = ASDisplayNode()
103107
self.topStripeNode.isLayerBacked = true
104108

@@ -128,6 +132,20 @@ private final class ProxySettingsActionItemNode: ListViewItemNode, ItemListItemN
128132
self.addSubnode(self.titleNode)
129133
}
130134

135+
public func displayHighlight() {
136+
if self.backgroundNode.supernode != nil {
137+
self.insertSubnode(self.highlightNode, aboveSubnode: self.backgroundNode)
138+
} else {
139+
self.insertSubnode(self.highlightNode, at: 0)
140+
}
141+
142+
Queue.mainQueue().after(1.2, {
143+
self.highlightNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { _ in
144+
self.highlightNode.removeFromSupernode()
145+
})
146+
})
147+
}
148+
131149
func asyncLayout() -> (_ item: ProxySettingsActionItem, _ params: ListViewItemLayoutParams, _ neighbors: ItemListNeighbors) -> (ListViewItemNodeLayout, (Bool) -> Void) {
132150
let makeTitleLayout = TextNode.asyncLayout(self.titleNode)
133151

@@ -177,6 +195,7 @@ private final class ProxySettingsActionItemNode: ListViewItemNode, ItemListItemN
177195
strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor
178196
strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor
179197
strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor
198+
strongSelf.highlightNode.backgroundColor = item.presentationData.theme.list.itemSearchHighlightColor
180199
}
181200

182201
let _ = titleApply()
@@ -234,6 +253,7 @@ private final class ProxySettingsActionItemNode: ListViewItemNode, ItemListItemN
234253
strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners, glass: item.systemStyle == .glass) : nil
235254

236255
strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight)))
256+
strongSelf.highlightNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight)))
237257
strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0)
238258
strongSelf.topStripeNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: layoutSize.width, height: separatorHeight))
239259
transition.updateFrame(node: strongSelf.bottomStripeNode, frame: CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height + bottomStripeOffset), size: CGSize(width: layoutSize.width - bottomStripeInset - params.rightInset - separatorRightInset, height: separatorHeight)))

‎submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift‎

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ private func stickerSearchableItems(context: AccountContext, archivedStickerPack
14221422
}
14231423
items.append(
14241424
SettingsSearchableItem(
1425-
id: "appearance/stickers-and-emoji/large",
1425+
id: "appearance/stickers-and-emoji/large-emoji",
14261426
title: strings.Appearance_LargeEmoji,
14271427
alternate: synonyms(strings.SettingsSearch_Synonyms_Appearance_LargeEmoji),
14281428
icon: icon,
@@ -1474,7 +1474,7 @@ private func stickerSearchableItems(context: AccountContext, archivedStickerPack
14741474
icon: icon,
14751475
breadcrumbs: [strings.StickerPacksSettings_Emoji],
14761476
present: { context, _, present in
1477-
presentStickerSettings(context, present, .emoji, .suggestOptions)
1477+
presentStickerSettings(context, present, .emoji, .suggestAnimatedEmoji)
14781478
}
14791479
)
14801480
)
@@ -3621,7 +3621,7 @@ private func dataSearchableItems(context: AccountContext) -> [SettingsSearchable
36213621
}
36223622
),
36233623
SettingsSearchableItem(
3624-
id: "data/use-less-data",
3624+
id: "data/less-data-calls",
36253625
title: strings.CallSettings_UseLessData,
36263626
alternate: synonyms(strings.SettingsSearch_Synonyms_Data_CallsUseLessData),
36273627
icon: icon,
@@ -3754,7 +3754,7 @@ private func proxySearchableItems(context: AccountContext, servers: [ProxyServer
37543754
)
37553755
items.append(
37563756
SettingsSearchableItem(
3757-
id: "data/use-proxy",
3757+
id: "data/proxy/use-proxy",
37583758
icon: icon,
37593759
isVisible: false,
37603760
present: { context, _, present in
@@ -4388,17 +4388,7 @@ func settingsSearchableItems(
43884388
let activeWebSessionsContext = webSessionsContext
43894389
|> mapToSignal { webSessionsContext -> Signal<WebSessionsContext?, NoError> in
43904390
if let webSessionsContext = webSessionsContext {
4391-
return webSessionsContext.state
4392-
|> map { state -> WebSessionsContext? in
4393-
if !state.sessions.isEmpty {
4394-
return webSessionsContext
4395-
} else {
4396-
return nil
4397-
}
4398-
}
4399-
|> distinctUntilChanged(isEqual: { lhs, rhs in
4400-
return lhs !== rhs
4401-
})
4391+
return .single(webSessionsContext)
44024392
} else {
44034393
return .single(nil)
44044394
}
@@ -4417,6 +4407,7 @@ func settingsSearchableItems(
44174407
activeSessionsContext,
44184408
activeWebSessionsContext
44194409
)
4410+
|> deliverOnMainQueue
44204411
|> map {
44214412
canAddAccount,
44224413
localizations,
@@ -4615,7 +4606,20 @@ func searchSettingsItems(items: [SettingsSearchableItem], query: String) -> [Set
46154606
}
46164607

46174608
public func handleSettingsPathUrl(context: AccountContext, path: String, navigationController: NavigationController) {
4618-
let _ = (settingsSearchableItems(context: context)
4609+
var activeSessionsContext: Signal<ActiveSessionsContext?, NoError> = .single(nil)
4610+
var webSessionsContext: Signal<WebSessionsContext?, NoError> = .single(nil)
4611+
4612+
if path.hasPrefix("devices") {
4613+
activeSessionsContext = .single(context.engine.privacy.activeSessions())
4614+
} else if path.hasPrefix("privacy/active-websites") {
4615+
webSessionsContext = .single(context.engine.privacy.webSessions())
4616+
}
4617+
4618+
let _ = (settingsSearchableItems(
4619+
context: context,
4620+
activeSessionsContext: activeSessionsContext,
4621+
webSessionsContext: webSessionsContext
4622+
)
46194623
|> take(1)
46204624
|> deliverOnMainQueue).start(next: { items in
46214625
guard let item = items.first(where: { $0.id == AnyHashable(path) }) else {

‎submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public enum InstalledStickerPacksEntryTag: ItemListItemTag {
7171
case suggestOptions
7272
case largeEmoji
7373
case dynamicOrder
74+
case suggestAnimatedEmoji
7475

7576
public func isEqual(to other: ItemListItemTag) -> Bool {
7677
if let other = other as? InstalledStickerPacksEntryTag, self == other {
@@ -430,7 +431,7 @@ private indirect enum InstalledStickerPacksEntry: ItemListNodeEntry {
430431
case let .suggestAnimatedEmoji(text, value):
431432
return ItemListSwitchItem(presentationData: presentationData, systemStyle: .glass, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in
432433
arguments.toggleSuggestAnimatedEmoji(value)
433-
})
434+
}, tag: InstalledStickerPacksEntryTag.suggestAnimatedEmoji)
434435
case let .suggestAnimatedEmojiInfo(_, text):
435436
return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section)
436437
case let .packsTitle(_, text):

‎submodules/SettingsUI/Sources/ThemePickerController.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ private final class ContextControllerContentSourceImpl: ContextControllerContent
13261326
}
13271327

13281328
private func iconColors(theme: PresentationTheme) -> [String: UIColor] {
1329-
let accentColor = theme.actionSheet.controlAccentColor
1329+
let accentColor = theme.chat.inputPanel.panelControlColor
13301330
var colors: [String: UIColor] = [:]
13311331
colors["Sunny.Path 14.Path.Stroke 1"] = accentColor
13321332
colors["Sunny.Path 15.Path.Stroke 1"] = accentColor

‎submodules/TelegramUI/Components/MinimizedContainer/Sources/MinimizedHeaderNode.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ final class MinimizedHeaderNode: ASDisplayNode {
311311
transition.updateFrame(view: view, frame: closeButtonFrame)
312312
}
313313

314-
transition.updateFrame(view: self.backgroundView, frame: CGRect(origin: .zero, size: CGSize(width: size.width, height: 243.0)))
314+
transition.updateFrame(view: self.backgroundView, frame: CGRect(origin: .zero, size: CGSize(width: size.width, height: 246.0)))
315315

316316
//self.backgroundView.update(size: CGSize(width: size.width, height: 243.0), color: self.theme.navigationBar.opaqueBackgroundColor, topCornerRadius: 25.0, bottomCornerRadius: 62.0, transition: .immediate)
317317

318318
transition.updateAlpha(layer: self.progressView.layer, alpha: isExpanded && self.progress != nil ? 1.0 : 0.0)
319319
if let progress = self.progress {
320-
self.progressView.frame = CGRect(origin: .zero, size: CGSize(width: size.width * CGFloat(progress), height: 243.0))
320+
self.progressView.frame = CGRect(origin: .zero, size: CGSize(width: size.width * CGFloat(progress), height: 246.0))
321321
}
322322
}
323323
}

‎submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreenOpenMember.swift‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ extension PeerInfoScreenNode {
3131
}
3232

3333
if actions.contains(.editRank) {
34-
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.GroupInfo_ActionEditRank, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Tag"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in
34+
var actionTitle: String = self.presentationData.strings.GroupInfo_ActionEditRank
35+
if case .admin = member.role {
36+
actionTitle = self.presentationData.strings.GroupInfo_ActionEditAdminRank
37+
}
38+
items.append(.action(ContextMenuActionItem(text: actionTitle, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Tag"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in
3539
c?.dismiss {
3640
guard let self else {
3741
return
@@ -42,7 +46,11 @@ extension PeerInfoScreenNode {
4246
}
4347

4448
if actions.contains(.promote) && enclosingPeer is TelegramChannel {
45-
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.GroupInfo_ActionPromote, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Promote"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in
49+
var actionTitle: String = self.presentationData.strings.GroupInfo_ActionPromote
50+
if case .admin = member.role {
51+
actionTitle = self.presentationData.strings.GroupInfo_ActionEditAdmin
52+
}
53+
items.append(.action(ContextMenuActionItem(text: actionTitle, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Promote"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in
4654
c?.dismiss {
4755
guard let self else {
4856
return

0 commit comments

Comments
 (0)